feat(api): observe-only semantic backend version check#109
Merged
Conversation
…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.
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
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.
apps/smartem/src/main.tsx(live mode only) — queries the backend/versionendpoint and compares it semantically (release portion, ignoring thedev+shasuffix) 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.tsrewritten — fetches/version(was/openapi.json), semantic compare (was exact-string, which false-alarmed on every commit). Same exported surface, so the legacyApiVersionCheckstill builds.api:fetchrepointed — pulls the canonical spec from smartem-decisions (docs/api/openapi.json) instead of the stale devtools Pages copy.npm run api:updateis now safe and canonical.Notes
openapi.jsonis unchanged here (still has the endpoints from feat(dashboard): show grids X/Y per acquisition via summary endpoint #108). Once the backend PR merges and publishes, a routinenpm run api:updaterefreshes it; until then the observe-only check simply notes the client is slightly behind — which is honest and non-blocking.Companion PRs (merge together)
/versionendpoint + canonical publisher.Test plan
npm run typecheckcleannpx biome checkclean on touched files (+ lefthook)npm run build:smartemsucceedsCloses #93.