Add workflow to refresh jsonschema_for_docs.json after each release#5200
Open
shreyas-goenka wants to merge 6 commits intomainfrom
Open
Add workflow to refresh jsonschema_for_docs.json after each release#5200shreyas-goenka wants to merge 6 commits intomainfrom
shreyas-goenka wants to merge 6 commits intomainfrom
Conversation
`bundle/internal/schema/since_version.go` reads `git tag --list 'v*'` to compute `x-since-version` annotations. The committed file therefore goes stale by one release as soon as the next tag is pushed: fields shipped in that tag don't get stamped until the schema is regenerated against a tag list that includes the new tag. The new workflow runs on every `v*` tag push (and via workflow_dispatch), regenerates the file from `main`, asserts that nothing other than `bundle/schema/jsonschema_for_docs.json` changed, and pushes the update directly to `main`. Co-authored-by: Isaac
main remains untouched. The workflow regenerates the schema in a main checkout (full history + tags so since_version.go can stamp), copies the result into a worktree on the docgen branch, and pushes there. workflow_dispatch no longer takes a tag input; it picks up the most recent v* tag automatically. Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
A branch push left GITHUB_REF starting with refs/heads/, so the strip was a no-op and the wrong value ended up in the commit message. ref_type/ref_name are unambiguous. Co-authored-by: Isaac
Co-authored-by: Isaac
Waiting for approvalBased on git history, these people are best suited to review:
Eligible reviewers: Suggestions based on git history. See OWNERS for ownership rules. |
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
.github/workflows/update-schema-docs.ymltriggers onv*tag pushes (and manualworkflow_dispatch, which auto-detects the latestv*tag).bundle/schema/jsonschema_for_docs.jsonfrommain(full tag history is required sosince_version.gocan stampx-since-version), asserts only that file changed, and pushes the result to the dedicateddocgenbranch.mainis never modified.docgenwas bootstrapped as an orphan branch containing onlyREADME.md; the workflow addsbundle/schema/jsonschema_for_docs.jsonand updates it on every release.Why
bundle/internal/schema/since_version.goderivesx-since-versionfromgit tag --list 'v*'at generation time, so the committed file becomes stale the moment the next tag is pushed. This workflow keeps a clean publish branch (docgen) current automatically, decoupled from main.End-to-end test
Triggered the workflow via a temporary branch trigger, verified the file landed on
docgenwith up-to-date since-versions:Subsequent run (no schema change) correctly logs
docgen already up to date for v0.299.0; nothing to commit.