Skip to content

feat(api): observe-only semantic backend version check#109

Merged
vredchenko merged 1 commit into
mainfrom
feat/api-version-compat-check
Jun 2, 2026
Merged

feat(api): observe-only semantic backend version check#109
vredchenko merged 1 commit into
mainfrom
feat/api-version-compat-check

Conversation

@vredchenko

Copy link
Copy Markdown
Collaborator

Summary

Implements the frontend side of ADR 0020 (DiamondLightSource/smartem-devtools#222): finishes the backend-compatibility check and points the client at the canonical spec source.

  • Boot-time check wired into apps/smartem/src/main.tsx (live mode only) — queries the backend /version endpoint and compares it semantically (release portion, ignoring the dev+sha suffix) to the version the client was built against. Logs always; shows a non-blocking dev banner on drift. Never enforced — rolling deploys that momentarily differ don't break the app.
  • version-check.ts rewritten — fetches /version (was /openapi.json), semantic compare (was exact-string, which false-alarmed on every commit). Same exported surface, so the legacy ApiVersionCheck still builds.
  • api:fetch repointed — pulls the canonical spec from smartem-decisions (docs/api/openapi.json) instead of the stale devtools Pages copy. npm run api:update is now safe and canonical.

Notes

Companion PRs (merge together)

Test plan

  • npm run typecheck clean
  • npx biome check clean on touched files (+ lefthook)
  • npm run build:smartem succeeds

Closes #93.

…c source

Wire a boot-time backend compatibility check into the app: in live mode it queries
the backend /version endpoint and compares it semantically (release portion, ignoring
the dev+sha suffix) to the version the client was built against, logging an advisory
and showing a non-blocking dev banner on drift. It is never enforced, so rolling
deploys where the two momentarily differ do not break the app (ADR 0020).

Repoint api:fetch from the stale devtools Pages copy to the canonical spec published
by smartem-decisions, and update the contributing docs accordingly.
@vredchenko vredchenko merged commit 58c1477 into main Jun 2, 2026
10 checks passed
@vredchenko vredchenko deleted the feat/api-version-compat-check branch June 2, 2026 16:19
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.

Wire packages/api/src/version-check.ts into main.tsx boot sequence

1 participant