Repository navigation
[D] Release reconciliation, health, and ops docs - #20
Conversation
Backfill and six-hour GitHub reconciliation converge current stable releases without webhook receipts. Cron dispatch keeps Identity minute maintenance independent. Health exposes configuration, timestamps, staleness, and release counts; README documents secrets, webhooks, redelivery, and rollback. Part of docs/GITHUB_RELEASE_WEBHOOK_PLAN.md Phase D.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
@codex review |
There was a problem hiding this comment.
Pull request overview
Implements Phase D of the GitHub release webhook plan for the Worker: adds an initial backfill + 6-hour reconciliation loop against GitHub’s public /releases/latest, persists durable ops markers (webhook/recon timestamps + ETags), extends health output, and documents operator procedures.
Changes:
- Add a 6-hour scheduled reconciliation job (separate from minute Identity maintenance) plus reconciliation/backfill implementation with ETag + bounded fetch.
- Introduce durable ops state for release ingestion (last success markers, per-repo ETags) and expose
githubReleaseshealth detail. - Add operator documentation and tests for reconciliation + ops state.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| worker/wrangler.jsonc | Adds separate 6-hour cron trigger alongside minute maintenance. |
| worker/src/release-reconciliation.ts | Implements backfill + reconciliation against GitHub /releases/latest, including ETag handling and ops marker writes. |
| worker/src/release-reconciliation.test.ts | Adds reconciliation/backfill tests (ETag, clear-on-404, partial failure behavior, etc.). |
| worker/src/release-projection.ts | Adds authoritative apply path for reconciliation/backfill writes. |
| worker/src/release-ops-state.ts | Adds durable ops state storage for webhook/reconciliation markers + per-repo ETags and stale detection helper. |
| worker/src/release-ops-state.test.ts | Tests ops marker persistence and staleness classification. |
| worker/src/release-health.ts | Adds health detail loader for release ingestion/read configuration and ops state. |
| worker/src/index.ts | Wires githubReleases health detail and dispatches reconciliation scheduled runs by cron string. |
| worker/src/github-release-webhook.ts | Records webhook success marker after processing deliveries. |
| worker/README.md | Documents operator setup (secret install, schedules, org webhook, redelivery, reconciliation, rollback, health fields). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4cebe14a7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }; | ||
| // Authoritative path: GitHub's current stable wins even when older than a | ||
| // local row left behind by a missed delete/unpublish webhook. | ||
| const wrote = await applyAuthoritativeCurrentRelease(store, release); |
There was a problem hiding this comment.
Guard authoritative writes against concurrent webhooks
If GitHub prepares a response for release A and release B is published while that request is in flight, the webhook can store B before this unconditional authoritative write stores the stale A response over it. The public endpoint then advertises A until the next six-hour reconciliation, so capture the projection version before fetching and condition the reconciliation write on that version remaining unchanged, or otherwise verify response freshness before replacing a webhook update.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Intentional for Phase D exit criterion: reconciliation must force-write GitHub's current stable even when it is older than a local row left by a missed delete/unpublish. Guarding with "local newer wins" re-breaks that path. A concurrent publish during the GitHub GET is a rare race; the webhook itself or the next six-hour recon restores truth. Leaving unresolved for human visibility.
…ers. Refresh observation timestamps on 304 and identical content, isolate repository errors, fail closed on unusable 2xx bodies, and keep webhook 204 when only the health marker write fails.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 243c0c90bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| changed = 'written'; | ||
| return { action: 'write', value: release }; |
There was a problem hiding this comment.
Preserve webhook updates that race with reconciliation
When GitHub publishes, edits, unpublishes, or deletes a release after this reconciliation's GET but before this update, the webhook can first write the newer state and this unconditional write then replace it with the stale response. The public endpoint remains wrong until the next six-hour run, so the authoritative write should be conditional on the projection version observed before the request and skipped when a webhook changed it in the meantime.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Same intentional trade-off as the earlier concurrent-webhook thread: force-write is required for missed delete/unpublish convergence (Phase D exit). A publish that lands between GET and store is rare; the webhook or next recon repairs it within the six-hour cadence. Leaving unresolved for human visibility.
Address releases by numeric repository ID and reject nested repository mismatches so rename or recreate cannot attach another repo's facts to an allowlisted slot.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
* [docs] Mark GitHub release webhook Phases C–D complete; Phase E open. Reconcile plan status with merged PRs #19 and #20. Production secret and organization webhook activation remain. * Clarify Phase D/E wording from Copilot review. * Note ETag invalidation/epoch follow-up in Phase D reconciliation.
Summary
Implements Phase D of docs/GITHUB_RELEASE_WEBHOOK_PLAN.md: recovery and operations for GitHub release projections.
/releases/latest(conditional ETags, timeouts, body bounds)0 */6 * * *beside minute Identity maintenancegithubReleases(configured flags, last webhook/recon times, stale, count)Phase D exit criteria
Test evidence
npm run check— passnpm test— 105 node + 1 D1 tests passnpm run build— passResidual risks