Skip to content

feat(github): say why a webhook delivery changed nothing - #198

Merged
imshashank merged 1 commit into
mainfrom
feat/github-webhooks
Aug 8, 2026
Merged

feat(github): say why a webhook delivery changed nothing#198
imshashank merged 1 commit into
mainfrom
feat/github-webhooks

Conversation

@imshashank

@imshashank imshashank commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Why

Every GitHub delivery was marked processed, including ones that were signature verified and then dropped on the floor. applyGithubEvent returns early when no github_repository_sync row matches the payload's repository, and the route recorded that identically to a delivery that created git links and moved an issue.

The practical effect: a workspace whose install never bound to a repository looks exactly like one where webhooks never arrive. There was no way to answer "are we receiving webhooks?" from inside the product.

What

applyGithubEvent now returns an ignoredReason, and the route records it on the delivery row using the error column that already existed, with status ignored instead of processed. No migration.

Reason Meaning
unsupported_event the parser does not cover that event type
repository_not_connected no repository sync row matches, the fresh install case
repository_disabled the repository is connected but switched off
no_issue_identifier the branch and title mention no issue
no_matching_issue the identifier names an issue this workspace does not have

A delivery that did the work still lands as processed with error null, and the success response shape is unchanged, so existing callers are unaffected.

Tests

7 new: 4 in packages/services covering each reason and the success case, 3 in the route asserting the row carries status and reason. bun run verify green.

Note

This makes the failure legible, it does not by itself make repositories sync. Merged pull request state is already handled end to end: pullRequestState maps merged and the badge renders "Merged", with a pr_merged notification and the issue advancing to a completed state.

🤖 Generated with Claude Code

Greptile Summary

The PR classifies GitHub webhook deliveries that perform no work as ignored and records a specific reason instead of marking every verified delivery as processed.

  • Adds typed ignored outcomes for unsupported events, disconnected or disabled repositories, and unmatched issues.
  • Persists ignored status and reason on webhook delivery rows.
  • Adds service and route coverage for ignored and processed outcomes.

Confidence Score: 4/5

The PR is not yet safe to merge because ignored deliveries remain eligible for reprocessing and can apply stale webhook events after repository or issue state changes.

The route writes successful no-op deliveries as ignored, but its duplicate gate recognizes only processed as terminal; redelivering the same delivery resets it to received and runs the event application path again.

Files Needing Attention: apps/web/src/app/api/webhooks/github/route.ts

Important Files Changed

Filename Overview
apps/web/src/app/api/webhooks/github/route.ts Persists ignored outcomes, but the existing duplicate gate still reprocesses deliveries carrying the new terminal-like ignored status.
packages/services/src/github/apply.ts Adds explicit ignored reasons to no-op service outcomes while preserving successful processing results.
apps/web/tests/app/api/webhooks/github/route.test.ts Covers initial ignored and processed persistence but does not alter the outstanding redelivery behavior.
packages/services/tests/github/apply.test.ts Verifies representative ignored reasons and the successful null-reason result.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Signed GitHub webhook] --> B[Claim delivery row]
  B --> C{Existing status is processed?}
  C -->|Yes| D[Return duplicate]
  C -->|No| E[Reset delivery to received]
  E --> F[Apply GitHub event]
  F --> G{Ignored reason?}
  G -->|No| H[Store processed]
  G -->|Yes| I[Store ignored and reason]
  I -. Redelivery re-enters .-> B
Loading

Reviews (2): Last reviewed commit: "feat(github): say why a webhook delivery..." | Re-trigger Greptile

Every delivery was marked processed, including the ones that were
verified and then dropped because no repository matched. A workspace
whose install never bound looks exactly like one where webhooks never
arrive, and there was no way to tell the two apart.

Report a reason from applyGithubEvent and record it on the delivery row,
which already had an unused error column. A delivery that did the work
still lands as processed with no reason.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@imshashank
imshashank requested a review from pulkitxm as a code owner August 8, 2026 11:19
@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
orbit Ready Ready Preview Aug 8, 2026 11:40am

Request Review

@github-actions github-actions Bot added tests Test coverage and test infrastructure area: web The Next.js app and its UI area: integrations GitHub, Slack and webhooks labels Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@imshashank, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 33 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b73b1d12-8ac4-49bb-819e-ce49cb5f5edf

📥 Commits

Reviewing files that changed from the base of the PR and between 66b8f11 and 48571dc.

📒 Files selected for processing (4)
  • apps/web/src/app/api/webhooks/github/route.ts
  • apps/web/tests/app/api/webhooks/github/route.test.ts
  • packages/services/src/github/apply.ts
  • packages/services/tests/github/apply.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread apps/web/src/app/api/webhooks/github/route.ts
@github-actions github-actions Bot added the area: issues Issues, lists and boards label Aug 8, 2026
@imshashank
imshashank force-pushed the feat/github-webhooks branch from aed2d7d to 48571dc Compare August 8, 2026 11:41
@github-actions github-actions Bot removed the area: issues Issues, lists and boards label Aug 8, 2026
@imshashank
imshashank merged commit 914738f into main Aug 8, 2026
18 of 19 checks passed
@imshashank
imshashank deleted the feat/github-webhooks branch August 8, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: integrations GitHub, Slack and webhooks area: web The Next.js app and its UI tests Test coverage and test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant