Skip to content

Add pre-release version batching to VersionCheck and Registrator#110

Merged
mtfishman merged 1 commit intomainfrom
mf/prerelease-batching
May 8, 2026
Merged

Add pre-release version batching to VersionCheck and Registrator#110
mtfishman merged 1 commit intomainfrom
mf/prerelease-batching

Conversation

@mtfishman
Copy link
Copy Markdown
Member

@mtfishman mtfishman commented May 8, 2026

Summary

Lets a package accumulate multiple breaking-change PRs against main under a stable pre-release suffix (e.g. 0.22.0-DEV) and register a single release at the end. While the version carries any pre-release suffix, VersionCheck allows successive PRs to leave the version unchanged and Registrator skips registration entirely. The eventual strip-suffix release PR (0.22.0-DEV -> 0.22.0) registers normally.

Workflow

From To Pattern Effect
0.21.5 0.22.0-DEV enter accumulation mode bump-shape validated; registration skipped
0.22.0-DEV 0.22.0-DEV continuation PR allowed unchanged; registration skipped
0.22.0-DEV 0.22.0 release registers; is_breaking determined against last released version

Suffix is freeform (-DEV, -rc, -alpha, etc.); any non-empty pre-release tag triggers the skip behavior. The convention in the ITensor ecosystem will be -DEV to match Julia's own nightly versioning.

Bump-shape validation moved pre-merge

Previously the shape check (patch+1, minor+1 with patch=0, major+1 with minor=patch=0) ran only post-merge in Registrator, so a malformed bump like 0.21.5 -> 0.99.0-DEV or 0.21.5 -> 0.21.7 would only fail after the PR landed. VersionCheck now runs the same valid_bump check pre-merge so malformed bumps fail the PR check directly.

valid_bump is duplicated between VersionCheck.yml and Registrator.yml with a "keep in sync" comment — the two reusable workflows can't easily share Julia code without a heavier composite-action setup. If maintenance becomes painful, we can lift it into a shared composite action later.

is_breaking on the release PR

The strip-suffix release PR (0.22.0-DEV -> 0.22.0) shares M.m.p with the previous commit, which would mis-classify the release as non-breaking under the existing major-or-minor-bump rule. A new find_last_released_version helper walks the branch's history to find the most recent suffix-free version and computes is_breaking against that.

Incidental cleanup

The General-vs-local registry-route lookup was duplicated in two branches of the Registrator meta step. Extracted into a register_route(uuid) helper.

Lets a package accumulate multiple breaking-change PRs against `main` under
a stable pre-release suffix (e.g. `0.22.0-DEV`) and register a single
release at the end. While the version carries any pre-release suffix,
VersionCheck allows successive PRs to leave the version unchanged and
Registrator skips registration entirely. The eventual strip-suffix release
PR (`0.22.0-DEV` -> `0.22.0`) registers normally.

Also adds bump-shape validation pre-merge in VersionCheck. Previously the
shape check (patch+1, minor+1 with patch=0, major+1 with minor=patch=0)
ran only post-merge in Registrator, so a malformed bump like
`0.21.5 -> 0.99.0-DEV` would only be caught after the PR landed. Both
workflows now share a `valid_bump` function with a "keep in sync" comment.

On the strip-suffix release PR, `is_breaking` is now determined against
the last actually-released version in the branch's history rather than
the previous (pre-release) commit, which would otherwise mis-classify
the release as non-breaking.

Incidental cleanup: extract the duplicated General-vs-local registry
lookup into a `register_route` helper.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mtfishman mtfishman merged commit fe3dfd3 into main May 8, 2026
4 checks passed
@mtfishman mtfishman deleted the mf/prerelease-batching branch May 8, 2026 16:13
mtfishman added a commit to ITensor/ITensorTestPackage.jl that referenced this pull request May 8, 2026
## Summary

End-to-end canary for the prerelease-batching feature merged in
[ITensor/ITensorActions#110](ITensor/ITensorActions#110):
exercise the strip-suffix release path.

Expected behavior on this PR:

- **VersionCheck (pre-merge):** pass. `0.2.0-DEV → 0.2.0` is the
documented release transition.
- **Registrator (post-merge):** fire and open a registry PR against
`ITensorRegistry` for `ITensorTestPackage v0.2.0`.
- **`is_breaking`:** derived against the last released version (`0.1.0`)
via `find_last_released_version`, since `0.2.0-DEV` shares the bare
`M.m.p` with this release. With `0.1.0` as the reference, this is a
pre-1.0 minor bump → breaking → release notes propagate to the registry
PR and the GitHub release.
- **TagBot:** auto-fires after the registry PR merges, creating `v0.2.0`
tag and release.

Release notes:

> Canary release validating the prerelease-batching workflow end-to-end.
No package functionality changed between 0.1.0 and 0.2.0.
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.

1 participant