Skip to content

Name the build on the settings Version card - #88

Merged
DennisAlund merged 1 commit into
mainfrom
settings-build-info
Nov 25, 2026
Merged

DennisAlund merged 1 commit into
mainfrom
settings-build-info

Conversation

@DennisAlund

@DennisAlund DennisAlund commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

A deployment that follows main runs commits no release holds, and the Version card could not say so.

What changes

  • The card names the build. 0.43.2 (Nov 24, 2026 · 432b90a): the version, then the date and short hash of the deployed commit.
  • A build past the latest release is marked. The card asks GitHub's compare endpoint how the commit relates to the release tag. Ahead of it, the card reads "Unreleased build" and "+3 since 0.43.2" in place of "Up to date".
  • Fallbacks keep the version line. A fork's commit (unknown upstream), a rate-limited call or a failed update check leave the version comparison as it was.
  • Release tag parse fixed. Releases are tagged app-v<version> and only a leading v was stripped. An available update showed as "app-v0.44.0", and a 1.x release would never have counted as newer.

Where the commit comes from

Workers Builds sets WORKERS_CI_COMMIT_SHA, ignores wrangler custom builds, and the documented setup has an empty build command. The dependency install is the one step every fork runs, so a postinstall script (scripts/generate-build-info.mjs, plain Node, never fails the install) writes the commit into src/build-info.generated.ts. Outside Workers Builds it does nothing: the committed module names no build and the card shows the version alone.

Verification

Suite Result
yarn tsc --noEmit, -p e2e clean
yarn test 1932 passed
yarn e2e 44 passed, with three new Version card steps

The build line and the unreleased state were also rendered in Chromium against a generated build module. The Workers Builds branch build for this PR ran the hook on a cached install and logged Recorded build 913a628 (2026-11-24T14:29:51.000Z), the commit's own hash and date.

No version bump: releasing is left to the release step. No API or spec change.

A deployment that follows main runs commits no release holds, and the card showed only the version with "Up to date". It now reads "0.43.2 (Nov 24, 2026 · 432b90a)": the date and short hash of the deployed commit. When that commit is past the latest release tag, the card says "Unreleased build" with the commit count, from GitHub's compare endpoint. A fork's commit or a rate-limited call falls back to the version comparison.

The commit comes from WORKERS_CI_COMMIT_SHA. Workers Builds ignores wrangler custom builds and the documented setup has no build command, so a postinstall script records it: the dependency install is the one step every fork runs. Outside Workers Builds the script does nothing and the card shows the version alone.

Also fixes the release tag parse. Releases are tagged app-v<version>, and only a leading v was stripped: an available update showed as "app-v0.44.0", and a 1.x release would never have counted as newer because its major number parsed as NaN.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
shrtnr 913a628 Nov 24 2026, 02:31 PM

@DennisAlund
DennisAlund merged commit e113130 into main Nov 25, 2026
10 checks passed
@DennisAlund
DennisAlund deleted the settings-build-info branch November 25, 2026 01:56
DennisAlund added a commit that referenced this pull request Nov 25, 2026
Minor bump: the settings Version card gains the build line and the unreleased marker. Also carries the sparkline, cookie and release tag fixes from #86 and #88. The version bump stales the spec hash, refreshed here in all three SDK manifests; their surface is unchanged.
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.

1 participant