Skip to content

Add workflow to refresh jsonschema_for_docs.json after each release#5200

Open
shreyas-goenka wants to merge 6 commits intomainfrom
workflow/update-schema-docs-on-release
Open

Add workflow to refresh jsonschema_for_docs.json after each release#5200
shreyas-goenka wants to merge 6 commits intomainfrom
workflow/update-schema-docs-on-release

Conversation

@shreyas-goenka
Copy link
Copy Markdown
Contributor

@shreyas-goenka shreyas-goenka commented May 6, 2026

Summary

  • New .github/workflows/update-schema-docs.yml triggers on v* tag pushes (and manual workflow_dispatch, which auto-detects the latest v* tag).
  • Regenerates bundle/schema/jsonschema_for_docs.json from main (full tag history is required so since_version.go can stamp x-since-version), asserts only that file changed, and pushes the result to the dedicated docgen branch. main is never modified.
  • docgen was bootstrapped as an orphan branch containing only README.md; the workflow adds bundle/schema/jsonschema_for_docs.json and updates it on every release.

Why

bundle/internal/schema/since_version.go derives x-since-version from git 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 docgen with up-to-date since-versions:

$ curl -sfL https://raw.githubusercontent.com/databricks/cli/docgen/bundle/schema/jsonschema_for_docs.json \
    | grep -o '"x-since-version": *"v[^"]*"' | sort | uniq -c | sort -rn | head -5
 631 "x-since-version": "v0.229.0"
  54 "x-since-version": "v0.298.0"
  46 "x-since-version": "v0.287.0"
  46 "x-since-version": "v0.279.0"
  31 "x-since-version": "v0.260.0"

Subsequent run (no schema change) correctly logs docgen already up to date for v0.299.0; nothing to commit.

`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
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
@shreyas-goenka shreyas-goenka deployed to test-trigger-is May 6, 2026 19:23 — with GitHub Actions Active
@shreyas-goenka shreyas-goenka marked this pull request as ready for review May 6, 2026 19:28
@shreyas-goenka shreyas-goenka requested a review from pietern May 6, 2026 19:28
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Waiting for approval

Based on git history, these people are best suited to review:

  • @pietern -- recent work in .github/workflows/
  • @simonfaltum -- recent work in .github/workflows/

Eligible reviewers: @andrewnester, @anton-107, @denik, @renaudhartert-db

Suggestions based on git history. See OWNERS for ownership rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants