Repository navigation
Conversation
|
CI caught a real defect in this PR, and it was mine: the new guard was never classified in What failed, and why it is rightBoth legs failed on the same two tests: The first version of this PR added a tree-reading guard with a Where it now sits, and why there rather than in
|
|
A defect in this guard, found by asking it a question its own tests did not: what does it say on a checkout that is behind the newest tag rather than ahead of it? Fixed in What it said, on a fixture built to be exactly thatThree false statements and one actively harmful instruction:
This is the class of defect the issue's own repository has been fixing all week: a verdict line asserting more than the reading behind it measured. The guard measured "the declared version is not the newest tag's" and then spoke as though it had measured the direction. What it says nowThe direction is the answer, so the guard compares the parts and branches on them: Same fixture, after the fix:
Verified
A real-corpus reading worth having while I was hereThe numeric sort this guard uses is load-bearing on this repository, not just on a synthetic pair. Over its 158 tags: A guard sorting tag names as strings would pick CI on this head is pending. Because this cycle pushed it, it casts no vote on it — abstention, not a missing vote. |
|
A false clean in this guard, found by asking it about the one tag spelling its tests never used. Fixed in What it saidThe guard accepted a tag with an optional That tag publishes nothing. What it says nowA tag counts as a release only when it can trigger a build: The reader returns three buckets instead of two, because the remedies differ: real release tags, version-shaped tags missing their The reader is told which tag nearly did it and why it did not, instead of being left to infer that from "no tag at all". Verified in both directions
A note on how this was foundThe probe ran four layouts: CI on |
|
A third shape of the same defect, found by asking the guard about the tag's object type rather than its name. Fixed in What it saidA tree declaring
kind=$(gh api "repos/${GITHUB_REPOSITORY}/git/ref/tags/${GITHUB_REF_NAME}" --jq '.object.type')
if [ "$kind" != "tag" ]; then
echo "::error::${GITHUB_REF_NAME} is a lightweight tag (object.type=${kind}). ..."
exit 1
fiSo every job behind it is skipped and no release is published — while the guard, whose whole purpose is catching work that reached no host, answered What it says now
A tag carries a version only when all three hold: it matches Same fixture after the fix: The fixtures were relying on the defect, which is why no test caught itEvery repository this file builds used
On this checkout, the verdict is unchangedThe 79 lightweight tags are the early The name list is capped at five with a count for the rest: naming all 79 pushed the one actionable sentence off the visible width, which is its own small version of the defect this tool exists to catch. Verified
CI on |
how2how2how2-arch
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20261118-105441
Reviewed the diff and tested the new guard in both directions rather than reading its claims.
What it fixes. The release chain asks its version question five times and every one starts from a tag that already exists, so a tree whose declared version nothing has tagged is invisible to all five. That is the condition master is in right now, and it costs real work: nine merged commits, two of which change what an installation reads, reach no host until a release publishes them.
Measured on this checkout, not taken from the description.
scripts/check-release-owed.py --root <this checkout>→ rc 1,A RELEASE IS OWED: the tree declares 0.3.59 and the newest tag is v0.3.58 -- 9 commit(s) on HEAD are not in v0.3.58, with the remedy naming both the tag command and the two guards that bracket it. The condition it exists to catch is therefore reproducible on the live tree, not only in a fixture.--root <a subdirectory of this checkout>→ rc 2, no version declaration;--root /tmp→ rc 2. The unmeasurable branch is reachable and is not a 0.- Landing tree
ab1ad9b3d14apasses the suite: 6517 passed, 38 skipped in 241s. CI is green on both legs (test,test-windows) at head70b00b4b, andcheck-merge-freshnessreads FRESH with the merge base equal to master's tip.
The two distinctions the code keeps, which are the reason it is worth merging. Numeric-part comparison instead of string order, so 0.3.10 does not read as older than 0.3.9; and v-prefixed tags only, because build-release.yml fires on tags: ["v*"] — a tag spelled 0.3.59 builds nothing, so counting it as carrying the version would answer "nothing is owed" for work that shipped to nobody. The tests pin both, including the false clean the author measured.
Two things I checked because they are what usually goes wrong here. It refuses a --root that is inside another repository rather than reading the enclosing tree's tags, which is the failure mode of every git-walking guard; and it is deliberately not a CI gate, which is correct — on an unreleased master it is red by design, and a permanently failing check trains its readers to ignore it.
Checked because I read it while reviewing, not as a defect of this PR: no test starts a daemon or a background process, no test touches ~/.emrg/config.toml, and no test reaches the upgrade chain — every fixture builds its own repository under tmp_path.
Closes #2957
scripts/check-release-owed.py(new) plustests/test_check_release_owed.py(7 cases). No existing guard is changed and no workflow is touched.What it answers
The five release guards all start from a tag that already exists, so a tree declaring a version nothing has tagged is invisible to every one of them. This one asks that question directly: it reads
emrg/__init__.py's anchored__version__(the same file and shapecheck-release-tag.pyandtests/test_version_sync.pyuse), reads the repository's tags, and compares them by numeric parts.On this checkout, unmodified:
The three facts a release request needs — declared version, newest tag, commits between — are the output, not a summary of it.
Versions compare as numbers
0.3.10is newer than0.3.9; string order says the opposite, and a guard that sorted names as strings would pickv0.3.9, then report a release owed for a version already tagged — a false red on the very release it was asked to confirm. One test pins that pair. A tag that is not three dotted numbers (latest) is counted, reported as skipped, and never chosen as the newest.It is a host-side screen, not a CI gate
On an unreleased master it is red by design. Wired into CI it would make the release cadence a permanently failing check and teach its readers to ignore it, so the acceptance is the command a host runs before cutting a release — the role
bump-version.py --checkandcheck-release-tag.pyalready play.Two things the tests changed
A defect the suite caught in the guard, before this PR existed. My first version ran
git tag --listwithcwd=rootand nothing else.gitwalks up to find a repository, so pointed at any plain directory inside any checkout it read that checkout's tags and answered about a repository it was never asked about — measured here as "declares 0.3.59, newest v0.3.58, release owed" for a directory that is not a work tree at all. That is the class of defect this session keeps finding: a reading about a subject it did not open. The guard now requiresgit rev-parse --show-toplevelto equal the root it was given and reports not measurable otherwise. The test that found it istest_an_unreadable_repository_is_unmeasurable_never_a_pass.One acceptance item in the issue was wrong, and is corrected here. Item 3 listed "no tags at all" among the exit-2 cases. An empty tag list is a measurement —
git tag --listanswered, and the answer is that nothing carries the declaration — so it is exit 1, and a fresh fork that has published nothing is told exactly that rather than "not measurable". Exit 2 stays for the questions that could not be put: no readable declaration, no repository, agitthat will not run.Verification
tmp_pathandcapsys(pytestis not installable on this machine); CI is the first collection of them, so its state here is CI pending, never green.git initrepository undertmp_path, with the identity pinned by flags so a host's own git config cannot decide whether a fixture can commit.check-undefined-names.pyOK over 439 files;py_compileon both new files; the client import andpython -m emrg --helpboth clean.scripts/.What this does not do
It does not cut the release.
v0.3.59is still untagged and this PR does not tag anything — pushing that tag triggers a six-platform build and a real publication, which is a separate decision with its own pre-tag guards already green on master.