feat: commit openapi-schema.yml + add freshness gate#951
Open
ChristopherChudzicki wants to merge 1 commit into
Open
feat: commit openapi-schema.yml + add freshness gate#951ChristopherChudzicki wants to merge 1 commit into
ChristopherChudzicki wants to merge 1 commit into
Conversation
Track the generated drf-spectacular OpenAPI spec at the repo root and add a CI gate that regenerates on each PR head and fails if the result doesn't match the committed file. - .gitattributes: openapi-schema.yml text eol=lf merge=binary (eol=lf normalizes line endings cross-platform; merge=binary blocks GitHub's server-side text-merge of two concurrent spec edits) - openapi-schema.yml: the canonical generated spec (~9k lines) - .gitignore: stop ignoring openapi-schema.yml - .github/workflows/openapi-spec-freshness.yml: freshness gate (uv-based) - README.md: document the committed file + regen command
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.
What are the relevant tickets?
Closes #950
Description (What does it do?)
This PR implements the proposal in LINK_TO_ISSUE. The OpenAPI spec is committed, and its freshness is guarded by:
openapi-spec-freshness.yml) that genereates the spec itself and diffs with the committed version. An out-of-date spec fails the check.openapi-schema.yml text eol=lf merge=binaryin order to:pr-branchhas modified the spec, and base branch has modified the spec, too, then there will be a conflict.pr-branchmust regenerate.How can this be tested?
I've opened a few PRs against this branch on my own fork. You can see the CI check failing/passing there:
drf-spectaculardecorator, but does NOT regenerate the spec => CI check fails.