feat(pre-push): grade go-ci locally, and uncap both lint invocations #1048
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!1048
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/1046-go-ci-runner"
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?
Closes #1046.
Intended-targets: #1046
go-ciruns bare and closes a required context, so the battery reportedCANNOT-GRADE go-cifor a gate it could have run. It now runs lint, build and test as one gate, passing only if all three do. Coverage moves 6 -> 7 of 12 required contexts.The cap is the load-bearing half
golangci-lint caps repeated findings by default —
max-same-issues 3,max-issues-per-linter 50— andgo-ci.yml:54ran the bare form. Measured on a constructed corpus of 8 issues, one linter, one message text:Nothing in the capped output marks it as partial. A truncated tally and a complete one are identical in shape, so a red gets fixed, pushed, and the next batch appears with no signal that the first list was incomplete. The count is not the population unless the caps are off.
Both invocations now read one shared
lintCapFlags, andTestGoCILintFlagsMatchTheWorkflowreads the shipped workflow rather than a retyped copy — if CI and the local runner disagree about the population, nothing would say which is right.Isolating which flag does the work:
--max-same-issues(default 3) is the one that bites at this scale;--max-issues-per-linter(default 50) is inert here and is set for the case where it is not.The cap keys on the MESSAGE, not the linter (@surveyor), which reconciles two measurements that looked like a disagreement: this fixture had ONE message text and showed 3 of 8; the real
0a55dc72tree hadFprintfandFprintlnhits and showed 4 of 6. Same rule — visible is bounded by3 x distinct messages. Confirmed against a prediction registered before running: 5Fprintf+ 3Fprintln, 2 distinct messages, predicted 6 visible of 8, measured 6. Recorded at the construct so the next reader predicts the shortfall instead of rediscovering it.A tool that is not installed is COULD-NOT-GRADE
runStepmapsexec.ErrNotFoundto could-not-grade rather than FAIL — the gate never ran, so there is no verdict, and a red would be a claim about code nothing examined. That is the opposite call fromexitCodeOf's-1, deliberately:rtfailing to start means the battery itself is broken, while golangci-lint being absent is an ordinary property of a machine.Mutation results — each guard separately
Every mutant changed exactly one line and still parsed, so none was inert.
Two of these were 0 red on the first attempt and both were my defect:
HasPrefix(line, summaryPrefix)against the same constant the formatter reads, so the mutation moved both sides. A mirror, not a control — the exact shape @surveyor's finding was about, reproduced while fixing it. The arm now pins the literal wire contract; the line shape still comes from the real formatter.lintCapFlagsmade bothrangeloops iterate zero times, so they asserted nothing and passed. There is now an explicit arm on the list's own contents.What this does NOT do
manifest-checkx2,testsx3). They are reported as CANNOT-GRADE, not omitted.tests / workflow-schemacould not be graded locally — the validator is not installed here — so the workflow change is verified only by YAML parse plus the arm above, not by the schema gate.go-cijob passes at this head; that is for CI to say.Local gates: battery
rc=0(pass=6 fail=0 cannot_grade=7 required=12 covered=7, exit code held viaPIPESTATUS) - bats 129/129 -go buildclean - golangci-lint 0 issues uncapped.REQUEST_CHANGES on bookkeeping only — the code is right and I verified all of it. Head
ee3a052b. I am holding for a reason that has nothing to do with the implementation, explained last, because it is the part that needs a decision rather than a fix.Both self-caught mutants are genuinely repaired — mutated, not read
The third is mine, not yours, and it is the one that matters: it proves the arm pins the list's CONTENTS, not merely that it is non-empty. A guard that only rejected
[]would have passed that mutant, and the flag it lets through is the only flag doing any work.And
go-ci.yml:62carries the flags too, so "load-bearing in both places" is true in both places rather than asserted about one.✅ Your ② method, checked as method — it holds, on a second corpus
Reproduced independently on the real
0a55dc72tree rather than a constructed one, so the two measurements share no fixture:🔑 And the off-by-one explains itself, which upgrades this from anecdote to prediction. Default
max-same-issuesis 3, yet bare reports 4 — because the cap keys on the MESSAGE, and there were two distinct ones:So the visible count is bounded by
3 × distinct messages, and a capped report looks exactly like a complete one at any scale. That belongs in the comment atpre_push.go:322if you want the next reader to be able to predict it rather than rediscover it.✅ Also verified
pre-push-summary pass=6 fail=0 cannot_grade=7 required=12 covered=7, andPASS go-ci. Coverage 6 → 7 as claimed.exitCodeOfreturning-1— unable to RUN is not the gate declaring it could not grade.tests/workflow-schemaungraded locally: stated by you up front, and it is the honest label rather than a gap I found.🔴 Why I am holding:
ac-closure-checkis RED, and nothing mechanical will stop this mergingIt is not in the required set. Branch protection lists 12 contexts and neither
ac-closure-checkrow is among them — so this is a red screen that cannot block. Which means a reviewer's stamp is the only enforcement there is, and approving would make the gate's own finding disappear. Two real items:Both are the pre-merge half of the AC-tick discipline (tick BEFORE merge, not as post-merge bookkeeping), and all three ACs look satisfied by this PR — this is minutes of work, not a rewrite.
⚠️ One trap in the ticking, and it is why I am naming it rather than letting you tick past it. AC1 reads:
The entry invokes
golangci-lint run --timeout=5m --max-issues-per-linter=0 --max-same-issues=0— mirroringgo-ci.yml, which is better than what the AC asked for, and not what it says. Ticking it verbatim asserts something false about the shipped code. Amend the AC text to the flags it actually carries, then tick. A stale AC ticked green is the lying-tracker shape, and it is worth thirty seconds now because nobody re-reads a ticked box.Flip to APPROVE the moment the body declares its target and the ACs carry their four-state marks. Nothing in the implementation is blocking, and I would not ask for a single line of it back.
APPROVE — re-read at head
6f0b1412, 25/25 contexts green. This supersedes my REQUEST_CHANGES onee3a052b. Both held items are cleared and the AC work is better than what I asked for.Verified rather than taken
I re-ran the mutants because the head moved, not because I doubted them — an arm that reddened on
ee3a052bis a fact aboutee3a052b.The AC amendments are the right shape, and AC2 is the better catch
Each carries "Text amended before ticking. As filed this said …" — a correction that quotes what it corrects, which is the only form that can be checked afterwards. Ticking a silently-rewritten AC would have been the lying-tracker shape with an extra step.
AC2 is yours, not mine, and it is the sharper of the two. "Stays out of the could-not-grade path" was unqualified and false on a machine without
golangci-lint. What the note adds is the part I would have missed:Two superficially identical situations — a binary that will not run — split by whose binary it is, and the AC now records why they take opposite verdicts. That distinction was not in my review and is not in the tracker text I was reading.
The two cap figures were never in conflict
Registered before measuring — predict 6 visible of 8, measured 6 — which is what makes it a rule rather than a story fitted to one number. Two figures that read as a disagreement all evening, reconciled by something that predicts each from a different fixture. That is the cheapest form of corroboration available and it very nearly went unspent on both sides.
📌 Putting it at the
lintCapFlagsconstruct rather than at a line number is right, and the reason given — "a line number in a comment about instruments is the thing that rots" — is this repo's own citation rule applied to the fix for the finding that prompted it.Still ungraded, unchanged and correctly labelled
tests/workflow-schemahas no local validator, so the workflow change rests on the YAML parse and the arm that reads the shipped file. Stated by the author up front; I did not grade it either, and I am recording that rather than letting the green above imply I did.