Skip to content

Auto-detect target Materialize version for docs skill bump#7

Draft
bosconi wants to merge 2 commits into
mainfrom
jc/auto-detect-mz-version
Draft

Auto-detect target Materialize version for docs skill bump#7
bosconi wants to merge 2 commits into
mainfrom
jc/auto-detect-mz-version

Conversation

@bosconi
Copy link
Copy Markdown
Member

@bosconi bosconi commented Apr 28, 2026

Summary

Adds version-aware auto-bump behavior to the update-materialize-docs-skill workflow.

  • When mz_version is empty, the workflow reads level-2 version headings (## vX.Y.Z) from doc/user/content/releases/_index.md on materialize@main, takes the highest, and compares against the version recorded in the heading of skills/materialize-docs/README.md (# materialize-docs vX.Y.Z).
  • Regenerates only when the upstream release is strictly newer than the recorded version (or when no version is recorded yet, as is the case today).
  • Updates the README heading to the new version after a successful auto-bump.
  • When mz_version is explicitly provided, the workflow always regenerates at that ref and leaves the README heading alone.
  • The opened PR is no longer a draft.

Testing without merging

Once this branch is pushed, the workflow file on main is still the previous version. To run this branch's version of the workflow without merging:

gh workflow run update-materialize-docs-skill.yml --ref jc/auto-detect-mz-version

GitHub Actions will execute the workflow file from jc/auto-detect-mz-version (rather than main). The workflow itself still operates against the agent-skills repo — its Set up branch step targets the standard automated/update-materialize-docs-skill branch, so it will (if there are content changes) open a PR that is reviewable and merge-targeted at main.

Test plan

  • gh workflow run update-materialize-docs-skill.yml --ref jc/auto-detect-mz-version with no inputs — confirm it detects v26.20.2, regenerates, updates the README heading, opens a non-draft PR.
  • Re-run the workflow on main after the auto-bump PR merges — confirm the second run is a no-op (already up to date).
  • gh workflow run update-materialize-docs-skill.yml --ref jc/auto-detect-mz-version -f mz_version=v26.19.0 — confirm it regenerates at the explicit ref without touching the README heading.

Generated with Claude Code

bosconi and others added 2 commits April 28, 2026 16:25
When `mz_version` input is empty, the workflow now reads level-2 version
headings from doc/user/content/releases/_index.md on materialize@main,
takes the highest, and compares against the version recorded in the
heading of skills/materialize-docs/README.md. It only regenerates when
the upstream release is strictly newer, and updates the README heading
to the new version after a successful auto-bump.

The PR is created non-draft, and explicit `mz_version` invocations
still bypass version-checking and leave the README heading alone.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When the workflow is dispatched on a feature branch via
`gh workflow run --ref <branch>`, actions/checkout would otherwise
default to that branch's tree. The auto-bump PR then inherits the
feature-branch changes (e.g. the workflow file itself). Pin the
checkout to the default branch so test runs and production runs both
produce auto-bump PRs that contain only generated content.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bosconi bosconi requested a review from def- April 29, 2026 00:00
Copy link
Copy Markdown

@def- def- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What kind of tokens does the LLM have access to by the way? Could it do something else than just open a PR?

working-directory: agent-skills
env:
INPUT_MZ_VERSION: ${{ inputs.mz_version }}
run: |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so complex it should really be a Python script using the semver library I guess. We have code for some of that in the Materialize repo already.

@bosconi bosconi marked this pull request as draft May 17, 2026 23:29
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