Repository navigation
feat(settings): show why recent GitHub deliveries changed nothing - #260
Conversation
The reason a delivery was ignored was recorded and then never shown, so a workspace watching hundreds of accepted webhooks had no way to learn that every one of them named no issue. List the recent deliveries under Integrations with the reason in words, and count the ones that arrived and changed nothing. Reading them needs integration:manage, because the delivery table is not scoped to a workspace. Also cover the whole path in tests, from a signed delivery to a row on the pulls page, including a merged pull request showing as merged. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe integrations settings page now loads recent GitHub webhook deliveries for authorized principals. A new component displays delivery summaries, statuses, events, timestamps, and reasons. Tests cover delivery rendering and pull request webhook processing. ChangesGitHub delivery visibility
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant IntegrationsPage
participant loadGithubDeliveries
participant Database
participant GithubDeliveries
IntegrationsPage->>loadGithubDeliveries: load deliveries for principal
loadGithubDeliveries->>Database: query recent webhook deliveries
Database-->>loadGithubDeliveries: delivery records
loadGithubDeliveries-->>IntegrationsPage: delivery views
IntegrationsPage->>GithubDeliveries: render delivery views
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
…thing Counting only the ignored ones let a run of failures report that every recent delivery changed something, which is the worst moment to say so. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The panel counted every delivery that was not processed as one that "arrived and changed nothing". webhook_delivery carries four statuses, and that sentence is true of exactly one of them. A failed delivery did not change nothing, it errored. A delivery still marked received never recorded an outcome at all, because processing stopped between the claim and the update, so the panel was reporting an interrupted webhook as an ordinary no-change result. That is the failure this panel exists to expose, reproduced inside the panel itself. The summary now names each outcome separately, and only claims everything landed when every delivery really was processed. A test asserted the old behaviour outright, that a failed delivery belongs among the ones that changed nothing. It was wrong rather than merely outdated, so it is replaced rather than adjusted. Also drops docs/superpowers/plans/2026-08-09-open-source-readiness.md, which arrived with an unrelated commit and is 1942 of this branch's 2194 lines. It is untouched in git history and belongs in its own change.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web/src/features/settings/integrations-data.ts`:
- Around line 100-124: Add database-backed tests for loadGithubDeliveries
covering authorized and unauthorized principals, mixed GitHub and non-GitHub
delivery records, newest-first ordering, DELIVERY_LIMIT truncation, and ISO
receivedAt mapping. Assert unauthorized access returns an empty array and
authorized results include only the expected GitHub records with mapped fields.
In `@apps/web/tests/features/settings/github-deliveries.test.tsx`:
- Around line 37-120: The GithubDeliveries tests only verify aggregate
summaries, not each delivery’s rendered status, event, and relative-time fields.
Extend the GithubDeliveries test coverage with row-level assertions that
identify a delivery and verify all three fields are rendered, using the existing
delivery fixture values and accessible text or roles.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 05e2ce72-37e7-4bf3-aff0-6e8a53cf8b65
📒 Files selected for processing (5)
apps/web/src/app/(app)/settings/integrations/page.tsxapps/web/src/features/settings/github-deliveries.tsxapps/web/src/features/settings/integrations-data.tsapps/web/tests/app/api/webhooks/github/route.test.tsapps/web/tests/features/settings/github-deliveries.test.tsx
Nothing exercised loadGithubDeliveries, so its permission gate, its provider filter, its ordering, its limit and its timestamp mapping could all regress without a single test noticing. The panel tests were no better: they asserted the summary sentence and the reason copy, so removing the status, the event or the arrival time from a row left the suite green. Seven tests against a real database for the loader, and one that reads a rendered row. Checked they bite rather than merely exist: dropping the permission gate and widening the limit turns three of them red.
#263 landed first and scoped the delivery query to one workspace. This branch was written before that column existed, so its copy of loadGithubDeliveries still filtered on provider alone, and git offered both sides. Taking this branch's version would have quietly put the cross workspace read back, which is the whole reason #263 went first. main wins for the query. This branch wins for the summary, since #263 predates the outcome fix and carries the sentence that called a failed delivery one that changed nothing. Two tests now hold the scoping down rather than trusting the next merge to resolve it the same way: a second workspace must not see the first one's deliveries, and a delivery nobody could attribute belongs to no workspace at all. Removing the organization predicate turns both red. The delivery fixture attributes to the caller's workspace by default, which it could not do before the column existed.
… not take exactOptionalPropertyTypes refuses undefined as a value for an optional property, and the field was redundant anyway: the fixture attributes to the caller's workspace and the update that follows is what clears it.
The report
"We are getting so many GitHub webhooks and it is not even working. I don't see a single pull request in the UI in any workspace."
What the evidence already says
The Vercel log shows a steady stream of
POST 200 /api/webhooks/github, and the pulls page renders "No pull requests linked to your issues", which is theconnectedbranch of the state machine merged in #249. Together those rule a lot out: deliveries arrive, signatures verify, an active installation exists, and a repository is tracked.What is left is linking. Orbit creates a
git_linkonly when a pull request's branch or title names an issue, and the branches being merged into this repository do not.The actual gap
#198 started recording why a delivery changed nothing, but that reason was write-only. Nothing ever read it back, so from the outside a workspace where every delivery is deliberately ignored looks identical to one that is broken. That is the whole reason this question keeps coming back.
Integrations now lists recent deliveries with the reason in plain words:
no_issue_identifierrepository_not_connectedrepository_disabledno_matching_issueunsupported_eventabove a line saying how many of the last N arrived and changed nothing.
Scoping caveat
webhook_deliveryhas noorganization_id, so this list cannot be scoped per workspace. Reading it requiresintegration:manage. An unknown reason falls through to the raw string rather than being hidden.Tests
9 new. 6 on the panel and the reason copy, and 3 walking the whole path against a real database: a signed delivery whose branch names an issue becomes a row on the pulls page, a merged pull request reads as merged, and a branch naming no issue leaves the page empty while the delivery records
no_issue_identifier.bun run verifygreen.What this does not do
It makes the situation legible, it does not make our own pull requests link. For that a branch has to name its issue, which is what Copy branch name produces. PR #184 widens matching to issues named in the pull request body.
🤖 Generated with Claude Code
Greptile Summary
The PR makes recent GitHub webhook outcomes visible in integration settings and distinguishes deliveries that were processed, ignored, failed, or left without an outcome.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (6): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile