feat(about): name the running build on /about and /api/health - #224
Merged
Conversation
An operator looking at a deployment could not answer "which build is this?" from the product: /about described profile, edition and billing but not the version, and /api/health said only `ok`. The bug report template's first required field is the Studio version, and after a release the only way to know whether staging was serving it was to exercise the fixed behaviour or ask whoever deployed. The version and commit are now stamped at build time into `runtimeConfig.public.build` (package.json version + the commit the build was made from) and shown on /about as `v0.3.0 (1a2b3c4)`. The commit is also returned by /api/health so an uptime check can assert a deploy landed. `.git` is outside the Docker build context, so the Dockerfile takes it as `SOURCE_COMMIT` (passed by the release workflow) or `RAILWAY_GIT_COMMIT_SHA` (exported by Railway builds); a build that knows neither shows the version alone rather than an invented sha. Closes #206
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.
Summary
Closes #206.
/aboutreported profile, edition and billing but not the version, and/api/healthreturned only{ status, timestamp }. An operator could not tell which build a deployment was running from inside the product — the first thing the bug template asks for.nuxt.config.tsputs{ version, commit }intoruntimeConfig.public.buildat build time. Version ispackage.json; commit is resolved fromSOURCE_COMMIT→RAILWAY_GIT_COMMIT_SHA→GITHUB_SHA→CI_COMMIT_SHA→VERCEL_GIT_COMMIT_SHA→git rev-parse HEAD, in that order, and is empty when nothing knows. Both are overridable at run time (NUXT_PUBLIC_BUILD_VERSION/NUXT_PUBLIC_BUILD_COMMIT)./about. AVersionrow at the top of the Deployment block:v0.3.0 (1a2b3c4),v0.3.0without a commit,unknownwithout either (shared/utils/build-info.ts)./api/health. Now{ status, timestamp, version, commit }so uptime checks can assert on the deployed build..gitis not in the build context, so the build stage takesARG SOURCE_COMMIT/ARG RAILWAY_GIT_COMMIT_SHA. The release workflow passesSOURCE_COMMITfor the GHCR images; Railway supplies its own variable to the build automatically.DOCKER.md(build arg + health payload),DEPLOYMENT.mdsmoke checks.Test plan
tests/unit/build-info.test.ts— formatting rules (tag+sha, tag only, sha only, unknown)tests/integration/system-workspace-routes.integration.test.ts— health payload carries version/commit, and still answers without a build stampnuxt typecheck/aboutshowsv0.3.0 (<sha of main>)andcurl /api/healthreturns the same sha (Railway build — confirmsRAILWAY_GIT_COMMIT_SHAreaches the build stage)🤖 Generated with Claude Code
https://claude.ai/code/session_01Chid3TnLdPHjsKip4n63Ky