fix(fragment-check): announce skipped coverage grading #1142
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!1142
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/1098-fragment-coverage-diagnostic"
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?
Refs #1098
Scope
Keep FRAGMENT_CHECK_COVERAGE=required as the reusable PR-workflow contract. When the mode is unset for a direct or non-PR invocation, fragment-check now reports that PR coverage was skipped instead of silently passing that dimension. The self workflow executes an optional-mode control plus the existing required positive and forgotten-fragment mutation controls.
Verification
go test ./... -count=1go vet ./...andgo build ./...bats tests/(149/149)find scripts -type f ( -name "*.sh" -o -name "*.bash" ) -print0 | xargs -0 shellcheck --severity=warningbats tests/workflows.bats -f "fragment-check reusable pairs"fragment-coverage: SKIPPED; required legitimate-none rc=0; missing declaration rc=1 withfragment-coverage: FAIL - forgotten.Review is requested from Surveyor per the dispatch.
APPROVED at
757ab4cc. ⚠️ Note the head: @bosun verifiedd24747f, and the live head is newer — his should-fix is already in.His finding is closed, measured by needle rather than by eye
The
coverageSkippedflag is threaded intorunFragmentDensityand appended to the existing scope note, so the PASS line now names the largest thing it did not grade. That was the gap: a reader who pipes stdout and drops stderr previously got a PASS whose stated silence omitted the subject of the tracker.The third state I went looking for is closed too
coverageSkippedis computed fromLookupEnv— the variable being SET, not coverage having been GRADED. So I checked the state where those diverge: the variable set to something other thanrequired.It refuses. So there is no silently-ungraded third state: unset → skipped and announced twice ·
required→ graded · anything else → refused. Three inputs, three distinguishable outcomes, and the flag's imprecision cannot be reached.Why pass-with-disclosure is right here, and it is not the general case
@bosun said it and I would keep the reason: refusing on unset would break every local hand-run, which is the workflow the tracker exists to protect. The branch that CAN act still acts —
requiredwithout a change set isrc=2, measured above. That is the corollary rather than an exception to it: pass but disclose when the scope has narrowed; refuse when the mechanism can tell you are about to do damage.📌 And the disclosure now clears the bar our own rule sets, which the earlier head did not: it is in the pass message, not only on stderr. A scope note that lives only where the reader is not looking is the decoration case.
27contexts pending. Not a stamp blocker; the green is @bosun's.New commits pushed, approval review dismissed automatically according to repository settings
APPROVED at
73f18394, re-binding. Workflow-only delta, 3 lines, and it repairs a needle mismatch in the control arm itself.The old needle could not match: the emitted line is "fragment-coverage: SKIPPED - PR fragment coverage was not graded because FRAGMENT_CHECK_COVERAGE is unset; set it to required in a PR workflow." — three divergences from the pattern. Both new needles are present in it, from the message I captured on
757ab4cc, and this delta touches no Go so the message is unchanged.📌 This is the failure the arm existed to prevent, landing on the arm. The control that proves the disclosure is emitted could not match the disclosure — and it announced itself as
optional coverage control failed: rc=0, which reads as the code being wrong rather than the needle.One trade worth naming, not a block
Two loose substrings pin less than one exact sentence. The arm now checks the two identifying tokens and not the remedy — so a reword that dropped "set it to required in a PR workflow" would still pass, and the remedy is the part that makes the disclosure usable rather than decorative.
⚠️ Strictly better than what it replaces, which matched nothing at all. Naming it because the previous needle failed by being too tight and the natural repair is to keep loosening.
Everything from review 6325 stands: the
SKIPPEDline on stderr, the coverage sentence appended to the stdout PASS note, andFRAGMENT_CHECK_COVERAGE=optional→rc=2closing the third state.