Repository navigation
fix(hub): attribute imported Build authors and preserve webhook delivery IDs - #323
Merged
Merged
Conversation
Resolve the Build author from the account linked to the imported commit, add an idempotent dry-run-first author repair command, keep GitHub webhook delivery IDs lossless through recovery and redelivery, and add a non-mutating webhook communication diagnostic. Local, unreviewed work preserved separately from the deployment branch. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Combine configured workflow-path selection from #319 with commit-author resolution. Deselected workflows settle before author lookup; author failures keep per-run completion unrecorded so recovery retries them. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved security issues allow commit attribution to grant sharing authority without authenticated ownership evidence and webhook diagnostics to pass despite missing required access-removal subscriptions.
13 open issues
Check all required access-removal webhook subscriptions · New Require authenticated ownership before granting sharing authority · New Ship maintenance commands with compiled code and secret loading · New Retry unresolved author attribution independently of Build failure · New Preview the proposed author and ownership changes · New Require workflow-attempt-matched completion evidence · New Defer owner linking for users without a profile · New Include contributing runs when checking Build completion · New Include the fallback author in repository search · New Print command results independently of log level · New Preserve safe operator errors in script output · New Move the saved-author query into the repository · New Keep tests beside their function and move detail assertions · New
What changed in this PR
Improves Hub’s GitHub Actions import and recovery flow by attributing Builds to their exact commit author and preserving large webhook delivery IDs.
Changes:
- Adds commit-author lookup, retry handling, and author display fallbacks while preserving explicit owners.
- Preserves 64-bit delivery IDs and distinguishes HTTP, transport, and response failures.
- Adds scoped author repair, read-only webhook diagnostics, documentation, and regression coverage.
Existing production Builds still require an approved repair; deployed webhook recovery remains unverified.
| File | Description |
|---|---|
hub/server/workers/github-recovery.test.ts |
Adds the commit-author client mock. |
hub/server/scripts/repair-github-build-author/index.ts |
Adds the scoped repair command. |
hub/server/scripts/check-github-webhooks/index.ts |
Adds the webhook diagnostic command. |
hub/server/repositories/prototype-index/find-repository-index/index.ts |
Adds gallery author fallback from Builds. |
hub/server/repositories/prototype-index/find-repository-index/index.db.test.ts |
Covers author fallback and explicit owners. |
hub/server/repositories/prototype-index/find-prototype-detail/index.ts |
Adds detail-header author fallback. |
hub/server/repositories/github-webhook-redeliveries/types.ts |
Supports exact decimal delivery IDs. |
hub/server/repositories/github-webhook-redeliveries/claim-due-github-webhook-redeliveries/index.ts |
Avoids rounding large claimed IDs. |
hub/server/repositories/github-webhook-deliveries/find-github-webhook-evidence/index.ts |
Reads delivery, recovery, and Build evidence. |
hub/server/repositories/github-webhook-deliveries/find-github-webhook-evidence/index.db.test.ts |
Covers scoped, read-only evidence lookup. |
hub/server/repositories/github-builds/record-github-build-run-completion/index.ts |
Clarifies the completion comment. |
hub/server/repositories/github-builds/record-github-build-author/index.ts |
Stores attribution and links unset mapped owners. |
hub/server/repositories/github-builds/list-github-builds-awaiting-import/index.ts |
Clarifies the pending-author-work comment. |
hub/server/repositories/github-builds/find-github-build-author-target/index.ts |
Finds a repository-scoped repair target. |
hub/server/integrations/github/errors.ts |
Adds commit-lookup HTTP errors. |
hub/server/integrations/github/create-github-webhook-deliveries-client/types.ts |
Extends delivery IDs and repository scope. |
hub/server/integrations/github/create-github-webhook-deliveries-client/index.ts |
Preserves IDs and adds diagnostic reads. |
hub/server/integrations/github/create-github-webhook-deliveries-client/index.test.ts |
Covers precision, validation, and safe responses. |
hub/server/integrations/github/create-github-webhook-deliveries-client/errors.ts |
Classifies webhook request failures. |
hub/server/integrations/github/create-github-actions-client/index.ts |
Looks up linked authors by exact commit SHA. |
hub/server/integrations/github/create-github-actions-client/index.test.ts |
Covers author lookup and provider failures. |
hub/server/domains/github-webhooks/types.ts |
Accepts exact IDs for redelivery. |
hub/server/domains/github-webhooks/recover-github-webhook-deliveries/index.db.test.ts |
Covers large-ID recovery through storage. |
hub/server/domains/github-webhooks/check-github-webhook-communication/index.ts |
Coordinates read-only communication checks. |
hub/server/domains/github-webhooks/check-github-webhook-communication/index.test.ts |
Covers diagnostic results and evidence limits. |
hub/server/domains/github-builds/repair-github-build-author/index.ts |
Coordinates author inspection and repair. |
hub/server/domains/github-builds/repair-github-build-author/index.db.test.ts |
Covers repair safety and repeat application. |
hub/server/domains/github-builds/prepare-github-workflow-run-build/index.ts |
Resolves or reuses saved attribution. |
hub/server/domains/github-builds/import-github-workflow-run/types.ts |
Adds the author-lookup dependency. |
hub/server/domains/github-builds/import-github-workflow-run/index.ts |
Continues artifact import during lookup failures. |
hub/server/domains/github-builds/import-github-workflow-run/index.db.test.ts |
Covers attribution, preservation, and retries. |
hub/package.json |
Exposes both maintenance commands. |
hub/docs/github-actions-builds.md |
Documents authors, repair, and webhook checks. |
hub/client/application/hub/view-models/repository-show-data/index.ts |
Avoids login-only user matching in real data. |
hub/client/application/hub/view-models/repository-show-data/index.test.ts |
Covers snapshot and explicit-owner display. |
Review effort: Max (adaptive)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…lookups Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
arniebradfo
approved these changes
Nov 20, 2026
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.



