Skip to content

Show production commit on status page with GitHub link - #1373

Merged
kentcdodds merged 1 commit into
mainfrom
cursor/status-page-production-commit-99be
Aug 10, 2026
Merged

kentcdodds merged 1 commit into
mainfrom
cursor/status-page-production-commit-99be

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Aug 10, 2026 •

Copy link
Copy Markdown
Owner

The status page now shows which commit is live in production and links to it on GitHub.

What changed

  • Each probe pass reads commitSha from production GET /health (already returned by the main worker as APP_COMMIT_SHA).
  • The last known SHA is persisted in the status Durable Object so it stays visible even if a probe fails.
  • The page footer renders Production commit with a short SHA linked to github.com/kentcdodds/kody/commit/….
  • /status.json exposes the same field as productionCommit.
System recap — extends status-page (medium risk)

Touches: status-page (surfaces)

Risk: Medium — extends the public status snapshot and page rendering; no main-worker or deploy changes.

Invariants: None implicated (global operational telemetry only).

flowchart LR
  probe[Status prober cron] --> health["GET /health"]
  health --> commitSha[commitSha]
  commitSha --> meta[(Status DO meta)]
  meta --> page[status.heykody.dev footer]
  page --> github[GitHub commit link]
Loading
Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Status pages now display the latest production commit as a shortened, clickable repository link.
    • The production commit is shown only when available and is omitted otherwise.
    • Status data now reflects the commit reported by the production health endpoint.
  • Bug Fixes

    • Improved validation and normalization of production commit information from health checks.

Probe commitSha from production GET /health each minute, persist the
last known value in the status Durable Object, and render it in the
page footer linked to github.com/kentcdodds/kody/commit/….

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The status worker now reads the production commit SHA from the health endpoint, validates and stores it, and displays an abbreviated GitHub commit link when available.

Changes

Production commit status

Layer / File(s) Summary
Capture and validate production commit
packages/status/probes.ts, packages/status/probes.node.test.ts
probeApp validates and normalizes health-response commit SHAs. runAllProbes returns the SHA with probe outcomes.
Persist production commit in snapshots
packages/status/status-types.ts, packages/status/status-store.ts
StatusSnapshot replaces buildCommit with nullable productionCommit. The status store persists and returns the reported production SHA.
Render production commit link
packages/status/status-page.ts, packages/status/status-page.node.test.ts
The footer renders an abbreviated GitHub commit link when productionCommit exists and omits it otherwise.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProductionHealthEndpoint
  participant probeApp
  participant runAllProbes
  participant statusStore
  participant statusPage
  ProductionHealthEndpoint->>probeApp: health response with commitSha
  probeApp->>runAllProbes: validated productionCommitSha and outcome
  runAllProbes->>statusStore: ProbeRunResult
  statusStore->>statusPage: snapshot with productionCommit
  statusPage->>statusPage: render abbreviated GitHub commit link
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the intent, changes, and system impact, but it does not include the required Testing section. Add a Testing section that lists the tests or verification performed for the probe, status page, and status snapshot changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: displaying the production commit with a GitHub link.
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.
✨ 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 cursor/status-page-production-commit-99be

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.

@kentcdodds
kentcdodds marked this pull request as ready for review August 10, 2026 14:07

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0fb3e35. Configure here.

const now = Date.now()
if (productionCommitSha) {
this.setMeta(productionCommitMetaKey, productionCommitSha)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stale production commit persists

Medium Severity

runProbes only writes production_commit_sha when productionCommitSha is truthy, so a successful production GET /health with a missing or invalid commitSha leaves the previous SHA in meta. The footer and /status.json can then show an outdated production commit while probes are otherwise healthy.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0fb3e35. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-1373.kody-a99.workers.dev

Worker: kody-pr-1373
D1: kody-pr-1373-db
KV: kody-pr-1373-oauth-kv

Mocks:

@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: 1

🤖 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 `@packages/status/probes.ts`:
- Around line 73-76: Update readProductionCommitSha to verify body?.commitSha is
a string before calling trim, returning null for numeric, object, or other
non-string values while preserving the existing validation and lowercase
normalization for valid strings. Add an integration test covering a non-string
commitSha and confirm runAllProbes continues without rejecting.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 08798d2b-1d1b-4c29-9a34-a28076bfd483

📥 Commits

Reviewing files that changed from the base of the PR and between 7509640 and 0fb3e35.

📒 Files selected for processing (6)
  • packages/status/probes.node.test.ts
  • packages/status/probes.ts
  • packages/status/status-page.node.test.ts
  • packages/status/status-page.ts
  • packages/status/status-store.ts
  • packages/status/status-types.ts

Comment thread packages/status/probes.ts
Comment on lines +73 to +76
function readProductionCommitSha(body: AppHealthBody | null): string | null {
const commitSha = body?.commitSha?.trim()
if (!commitSha || !/^[0-9a-f]{7,40}$/i.test(commitSha)) return null
return commitSha.toLowerCase()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Handle non-string commitSha values.

At Line 74, .trim() runs without runtime type validation. A malformed health response with a numeric or object commitSha rejects runAllProbes. This stops status sampling, incident processing, and pruning for that run. Treat non-string values as invalid and return null. Add an integration test for a non-string commitSha.

Proposed fix
 function readProductionCommitSha(body: AppHealthBody | null): string | null {
-	const commitSha = body?.commitSha?.trim()
+	const rawCommitSha = body?.commitSha
+	if (typeof rawCommitSha !== 'string') return null
+	const commitSha = rawCommitSha.trim()
 	if (!commitSha || !/^[0-9a-f]{7,40}$/i.test(commitSha)) return null
 	return commitSha.toLowerCase()
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function readProductionCommitSha(body: AppHealthBody | null): string | null {
const commitSha = body?.commitSha?.trim()
if (!commitSha || !/^[0-9a-f]{7,40}$/i.test(commitSha)) return null
return commitSha.toLowerCase()
function readProductionCommitSha(body: AppHealthBody | null): string | null {
const rawCommitSha = body?.commitSha
if (typeof rawCommitSha !== 'string') return null
const commitSha = rawCommitSha.trim()
if (!commitSha || !/^[0-9a-f]{7,40}$/i.test(commitSha)) return null
return commitSha.toLowerCase()
🤖 Prompt for 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.

In `@packages/status/probes.ts` around lines 73 - 76, Update
readProductionCommitSha to verify body?.commitSha is a string before calling
trim, returning null for numeric, object, or other non-string values while
preserving the existing validation and lowercase normalization for valid
strings. Add an integration test covering a non-string commitSha and confirm
runAllProbes continues without rejecting.

@kentcdodds
kentcdodds merged commit be5e29d into main Aug 10, 2026
18 checks passed
@kentcdodds
kentcdodds deleted the cursor/status-page-production-commit-99be branch August 10, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants