fix(checks): undated-release fires on a final tag, not on a candidate #20
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
actions/changelog!20
Loading…
Reference in a new issue
No description provided.
Delete branch "mikluko/octant/1738-undated-release"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The defect
undated-entryandundated-releasesplit on whether a tag already names thenewest entry's version, and read the answer as the release shipped. That is
sound for a final version and false for a pre-release: a candidate ships its tag
and stays undated on purpose, which is what a stabilization branch is for.
Reproduced against the built binary, one
git tagapart with the documentuntouched:
The fix
undated-releasefires where the tag naming the entry is a final. Acandidate falls through to
undated-entry— the check a stabilization branchalready switches off — so that branch goes quiet again and the trunk is
unchanged.
The predicate reads the entry, not the tag.
Git.tagnow matches bysemver.Compare, and §11 counts the pre-release identifiers, so a tag thatmatches this entry carries the same ones it does.
e.Semver.Prerelease()is thatquestion already parsed and in hand; re-parsing the tag to ask it would be a
second spelling of an answer we are holding. That equivalence rests on
tag()comparing by precedence, so it is a comment in the diff rather than left to be
re-derived.
Why nothing caught it
It was unreachable until an hour ago. While
examples/release-branch/composed
vX.Y.Z-pre.<run>against an entry namingX.Y.Z, no tag a branch cutever named its own entry's version. #18 deleted that composition, so the tag
names the entry's version from the first candidate on — and every push after it
became a finding, on the one branch whose purpose is to cut them.
The suite could not reach it either: the five repository-reading checks are
excluded from
examples_test.goby design,undated-releaseamong them, whichis why the example asserts the input in
TestReleaseBranchKeepsUndatedReleaseOnrather than watching the check fire.
Tests
Two new
TestGitChecksrows andTestUndatedCandidateIsSilentOnAStabilizationBranch,which is the branch's own configuration —
undated-entryoff, everything elsedefault. Both fail without the predicate, checked by reverting it. A third row
pins the converse — a candidate tag does not date the final it was cut for —
which held before and is relied on now.
The split survives in both directions: the existing case holding a final tag
naming an undated entry to
undated-releaseon those same settings is untouchedand still passes.
Also here
The two places where
examples/release-branch/paraphrases this check said theold semantics. Corrected in place — the example keeps
undated-releaseon, andnow says why that is safe rather than leaving a reader to find out that the
branch's own tags trip it.
Notes
[Unreleased]only, so merging cuts no tag. The entry rides in whateverpromotes it — #16, presumably.
date-mismatch) is the same switch and the sameGit.tag. Whicheverof us lands second rebases; no preference here.
go test ./...,go vet ./...,gofmt -lclean,go run ./cmd/gen-readmeidempotent (it moved the two check descriptions, which is the README table).