Why
Builds imported from GitHub Actions workflow runs had no author, so the Hub gallery showed "Unknown author" even when GitHub knew who made the commit. Webhook delivery recovery also failed because GitHub delivery IDs can exceed JavaScript's safe integer range. The App's credentials worked; the recovery failure came from parsing and validating those IDs.
What changes
Hub resolves the linked GitHub author of the exact imported commit and stores that identity on the Build. The gallery and prototype detail use it when the prototype has no stored owner; search uses the same visible author. Unlinked authors remain unknown. Lookup failures do not block available artifacts, and recovery retries the attribution.
Commit attribution does not assign ownership. Existing owners are retained. For a non-admin to manage public share links, the stored owner must match the signed-in user, a successful Build must match their GitHub identity, and they must still have repository access. Ownerless imports require repository-admin permission. The existing schema does not independently establish the provenance of historical owner assignments.
npm run github:repair-authorpreviews the proposed Build author and whether it would update or preserve existing metadata. It affects one repository and Build, writes only with--apply, and never changes the prototype owner. The guide also documents compiled and Azure maintenance entry points.Webhook delivery IDs are parsed losslessly, stored as 64-bit integers, and sent as exact decimal strings when redelivered. The read-only
npm run github:check-webhooksdiagnostic checks App and repository access, required webhook settings and subscriptions, and scoped delivery evidence. It compares Build completion to the current provider attempt; a signed receipt or completed Build alone does not prove that webhook recovery processed the run.These changes do not repair production data. Existing Builds need a separately approved repair after deployment, and live webhook recovery has not been verified against the deployed Hub.
The screenshots show a local Hub route (
/repositories/<id>) at 1280×900 with synthetic data. An unlinked author remains "Unknown author"; an imported author appears as "By @octocat".No Storybook story's presentation changes: Storybook fixtures keep their existing author matching, so there is no Storybook screenshot section.