ci: fail when the committed openapi.json is out of date (#117) - #134
Merged
Conversation
Nothing regenerated or verified the spec that bootstraps the Kong gateway config, so it rotted silently — by #115 it had drifted back to the pre-v1 API, 84 paths with zero /v1. No test reads the file: the smoke tests and the healthcheck all hit the live /docs/openapi.json, and routes_golden.json covers registered routes, not the artifact. Generation is deterministic and independent of the env vars it needs (verified: byte-identical output from a different cwd with bogus paths), so this is safe as a hard gate. Confirmed it fails on a stale spec. Also makes the README recipe runnable — it died at import time without those vars, which is part of why regenerating was easy to skip.
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.
Closes #117.
Nothing regenerated or verified the spec that bootstraps the Kong gateway config, so it rotted silently — by the time #115 regenerated it, it had drifted back to the pre-v1 API: 84 paths, zero
/v1. It then went stale twice more in a single day (#113's route removals, #124's new route), each caught only because I happened to be looking.Nothing was ever going to catch it:
test_api_smoke,test_routes_registeredand the Dockerfile healthcheck all hit the live/docs/openapi.json, androutes_golden.jsoncovers registered routes rather than the committed artifact.Safe as a hard gate
Generation is deterministic and independent of the env vars it needs — byte-identical output from a different cwd with bogus paths:
Confirmed it actually fails on a stale spec by dropping a path and re-running the check.
Note on what this changes for everyone
Any PR that adds or modifies a route now fails CI until
openapi.jsonis regenerated and committed. That is the point, but it is a new obligation — so the README recipe is fixed in the same commit. It previously died at import time without the env vars, which is part of why regenerating was easy to skip. It now runs verbatim, with a note that the variables only satisfy import-time reads and do not affect the output.