Skip to content

ci: add API drift check on openapi.json#215

Open
infracore wants to merge 1 commit intodiscourse:mainfrom
infracore:ci/api-schema-check
Open

ci: add API drift check on openapi.json#215
infracore wants to merge 1 commit intodiscourse:mainfrom
infracore:ci/api-schema-check

Conversation

@infracore
Copy link
Copy Markdown

Optional advisory CI check for semantic drift in openapi.json

Posting this as a small optional addition to sit alongside validate_pr.yml. The swagger-validator step there catches structural problems; this one would catch the class of change where the document stays valid OpenAPI but the response shape moves under SDK consumers.

Concretely, between commits c8d216f (early January) and 8361012 (April 23) four field renames landed in the response of POST /tag_groups.json:

  • tag_names removed; replaced with tags
  • parent_tag_name removed; replaced with parent_tag

Both pairs validate cleanly in OpenAPI 3.1.0, so they parsed fine through validate_pr.yml. A plugin or SDK consumer reading tag_names against the new spec would silently get undefined from that point forward.

What this PR adds

A single workflow file (.github/workflows/api-schema-check.yml) that runs a structural diff on openapi.json against the PR base and posts a comment if it flags a breaking change. Advisory-only: no fail-on, no required check, doesn't block any auto-PR. The Action is pinned by commit SHA rather than a floating tag.

If the shape isn't useful or the scope is wrong, happy to revise or close.

Adds .github/workflows/api-schema-check.yml. Runs a structural diff on
openapi.json against the PR base on every change, posts a comment when
it sees a breaking change. Advisory-only; no fail-on, no required check.

Sits next to validate_pr.yml: swagger-validator-v2 covers structural
validity, this covers semantic drift (e.g. silent field renames in the
response shape that pass structural validation but break SDK consumers).

Concrete motivating finding: between commits c8d216f and 8361012,
four field renames landed in POST /tag_groups.json 200 response
(tag_names→tags, parent_tag_name→parent_tag) — both pairs structurally
valid OpenAPI in both versions.

Action pinned by commit SHA (afa76ce3...) rather than floating tag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant