ci(openapi): oasdiff breaking-change gate (Wave 1 contract-drift)#264
Merged
Conversation
Wave 1 contract-drift gate — docs/ci/01-CI-INTEGRATION-DESIGN.md. Adds .github/workflows/openapi-breaking.yml: on every PR touching openapi.snapshot.json, diff it against the base branch's committed snapshot with oasdiff (pinned v1.11.7) and FAIL the PR on a breaking change (removed/renamed/retyped response field, new required request field, removed endpoint/response code). Pure additions pass. Uses --fail-on WARN, not ERR: the api emits response fields as optional, and oasdiff classifies removing an optional response property as WARN — yet that removal is exactly the login-break class (UI reads me.tier, api drops it, UI gets undefined). ERR would miss it; WARN catches it while still passing additive changes. Verified locally against removed-field, rename, new-required-request-field, removed-endpoint (all red) and optional-field-add / new-endpoint / response-enum-removal (all green). The companion consumer-side gate lives in instanode-web (openapi-typescript codegen makes the same rename fail tsc in npm run gate). Together they move contract drift from a runtime prod break to a compile/PR-time failure. Docs: api/docs/OPENAPI-CONTRACT-GATES.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Wave 1 contract-drift gate —
docs/ci/01-CI-INTEGRATION-DESIGN.md(HIGHEST ROI).Producer-side half of the UI↔API contract-drift gate. The consumer-side half is InstaNode-dev/instanode-web#191 (openapi-typescript codegen makes the same rename fail
tsc).What
.github/workflows/openapi-breaking.yml: on every PR touchingopenapi.snapshot.json, diff it against the base branch's committed snapshot with oasdiff (pinnedv1.11.7) and fail the PR on a breaking change. Pure additions pass.Why
--fail-on WARN(not ERR)The api emits response fields as optional (no
requiredarray on response schemas). oasdiff classifies removing an optional response property as WARN, not ERR — yet that removal is exactly the login-break class (UI readsme.tier, api drops it, UI getsundefined).--fail-on ERRwould miss it;WARNcatches it while still passing additive changes. Documented inapi/docs/OPENAPI-CONTRACT-GATES.md.Verified locally (oasdiff v1.11.7)
AuthMeResponse.tier(optional response field)ResourceItem.storage_bytesClaimRequest)/api/v1/resources)Snapshot confirmed current vs
cmd/openapi-snapshotat master HEAD.Intentional breaking changes
The gate failing is the signal, not a wall (rule 22): land the api change + update the instanode-web consumer (regenerate
generated.ts; its tsc reds at every UI site using the removed field) in a linked PR, merge via repo-admin. No in-workflow allowlist — every override is a recorded human decision.🤖 Generated with Claude Code