refactor(router): extract webhook handlers into dedicated modules#482
Merged
zbigniewsobiecki merged 4 commits intodevfrom Feb 22, 2026
Merged
Conversation
Merge dev to main
Merge dev to main
Use handleTrelloWebhook() as the single entry point (matching GitHub/JIRA pattern), merge duplicate ./trello.js imports, and split misleading test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
🔍 Reviewing PR... |
nhopeatall
approved these changes
Feb 22, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM — clean extraction refactor that breaks a 726-line god module into well-bounded provider-specific modules with proper dependency injection (triggerRegistry as parameter instead of closure capture). Verified behavioral equivalence of extracted code, confirmed deduplication of parseGitHubWebhookPayload between router and server, and all 55 new tests pass with zero TypeScript errors.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors the
src/router/index.tsgod module (726 lines) by extracting provider-specific webhook handlers and shared utilities into dedicated modules.src/router/webhookParsing.ts(eliminates verbatim duplication ofparseGitHubWebhookPayloadbetweenrouter/index.tsandserver.ts, and replaces 6x copy-pastedrawHeadersextraction)src/router/trello.tssrc/router/github.tssrc/router/jira.tssrc/router/index.tsfrom 726 → ~190 lines (routing/orchestration only)webhookParsing.test.ts,trello.test.ts,github.test.ts,jira.test.ts)Test plan
config/projects.test.ts), no regressionsnpm run typecheck)npm run lint)Card
https://trello.com/c/p8olsrA4/73-refactor-router-indexts-extract-webhook-handlers-deduplicate
🤖 Generated with Claude Code