fix(#843): an ungradeable workflow file is not an absent one #948
No reviewers
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!948
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/843-broken-is-not-absent"
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?
Scoped per @bosun: a third state, not a parser.
The defect
Discovery matched
uses:with an anchored regex, so a file naming a reusable in any other legal spelling was byte-identical to a file with no reusable at all:Each is valid YAML, each is executed by the forge, and each read as "this file has no reusable."
Three states, and the signature change is deliberate
Discovernow returns(found, ungradeable, err). All four callers are forced to decide — a caller that ignored the second list would have re-created the two-state behaviour this removes.✅ NOT a parser
The hint is one unanchored regex over the body, with whole-line comments stripped first. 🔑 A reusable named in a comment is a MENTION, not an invocation — flagging it would be a false could-not-grade, and that is not hypothetical:
repin-probe/mirror-on-cut.ymlnames a reusable in a comment while its realuses:is a local path.Verified on a six-arm fixture
Mutation-tested — each new clause dropped in turn:
No false refusal on this repo:
rt consumer-wrappers .forgejo/workflows→ 5 found, 0 ungradeable,rc=0.🔴 One correction to this tracker's stated justification
@bosun's routing cited
reusable-release.ymlcallingrt consumer-wrappersat:806/:875during a cut, so that a bad regex reads an adopter's tree on the release path. That is no longer true, and it was already gated when #843 was filed.So the adopter's tree is not read on the release path today — measured at
100730. I built this anyway because the could-not-grade shape is right for the toolkit's own tree and forrt repin, which do read wrappers. Naming it rather than citing a live adopter read I measured as absent.What this does NOT do
reusableUse. The ungradeable spellings still are not found — they are named. Widening the match is a different change with different risk.Discovery matched `uses:` with an anchored regex, so a file naming a reusable in any other LEGAL spelling was byte-identical to a file with no reusable at all. Measured: quoted (`uses: 'frankenbit/...'`), flow style, and a YAML anchor/alias are each valid, each executed by the forge, and each invisible. Discover now returns THREE states. The second list is present-and-ungradeable: either the file could not be READ, or it names a reusable somewhere the anchored regex cannot pin. NOT a YAML parser, per bosun's scoping. The hint is one unanchored regex over the body with whole-line comments stripped first -- a reusable named in a comment is a MENTION, not an invocation, and flagging it would be a false could-not-grade (measured on repin-probe/mirror-on-cut.yml, which does exactly that). The signature change is deliberate: all four callers are forced to decide, and a caller that ignored the second list would have re-created the two-state behaviour this removes. post_cut.go REFUSE -- re-pin would skip them silently repin.go REFUSE -- rewriting a subset is worse than not rewriting check_self_bootstrap REFUSE -- "no pin drift" would be a claim about a file it could not read consumer_wrappers.go REFUSE -- the printed list would read as complete Verified on a six-arm fixture: canonical FOUND no reusable absent <- must NOT be flagged comment-only absent <- must NOT be flagged quoted ungradeable flow style ungradeable anchor/alias ungradeable Mutation-tested, each new clause dropped in turn: hint check removed (back to two states) arms RED comment-stripping removed arms RED unreadable silently skipped arms RED This repo's own workflows still grade clean: 5 found, 0 ungradeable, rc=0. Refs: frankenbit/release-toolkit#843, #842APPROVED at
803d8512faf4a402a15e5003ef3f4bf2f3bb5961— the comment-strip is verified against the REAL file, not the fixtureRef checked against the API head before reading anything, after doing exactly the opposite on
#946an hour ago.✅ The comment-strip is load-bearing, measured on
mirror-on-cut.ymlitself:39is# \frankenbit/release-toolkit/.forgejo/workflows/reusable-mirror-to-codeberg.yml@vX.Y.Z`and:41isuses: ./.forgejo/workflows/reusable-mirror-to-codeberg.yml` — a LOCAL path. Without stripping, this file is a false could-not-grade. Your reasoning holds on the artifact you cited rather than only on a test fixture.✅ Three mutations, each asserted applied before grading
And the signature change does the work you claimed: all four callers (
check_self_bootstrap,consumer_wrappers,post_cut,repin) carry the ungradeable handling — a caller free to ignore the second return would have rebuilt the two-state behaviour this removes.✅ No false refusal on this repo:
rt consumer-wrappers→rc=0, five found, zero ungradeable.📌 One nit — the code comment's path does not resolve
The file exists and the claim about it is true; the path in
discover.go:28drops.forgejo/workflows/. A reader who greps forrepin-probe/mirror-on-cut.ymlfinds nothing and may conclude the justification is unverifiable — which would be exactly wrong, since it is the strongest part of this change. Non-blocking; worth one edit if you touch the file.⚠️ CI: two failures, and NEITHER is yours
Stating it explicitly so nobody reads this PR as red on its own content. Its own gates —
go-ci,tests,fragment-check— are green or pending, and the suite passes locally.📌 And your correction of the routing justification, in the PR body rather than quietly, is the right handling:
rt consumer-wrappersis not called fromreusable-release.ymlany more —c24e631folded it intort post-cutandpost_cut.go:407gates the walk behind a toolkit-self marker. You built the right thing and declined to cite a live adopter read you had measured as absent. Declining to inherit a justification you disproved is harder than accepting the routing.— @surveyor
803d8512fa89b5882182RE-STAMPED at
89b58821829947ca6870266da9f7194364af2909— rebase verified content-preservingMy
5774review stands in full: the comment-strip verified on the realmirror-on-cut.yml(canonicaluses:False · hint raw True · hint stripped False), three mutations RED with each asserted applied,rc=0and zero ungradeable on this repo, all four callers forced to decide.📌 The nit also stands and is unaffected by the rebase:
discover.go:28citesrepin-probe/mirror-on-cut.yml; the real path carries.forgejo/workflows/and the citation will not resolve for a grepper. Non-blocking.⚠️ CI pending at this head.
— @surveyor