Repository navigation
🎃 Show the build version and git commit in the UI and the backend startup log #1000
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershacktoberfestGood for Hacktoberfest contributorsGood for Hacktoberfest contributorshelp wantedExtra attention is neededExtra attention is needed
Description
Part of the October Challenge #997.
Why
"Which version are you running?" is the first question on every bug report, and right now nobody can answer it from the product. The UI shows no version anywhere. The backend startup log prints URLs but no version. Inside the container npm_package_version is unset (the backend starts with node dist/src/main.js, start.sh:47), so the OpenTelemetry service.version falls back to 0.0.0 (tracing.ts:33-36). Grafana, n8n and Gitea all show version and commit in the footer or on an About page.
Self-hosted vs Cloud
- Self-hosted: enabled in Community and Business. Images built locally (
docker compose build) or from source have no commit, so they showdevand the UI must handle that. - Cloud (
DEPLOYMENT_MODE=cloud): enabled. Cloud runs the same publichelpcodeai/anythingmcpimage built from this AGPL repo, so version and commit reveal nothing private and nothing tenant-specific. Serve them only to signed-in users anyway. Do not add them to the unauthenticated/health/server-info, because that would hand vulnerability scanners a free fingerprint. - Who can use it: any signed-in user (all roles) sees version and short commit in the footer. Admins also get a copyable "About this instance" block in Settings → Administration. Nothing here is per-org.
What to build
- Single source of truth: create
packages/backend/src/common/app-version.tsand movereadAppVersion()there frommcp-endpoint.controller.ts:80-110(keep its walk-up logic and its comment, which explains why). ExportAPP_VERSION,APP_COMMIT(process.env.APP_COMMIT || process.env.SENTRY_RELEASE || 'dev') andAPP_BUILD_DATE(process.env.APP_BUILD_DATE || null). Use them inmcp-endpoint.controller.ts,tracing.ts:33-36, and as the fallback ininstrument.ts:31. - Startup log: in
main.tsbefore line 209, log one line:AnythingMCP v0.18.0 (commit 3bd9f8b, built 2026-10-04, mode self-hosted). - Endpoint:
GET /api/versionbehindAuthGuard('jwt')that returns{ version, commit, buildDate, deploymentMode }. Put it in a new small controller inpackages/backend/src/health/and register it inhealth.module.ts. - Docker: in the runner stage of the
Dockerfile(near lines 114-116), addARG APP_COMMIT=/ARG APP_BUILD_DATE=→ENV, and add the OCI labelsorg.opencontainers.image.revisionandorg.opencontainers.image.version. In.github/workflows/docker-publish.yml:70-71, addAPP_COMMIT=${{ github.sha }}and a build date tobuild-args. Edits under.github/get extra review (see the comment atdocker-publish.yml:86-92), so keep the diff minimal.deploy-cloud.ymlneeds no change because it pulls the published image. - Frontend:
Footer(components/footer.tsx:59-79) appendsv0.18.0 · 3bd9f8b. If the commit is a 40-hex SHA, it links tohttps://github.com/HelpCode-ai/anythingmcp/commit/<sha>;devis plain text. Fetch it once per session (signed-in only, since the footer only renders insideAppShell). Add a "Copy version info" card toapp/settings/admin/page.tsx.
Where to look
packages/backend/src/mcp-server/mcp-endpoint.controller.ts:80-110: existingreadAppVersion().packages/backend/src/tracing.ts:33-36,packages/backend/src/instrument.ts:31: version fallbacks that are wrong in the container.packages/backend/src/main.ts:209-212: startup log lines.packages/backend/src/health/health.controller.ts:30-72: public server-info. Do not add the version here.Dockerfile:94-116:SENTRY_RELEASEis already passed as a build arg and set as ENV (copy this pattern).Dockerfile:150-156: OCI labels..github/workflows/docker-publish.yml:65-82: image build.packages/frontend/src/components/footer.tsx,packages/frontend/src/lib/api.ts:964:serverclient.
Acceptance criteria
-
docker build --build-arg APP_COMMIT=$(git rev-parse HEAD) .→ the footer and startup log show the short SHA. Without the arg they showdev. -
GET /api/versionreturns 401 without a JWT./health/server-infois unchanged. - Unit test
app-version.spec.tscovers the env precedence and thedevfallback (cd packages/backend && npm test). - The MCP
serverInfo.versionstill equalspackage.jsonversion. -
docs/deployment.mdmentions the build args, anddocs/operations/observability.mdnotes thatservice.versionnow comes fromAPP_VERSION.
Out of scope
- "Update available" checks (outbound calls to GitHub, especially on Cloud).
- Changing the release/versioning process or the tags
docker-publish.ymlpushes. - Showing Node or dependency versions.
Size
S (a few hours)
How to claim
Comment "I'd like to work on this" and we'll assign you. Rules in #997.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershacktoberfestGood for Hacktoberfest contributorsGood for Hacktoberfest contributorshelp wantedExtra attention is neededExtra attention is needed
Activity
helpcodeai commentedon Oct 10, 2026
@Xnadir this is the new issue for the one you are working on, and it is still yours. Leave a short comment here so GitHub lets us assign it to you again. The notes from before, for reference:
helpcodeai commentedon Oct 11, 2026
@Xnadir are you still working on this one? A PR for it came in from someone else (#1023). If you have something in progress, let us know here by Wednesday 15 October; otherwise we'll go ahead with #1023.
feat: show build version and git commit in UI and startup log
feat: show build version and git commit in UI and startup log
feat: show build version and git commit in UI and startup log
Show build version and commit in the UI and logs