chore: Test the action checker against the shapes it has missed #31
Labels
No labels
priority/P0
priority/P1
priority/P2
priority/P3
size/L
size/M
size/S
size/XL
size/XS
state/done
state/in-progress
state/in-review
state/needs-refinement
state/ready
type/bug
type/chore
type/feature
type/refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
amtronics/platform-actions#31
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Context
.forgejo/scripts/check-actions.pygates every pull request in this repository, and nothing tests it.That was tolerable when it did one thing. It now has several branches that each exist because a specific shape slipped through: a
runs:that is not a mapping, asteps:that is not a list, a step that is not a mapping, a missingsteps:key, an emptysteps:value, an empty list, and thebash -npass over eachrun:body with${{ }}substituted. Every one of those was added after something passed asok (0 run step(s) checked).The pattern is the problem. Each fix was verified by hand against fixtures at the time — including #28's, where I ran seven shapes against
mainand the branch and put the table in the pull request — and then the fixtures were thrown away. So the evidence is about the commit that made the change, not about the script as it stands. A later refactor can reintroduce any of them and CI will be green, because the only thing the pipeline runs the checker against is six actions that are all correct.The script is also the one piece of this repository whose failure is silent by construction: a check that stops checking reports success.
Scope
check-actions.pycovering the shapes it is known to have missed, run byPR / validate.ROOT.rglob("action.yml")cannot reach, or the test files fail the real run — this is a real trap, not a hypothetical.Acceptance criteria
PR / validateruns the checker over the real actions, then the fixture is not picked up.Notes
The last criterion in the list is the one that matters most. A test suite for a validator is itself a validator, and the same failure mode applies one level up: it can pass while checking nothing. Prove each case fails with its branch removed before trusting the suite.
Picking this up.
expirohas had no runner contact with Docker Hub since 02:06, so this repository remains where work can finish.The shape. A test script beside the checker, run by
PR / validate. Each case builds a throwaway tree containing a copy ofcheck-actions.pyand onefixture/action.yml, runs the checker there, and asserts both the exit code and a fragment of the message. I have now built this harness three times ad hoc tonight — for#28, for#29, and for verifying#30's fixtures — which is the argument for it existing as a file.The trap the second criterion names is real and I hit it.
ROOT.rglob("action.yml")finds everything beneath the repository root, so a deliberately-broken fixture committed anywhere under it fails the real run. Building each case in a temp directory outside the tree avoids it entirely, and is why I am not adding afixtures/folder.The fourth criterion is the one I will spend the time on. Every case must be proved by deleting the branch of the checker it covers and watching it fail — not by watching it pass. A test suite for a validator can itself pass while checking nothing, which is the same failure the validator exists to prevent, one level up. I will run that deletion pass for each branch and put the table in the pull request.
Ambiguity I am settling: the issue says "run by
PR / validate". I am adding it as its own step before the checker runs over the real actions, so a broken checker is reported as a failing test rather than as a confusing result from the real run.