Add CI step to detect openapi.json drift#656
Merged
Merged
Conversation
mvillmow
commented
Jun 19, 2026
mvillmow
left a comment
Contributor
Author
There was a problem hiding this comment.
Correct, complete drift-detection impl; openapi.json regenerated under sort_keys=True. NOGO: new job pins pixi v0.68.0 vs v0.67.2 everywhere else — risks false-drift failures.
mvillmow
commented
Jun 19, 2026
mvillmow
left a comment
Contributor
Author
There was a problem hiding this comment.
Feature (sort_keys determinism + openapi-drift job + check-openapi recipe) is correct and complete; but stray generated coverage.xml with machine-local path must be removed/gitignored first.
mvillmow
commented
Jun 21, 2026
mvillmow
left a comment
Contributor
Author
There was a problem hiding this comment.
openapi-drift impl correct (sort_keys, regenerated json, pixi v0.67.2 consistent). NOGO: unrelated generated coverage.xml with machine-local path still committed.
Add deterministic OpenAPI export and a required CI job that re-exports the FastAPI schema and diffs it byte-for-byte against the committed openapi.json, failing the merge when they differ. Also hardens export-openapi.py to emit sorted keys (sort_keys=True) so the diff is deterministic across FastAPI/Python upgrades. Regenerate openapi.json under the new sorted-key invariant to capture real schema changes (new fields in HealthResponse). The CI job includes a determinism sub-step that exports twice and diffs the two outputs, so any future regression that reintroduces non-determinism fails CI directly rather than producing intermittent false positives. Closes #431 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
All six other pixi jobs pin v0.67.2; the new openapi-drift job mistakenly used v0.68.0. A divergent pixi version could resolve a different environment and produce a different app.openapi() export, causing false drift failures. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
Add CI step to detect openapi.json drift Closes #431 Implemented-By: claude-sonnet-4-6 Co-Authored-By: Claude Code <noreply@anthropic.com> Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
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
Add a required CI job that re-exports the FastAPI OpenAPI schema and diffs it byte-for-byte against the committed
openapi.json, failing the merge when they differ. To guarantee the diff is deterministic, also hardenscripts/export-openapi.pyto emit sorted keys (sort_keys=Truein both JSON and YAML branches), eliminating the false-positive risk from FastAPI/Python dict insertion-order changes.Changes
sort_keys=Trueto bothjson.dump()andyaml.safe_dump()calls for deterministic outputopenapi-driftjob that:check-openapirecipe so developers can reproduce the CI check locallyVerification
All acceptance criteria from the issue are met:
python scripts/export-openapi.py --output /tmp/openapi-ci.json && diff openapi.json /tmp/openapi-ci.jsonjust check-openapi)Closes #431
Co-Authored-By: Claude Haiku 4.5 noreply@anthropic.com