Repository navigation
Show build version and commit in the UI and startup log - #1050
notlakshitha wants to merge 1 commit into
Conversation
Signed-in users can answer which build they are running. One helper reads the package version, the image commit and the build date. The startup log, the footer and Settings → Administration all use it. The public health route is unchanged. Refs HelpCode-ai#1000 Co-authored-by: Lakshitha Deshan (ReadY) <notlakshitha@gmail.com>
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
I have read the CLA Document and I hereby sign the CLA |
|
Thanks @notlakshitha, but this one overlaps almost file for file with #1023, which @Furox-Art opened first for #1000 and is already through two review rounds, so I'm closing it as a duplicate. If you want something to pick up, #1049 is yours now (the env var docs you found), and there are open ones under the hacktoberfest label like #1008 or #1010. Please comment on the issue before you start so we don't end up with two PRs for the same thing again. |
Summary
Signed-in users can see which build they are running. Bug reports start with that question, and until now neither the UI nor the backend startup log could answer it. Inside the container
npm_package_versionis unset, so OpenTelemetry was reportingservice.version0.0.0.Version, commit and build date now come from one helper. Self-hosted and Cloud both show them. A local image build has no commit, so it shows
dev. Cloud runs the published image, which records the commit and build date.GET /api/versionrequires a JWT. The public/health/server-inforoute is unchanged, so an unauthenticated probe still cannot fingerprint the build.Tracks upstream #1000. This pull request stays on the fork.
Changes
readAppVersion()topackages/backend/src/common/app-version.tsand exportAPP_VERSION,APP_COMMIT(APP_COMMIT, thenSENTRY_RELEASE, elsedev) andAPP_BUILD_DATE.AnythingMCP v0.24.0 (commit 3bd9f8b, built 2026-10-04, mode self-hosted)on startup. A 40-character SHA is shortened to seven characters in the log; the API keeps the full value.GET /api/versionbehindAuthGuard('jwt'), returning{ version, commit, buildDate, deploymentMode }.APP_COMMITandAPP_BUILD_DATEinto the runner image, and set the OCI revision and version labels. The publish workflow fills both build args.APP_BUILD_DATEuses the timestamp the metadata action already computed, becauseworkflow_dispatchhas nohead_commit.v0.24.0 · 3bd9f8b. A full SHA links to the commit;devis plain text. A failed fetch is not cached.releaseand OpenTelemetryservice.versionfall back toAPP_VERSION.docs/deployment.mdanddocs/operations/observability.mddescribe the build args and that default.Type
Testing
Commands, from the repository root unless noted:
cd packages/backend && npx jest src/common/app-version.spec.ts src/health/version.controller.spec.ts --no-coverage— 2 suites, 16 tests, passed.cd packages/backend && npx tsc --noEmit -p tsconfig.json— passed.cd packages/backend && npm run lint— passed, 11 pre-existing warnings, none in these files.eslint --fixalso rewrote two unrelated specs (it dropped existing eslint-disable comments); those edits were reverted.cd packages/backend && npm test— 532 passed, 4 skipped, 13168 tests passed. No database was available; the suite still exited 0.cd packages/frontend && npx tsc --noEmit -p tsconfig.json— passed.cd packages/frontend && npm run lint— passed, 26 pre-existing warnings, none in these files.Checklist
npm test)Related Issues
Tracks #1000