Skip to content

feat(settings): show why recent GitHub deliveries changed nothing - #260

Merged
imshashank merged 11 commits into
mainfrom
chore/webhook-visibility
Aug 9, 2026
Merged

imshashank merged 11 commits into
mainfrom
chore/webhook-visibility

Conversation

@imshashank

@imshashank imshashank commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

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 the connected branch 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_link only 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:

Stored reason Shown as
no_issue_identifier Its branch and title name no issue
repository_not_connected That repository is not connected here
repository_disabled That repository is switched off
no_matching_issue It names an issue this workspace does not have
unsupported_event Orbit does not act on this event

above a line saying how many of the last N arrived and changed nothing.

Scoping caveat

webhook_delivery has no organization_id, so this list cannot be scoped per workspace. Reading it requires integration: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 verify green.

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.

  • Adds status-specific aggregate delivery copy.
  • Adds component tests covering each outcome and mixed batches.
  • Adds integration-data tests for authorization, tenant isolation, filtering, ordering, limits, and timestamp serialization.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/web/src/features/settings/github-deliveries.tsx Separates ignored, failed, and unfinished deliveries in the summary, resolving the previously reported status misclassification.
apps/web/tests/features/settings/github-deliveries.test.tsx Covers the four delivery statuses, mixed outcomes, row details, and successful-delivery fallback copy.
apps/web/tests/features/settings/integrations-data.test.ts Verifies delivery loading is tenant-scoped, permission-gated, provider-filtered, ordered, limited, and serialized correctly.

Reviews (6): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

imshashank and others added 2 commits August 9, 2026 11:45
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]>
@imshashank
imshashank requested a review from pulkitxm as a code owner August 9, 2026 06:29
@vercel

vercel Bot commented Aug 9, 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 9, 2026 8:09pm

Request Review

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

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

GitHub delivery visibility

Layer / File(s) Summary
Delivery data loading
apps/web/src/features/settings/integrations-data.ts, apps/web/tests/app/api/webhooks/github/route.test.ts
The loader returns up to 20 recent authorized GitHub deliveries as serialized views. Webhook tests cover pull request ingestion, merged state updates, and ignored deliveries without issue identifiers.
Delivery presentation
apps/web/src/features/settings/github-deliveries.tsx, apps/web/tests/features/settings/github-deliveries.test.tsx
The component maps delivery reasons and statuses, creates summary text, renders delivery details, and omits the section for empty input. Tests cover delivery outcomes and reason handling.
Settings page integration
apps/web/src/app/(app)/settings/integrations/page.tsx
The integrations page loads GitHub deliveries with existing settings data and renders the new component.

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
Loading

Possibly related PRs

  • Noveum/orbit#36: Introduces the GitHub webhook delivery flow extended by this change.
  • Noveum/orbit#269: Modifies related GitHub webhook delivery handling and repository tracking states.

Suggested reviewers: pulkitxm

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: showing why recent GitHub deliveries produced no changes in settings.
Description check ✅ Passed The description directly explains the delivery panel, permission scope, status summaries, reasons, tests, and intended limitations.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/webhook-visibility

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.

…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]>
@github-actions github-actions Bot added the documentation Docs, the README, or anything that explains Orbit label Aug 9, 2026
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.
@github-actions github-actions Bot removed the documentation Docs, the README, or anything that explains Orbit label Aug 9, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 22eb19a and 29a2e51.

📒 Files selected for processing (5)
  • apps/web/src/app/(app)/settings/integrations/page.tsx
  • apps/web/src/features/settings/github-deliveries.tsx
  • apps/web/src/features/settings/integrations-data.ts
  • apps/web/tests/app/api/webhooks/github/route.test.ts
  • apps/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.
@imshashank
imshashank merged commit 6b513f2 into main Aug 9, 2026
13 checks passed
@imshashank
imshashank deleted the chore/webhook-visibility branch August 9, 2026 20:15

This branch was successfully deployed

1 active deployment
Preview — 8126dcb1 Deployed Aug 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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