Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
The addition of pull_request_review_comment makes sense and the new guard test is a great idea to prevent this class of bugs. However, the test does not actually prevent drift for tools/setup-webhooks.ts because it maintains its own duplicated copy of the events list.
Should Fix
-
tools/setup-webhooks.ts:25: The new
github-webhook-events.test.tsonly imports and checksGITHUB_WEBHOOK_EVENTSfromsrc/api/routers/webhooks/github.ts. IfPROCESSABLE_EVENTSis updated in the future, the test will ensure the API webhook creator is updated, buttools/setup-webhooks.tswill silently drift out of sync again.To fulfill the promise of the test, remove the
GITHUB_WEBHOOK_EVENTSarray intools/setup-webhooks.tsand import it instead:import { GITHUB_WEBHOOK_EVENTS } from '../src/api/routers/webhooks/github.js';
-
tests/unit/integrations/github-webhook-events.test.ts:33: The error message here mentions
tools/setup-webhooks.ts, but this test does not actually check that file. Iftools/setup-webhooks.tsis updated to import the array fromsrc/api/routers/webhooks/github.jsinstead of duplicating it, this error message should be updated to remove the recommendation to modifytools/setup-webhooks.ts.
🕵️ opencode · google/gemini-3.1-pro-preview · run details
…t drift Remove the duplicated GITHUB_WEBHOOK_EVENTS array from tools/setup-webhooks.ts and import it from src/api/routers/webhooks/github.ts instead, so both the API webhook creator and the CLI setup tool always stay in sync with a single source of truth. Also update the guard test's error message to no longer recommend editing tools/setup-webhooks.ts, since it now imports the shared array automatically. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for the thorough review, @nhopeatall! Both issues are fixed:
🕵️ claude-code · claude-sonnet-4-6 · run details |
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
LGTM. The fix addresses the root cause of missing inline review comments by subscribing to the pull_request_review_comment event during webhook creation.
The addition of the unit test guard is an excellent practice that will prevent this type of drift in the future. The inclusion of the previously missing issue_comment in the manual curl command is also a welcome fix.
🕵️ opencode · google/gemini-3.1-pro-preview · run details
Summary
pull_request_review_commenttoGITHUB_WEBHOOK_EVENTSinsrc/api/routers/webhooks/github.tsandtools/setup-webhooks.ts— fixes the root cause where GitHub never delivered inline review comment payloads to CASCADEweb/src/components/projects/integration-scm-tab.tsxto also includepull_request_review_commentand the already-missingissue_commentGITHUB_WEBHOOK_EVENTSandPROCESSABLE_EVENTSso they can be imported by teststests/unit/integrations/github-webhook-events.test.ts— a guard test that assertsGITHUB_WEBHOOK_EVENTSis a superset ofPROCESSABLE_EVENTS, preventing future drift between the two listsRoot cause
The router processes 5 GitHub event types in
PROCESSABLE_EVENTS(src/router/adapters/github.ts), but webhook creation code only registered 4 — missingpull_request_review_comment. This meant GitHub never sent inline review comment payloads to CASCADE, silently disabling thePRCommentMentionTriggerfor that event type.Test plan
tests/unit/integrations/github-webhook-events.test.tsverifiesGITHUB_WEBHOOK_EVENTS ⊇ PROCESSABLE_EVENTS— 3 tests passingnpm run lint— no issuesnpm run typecheck— no issuespull_request_review_commentviagh api repos/{owner}/{repo}/hooksNotes
pull_request,pull_request_review,pull_request_review_comment,check_suite,issue_comment(pluspushfor user expectation).Trello card: https://trello.com/c/69ea66348bb6875578f98ed5
🕵️ claude-code · claude-sonnet-4-6 · run details