From 0f06a65c949af1372511d756e874954c12bbb2bf Mon Sep 17 00:00:00 2001 From: Test Date: Wed, 25 Mar 2026 20:58:11 +0100 Subject: [PATCH] fix: skip test files in webhook extraction Test files often mock webhook patterns (e.g., constructEvent in Stripe test mocks), causing false detection. Skip files in test directories. Co-Authored-By: Claude Opus 4.6 (1M context) --- gitnexus/src/core/ingestion/workers/parse-worker.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gitnexus/src/core/ingestion/workers/parse-worker.ts b/gitnexus/src/core/ingestion/workers/parse-worker.ts index f93bc10cb..aa12ae1f2 100644 --- a/gitnexus/src/core/ingestion/workers/parse-worker.ts +++ b/gitnexus/src/core/ingestion/workers/parse-worker.ts @@ -1357,6 +1357,10 @@ export function extractORMQueries( // ============================================================================ function extractWebhooks(filePath: string, content: string, out: ExtractedWebhook[]): void { + // Skip test files — they often mock webhook patterns + const lp = filePath.toLowerCase(); + if (lp.includes('/test') || lp.includes('.test.') || lp.includes('.spec.') || lp.includes('__test')) return; + if (content.includes('constructEvent') || content.includes('webhooks.constructEvent')) { const eventTypes: string[] = []; const caseRe = /case\s+['"]([.\w-]+)['"]/g;