Repository navigation
fix(release): give a crate added since the last release a first-release tag pattern, and check both ends - #222
Merged
Merged
Conversation
…se tag pattern, and check both ends release-pr has failed on main since #211: `cannot find package "thrust-edge" in workspace`. Every crate finds its previous version from the one tag v<version>; release-plz 0.4.3 then rebuilds that tag's workspace and looks the crate up in it (next_ver.rs, process_git_only_package), and thrust-edge is not in v0.2.0. A crate is treated as a first release only when no tag matches its pattern. - release-plz.toml: thrust-edge gets git_tag_name = "thrust-edge-v{{ version }}", which matches no tag. The header says why, and that the pattern goes once a release contains the crate. - check-release-plz.py: a git_tag_name may only be the entry's own first-release pattern, and never on the tagger. New --first-release, against the highest v<major>.<minor>.<patch> tag, comparing package names (a moved crate is not new): - `required`: every crate the tag lacks has its pattern. Run by ci.yml's deps job, whose checkout now fetches the tags. - `exact`: and no crate the tag has keeps one. Run by release-plz.yml's release-pr job before release-plz. It is not run in deps, where from the tag of a release to the pattern's removal it would fail every pull request, and main's run of the release commit. - cicd.md: "A new crate", and how it was verified. Verified with release-plz 0.4.3 on clones of main: - at #218: release-plz update exits 1 with the CI error on main's config; with this one it exits 0 and proposes 0.2.1 with #211's feature in the changelog. The candidate's Cargo.lock passes cargo metadata --locked. A first release's own commits do not set the bump (a feature alone proposed the patch). - at #221 (every crate moved, ADR-0009): the same error on main's config. With this one, exit 0 and nothing to propose: release-plz counts a crate's commits by its current directory, so #211's feature (made under crates/thrust-edge) no longer counts and the move is a chore. #211's feature reaches a changelog only through a release made by hand. - then a fix(edge) commit proposes 0.2.1. With v0.2.1 tagged and a second fix: with the pattern kept, 0.2.2's section lists the first fix (and the move) again, and --first-release exact refuses it; with it removed, only the second fix, and exact passes. - on this repository: --first-release required refuses main's release-plz.toml (thrust-edge only: the moved crates are found in v0.2.0 by name) and passes with this one; exact passes. - test_check_release_plz.py: 151 passed, over generated git histories for every crate. Nine hand mutants of the checker (name-order or pre-release tags as the last release, exact never or always refusing, any pattern value accepted, the tagger's pattern allowed, no tag passing, crates compared by directory, a patterned crate still required) each fail it. - lint-all-workflows.sh, actionlint, test-lint-all-workflows.sh, test-lint-workflow.sh, test-required-contexts.sh and test_plan_ci.py (5013) pass. Not verified: actions/checkout with fetch-tags at depth 1 on the runner. Its source at the pinned commit adds +refs/tags/*:refs/tags/* to the fetch; this pull request's deps job is the check. Refs: #195 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
The
release-prjob has failed on main since #211, so no release-candidate pull request can be made:Why
Every crate finds its previous version from the one tag,
v<version>. release-plz 0.4.3 then rebuilds that tag'sworkspace and looks the crate up in it (
next_ver.rs,process_git_only_package).thrust-edgeis not in v0.2.0.release-plz treats a crate as a first release only when no tag matches its pattern. I found no upstream issue for this.
(#211 also left
Cargo.lockwiththrust-edgeat 0.1.0, which failed every--lockedjob. #221 has since rewritten thatline, so it needs no pull request.)
The change
release-plz.toml:thrust-edgegets a first-release pattern,git_tag_name = "thrust-edge-v{{ version }}",which matches no tag. The header explains the rule.
check-release-plz.py:git_tag_namemay only be the entry's own first-release pattern, and never on the tagger.--first-release, compared against the highestv<major>.<minor>.<patch>tag, by package name. A crate that onlymoved directory is not new: chore: move every crate into its ADR-0009 directory (crates-layout PR 3) #221's moved crates pass.
required, in ci.yml'sdepsjob (its checkout now hasfetch-tags: true): every crate the tag lacks has itspattern. The pull request that adds a crate adds its pattern too.
exact, in release-plz.yml'srelease-prjob before release-plz runs: no crate the tag has keeps a pattern.That job runs after
release, so it sees the tag of a release made by the same push.exactis not indeps: from the moment a release is tagged until the pattern is removed, it would failevery pull request, and main's run of the release commit itself.
cicd.md: a "A new crate" bullet under Release candidates, and how it was verified.What to expect after merging
release-prturns green but proposes nothing yet. release-plz counts a crate's commits by its current directory,so feat(edge): route the shared hostname to production or to an opted-in target, decided by Flagship #211's feature, made under
crates/thrust-edge/, stopped counting when chore: move every crate into its ADR-0009 directory (crates-layout PR 3) #221 moved the crate tocrates/edge/, andthe move itself is a
chore. The nextfeatorfixin a crate opens the candidate. A first release's own commits donot set the bump, so a feature only in the edge would propose a patch.
cicd.mddescribes(the
rc/manual-<version>branch), or add its line to the candidate.thrust-edge. Delete the pattern line. Therelease-prjobfails until you do, and names the line.
Verified with release-plz 0.4.3, on clones of main
release-plz.tomlrelease-plz.tomlCargo.lockpassescargo metadata --lockedrelease-plz.tomlfix(edge)--first-release exactrefuses itexactpassesOn this repository:
--first-release requiredrefuses main'srelease-plz.toml, naming onlythrust-edge, and passes with this one;exactpasses.Tests:
test_check_release_plz.pypasses 151, over generated git histories for every crate. Nine hand mutants of thechecker each make it fail:
exactnever refusing, or always refusing;Local CI checks: all 12 steps of the
depsjob pass, as do actionlint,test-lint-all-workflows.sh,test-lint-workflow.sh,test-required-contexts.shandtest_plan_ci.py(5013).Not verified
fetch-tags: trueat depth 1 on the runner. The source of actions/checkout at the pinned commit adds+refs/tags/*:refs/tags/*to the fetch. This pull request'sdepsjob is the check: without the tags, the guard exits2 rather than passing.
release-prstep on main. It runs only after a merge.Refs #195
🤖 Generated with Claude Code