Repository navigation
Conversation
|
👋 Welcome, @Furox-Art, and thanks for opening your first PR on AnythingMCP! A few quick pointers:
Someone from the core team will look at this within ~48h. If you don't hear back, please ping us in Discussions / Q&A. ⭐ While you wait — if you find AnythingMCP useful, a star helps others discover it. |
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
@Furox-Art thanks for the PR. Heads-up: #1000 was assigned to someone else on 8 October, and the rules in #997 give them 7 days. I've asked them to tell us by Wednesday 15 October whether they're still on it. Meanwhile I'm reviewing this one, so it's ready either way. Next time, please comment on the issue first so we can assign it to you. |
helpcodeai
left a comment
There was a problem hiding this comment.
Thanks @Furox-Art, the structure is good, and keeping the version behind auth and off /health/server-info is exactly right. A few things are needed before this can go in:
Blocker
packages/backend/src/mcp-server/mcp-endpoint.controller.ts: the newimport { APP_VERSION } ...ended up inside the@nestjs/commonimport block, so the backend doesn't compile (TS1003/TS1005, 5 test suites fail). Move it aboveimport {, and drop the two blank lines left wherereadAppVersionwas.
The footer never shows a version
2. versionApi.get() in lib/api.ts sends no token, so /api/version always answers 401 and the footer stays empty. Pass the token (get: (token: string) => request(..., { token, skipAutoLogout: true })), read it from useAuth() in the footer and only fetch when it's set.
Still missing from #1000
3. The "Copy version info" card in Settings → Administration (app/settings/admin/page.tsx).
4. .github/workflows/docker-publish.yml: add APP_COMMIT=${{ github.sha }} and a build date to build-args. Today buildDate is always null and the startup log says "built unknown". Two lines, nothing else in the workflow.
5. Footer format: v0.21.0 · 3bd9f8b with the short SHA, linked to https://github.com/HelpCode-ai/anythingmcp/commit/<sha> when it's a 40-character SHA, plain dev otherwise. Fetch once per session (a module-level cached promise), not on every AppShell mount.
6. Shorten the SHA for display in the startup log and footer (/^[0-9a-f]{40}$/.test(c) ? c.slice(0, 7) : c), and keep the full SHA in the API response for the link.
Small things
7. Dockerfile: org.opencontainers.image.version="${APP_VERSION}" has no matching ARG, so local builds get an empty label. Declare ARG APP_VERSION= or drop the label (CI overrides it anyway).
8. docs/deployment.md: the new section sits after the "Back to README" line; move it above. In docs/operations/observability.md, put the sentence in the service.version section instead of at the end of the file.
9. app-version.ts and app-version.spec.ts are executable (100755); please make them 100644.
10. version.controller.ts: one @nestjs/common import instead of two, and add @ApiBearerAuth().
About the assignment: as I wrote above, #1000 was given to someone else first, so the final call waits until Wednesday 15 October. Fixing these in the meantime means it's ready to merge if it's yours.
3805e41 to
5076aa5
Compare
|
All ten points addressed, pushed as a new commit on the rebased branch: Blocker
Footer Still missing from #1000 Small things |
Closes HelpCode-ai#1000 - packages/backend/src/common/app-version.ts: single source of truth exporting APP_VERSION, APP_COMMIT (APP_COMMIT || SENTRY_RELEASE || dev) and APP_BUILD_DATE (APP_BUILD_DATE || null), moving readAppVersion() out of mcp-endpoint.controller.ts - packages/backend/src/tracing.ts + instrument.ts: use APP_VERSION as the service.version / Sentry release fallback instead of npm_package_version - packages/backend/src/main.ts: log version, commit, build date and mode at startup - packages/backend/src/health/version.controller.ts: new GET /api/version behind AuthGuard('jwt') returning { version, commit, buildDate, deploymentMode }; registered in health.module.ts - packages/frontend/src/components/footer.tsx: show v{version} for signed-in users, with full version+commit in the tooltip - Dockerfile: APP_COMMIT and APP_BUILD_DATE build args to ENV, plus org.opencontainers.image.revision and .version OCI labels - app-version.spec.ts: unit tests for env precedence and dev fallback - docs: deployment.md documents the build args; observability.md notes the service.version source change
5076aa5 to
2caf3b3
Compare
helpcodeai
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround @Furox-Art. The backend side is in good shape now: I checked out the branch and tsc, lint and the full Jest run pass (524 suites), /api/version sits behind the JWT guard and /health/server-info is untouched. A few things are still off, and the first one breaks the build:
packages/frontend/src/app/settings/admin/page.tsxcallsversionApi.get(token)but never imports it, so the frontend typecheck fails (TS2304: Cannot find name 'versionApi'at line 68). Add it to the existingimport { adminSettings, type AlertWebhookInput } from '@/lib/api'.- Same file: the Copy button calls
navigator.clipboard.writeTextdirectly. On a self-hosted instance served over plain HTTPnavigator.clipboardis undefined, so it throws before your.catchruns and nothing happens. UsecopyTextfrom@/lib/clipboard(already imported in that page). It returns a boolean and has the fallback. While you're there, the card shows only its heading when the fetch fails; a short "Version info unavailable" line would be better than an empty card. .github/workflows/docker-publish.ymlonly runs onworkflow_dispatch, and that event has nohead_commit, soAPP_BUILD_DATEends up empty and published images still log "built unknown". The metadata step already computes a build timestamp, so this works without an extra step:APP_BUILD_DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}docs/operations/observability.md: the sentence landed in the middle of the "Service identity" table, so the table stops atOTEL_SERVICE_VERSIONand theOTEL_DEPLOYMENT_ENVIRONMENTrow renders as plain text. Change the default in theOTEL_SERVICE_VERSIONrow fromnpm_package_versiontoAPP_VERSION(the backend's package.json version) and put the sentence under the table.docs/deployment.md: sorry, my "move it above" was unclear. It's now the very first section, ahead of the top navigation and Quick Start. Please make it a### Build provenancesubsection under "Production Deployment", right after "With Docker (Manual)". Also usegit rev-parse HEADinstead of--short HEADin the example: the footer only links 40-character SHAs, so with the short form you never get the link. And drop the extra blank lines added at the end of both docs files.- Small one in
footer.tsx:getVersionOncecaches the failed promise too, so a single 401 (a token that expires right at that moment, say) hides the version for the rest of the session. SetversionPromise = nullwhen the request fails so the next mount retries.
Once these are in it looks ready to me. As before, the merge itself waits for the 15 October answer on #1000.
Closes #1000
What
Single source of truth for build version, commit and build date, surfaced in three places:
packages/backend/src/common/app-version.ts—readAppVersion()moved here frommcp-endpoint.controller.ts(walk-up logic and comment preserved). ExportsAPP_VERSION,APP_COMMIT(APP_COMMIT || SENTRY_RELEASE || 'dev'),APP_BUILD_DATE(APP_BUILD_DATE || null).GET /api/version— newVersionControllerinpackages/backend/src/health/, behindAuthGuard('jwt'). Returns{ version, commit, buildDate, deploymentMode }./health/server-infois untouched.Footer — signed-in users see
v{version}in the footer, with full version + commit in the tooltip.Also updated:
tracing.tsandinstrument.ts:service.version/ Sentryreleasefall back toAPP_VERSIONinstead of the unsetnpm_package_version(which was producing0.0.0in containers).main.ts: startup log lineAnythingMCP v0.18.0 (commit 3bd9f8b, built 2026-10-04, mode self-hosted).Dockerfile:APP_COMMITandAPP_BUILD_DATEbuild args → ENV, plusorg.opencontainers.image.revisionand.versionOCI labels.app-version.spec.tscovering env precedence and thedevfallback.docs/deployment.mddocuments the build args;docs/operations/observability.mdnotes theservice.versionsource change.Acceptance criteria
docker build --build-arg APP_COMMIT=$(git rev-parse HEAD) .→ footer and startup log show the short SHA; without the arg they showdev.GET /api/versionreturns 401 without a JWT./health/server-infois unchanged.app-version.spec.tscovers env precedence and thedevfallback.serverInfo.versionstill equalspackage.jsonversion.Verification