ci(pr-checks): fail closed when the test job is skipped under pull_request_target - #418
ci(pr-checks): fail closed when the test job is skipped under pull_request_target#418clagentic-builder[bot] wants to merge 3 commits into
Conversation
|
BOBBIE - clean Audited PR #418 (.github/workflows/pr-checks.yml only, diff scope b4811a2..4b150ff, 27 lines added, task lr-665c62). pull_request_target execution boundary verified at head SHA 4b150ff:
No secrets, no injection, no permission widening, no incomplete result-state handling, no new decorative-guard variant. Scanners found nothing in the diff scope; semgrep hits on pull_request_target checkout and mutable-tag patterns at lines 44, 65, 116, 121 predate this PR (confirmed byte-identical to base) and are not part of this changeset. scanners_run: gitleaks detect (0 findings), semgrep p/github-actions plus p/secrets (6 findings, all pre-existing and out of diff scope, none in test-gate), osv-scanner (not applicable, no dependency or lockfile change in this diff) |
|
PEACHES — blocking (1 finding)
|
…eeds.test.result (lr-665c62)
MILLER fnd-3973e2 (re-diagnosis) established that test-gate's needs:test + if: always() rescues a dependency that FAILED or was CANCELLED, but does NOT rescue one skipped by its own job-level if: -- the skip propagates. Under pull_request_target, test is skipped by its own if:, so test-gate is never scheduled at all on the event this defect actually manifests on. It produces no check-run, not even a skipped one. This is documentation repair, not a fix -- the workflow layer cannot express 'this SHA was tested by some sibling run', so no YAML edit here can close the gap. Closing it requires branch protection requiring the 'test' check by name (operator/repo-settings action, tracked on lr-665c62). Changes: - pr-checks.yml test-gate job comment: remove the false claim that it 'runs on every event this workflow listens to, including pull_request_target'. State plainly what it does cover (test dispatched but failed/cancelled) and what it does not (the pull_request_target skip-propagation case), and why that residual requires branch protection rather than a workflow edit. - test file header: remove the claim that this file closes the PEACHES demonstrated-failure gap. It proves the extracted shell conditional is correct for every needs.test.result value (a real, worth-keeping property) -- it does not and cannot prove the job is ever dispatched under pull_request_target, since it never models GitHub's job scheduling layer. Tests unchanged in behavior -- same assertions, same pass/fail outcomes. npm test: 1590 passed, 0 failed. TASK: lr-665c62
HONEST DISPOSITION UPDATE (fold-in, lr-665c62, MILLER fnd-3973e2 + holden ruling seq 4). This PR does NOT fix lr-665c62. The shell conditional test-gate runs is correct and is tested (test/pr-checks-test-gate-fail-closed-lr-665c62.test.js), but that conditional is never reached in the case the defect exists for.
Why: test-gate has needs: test plus if: always(). always() only rescues a dependent whose dependency FAILED or was CANCELLED. It does NOT rescue a dependent whose dependency was SKIPPED by that dependency own job-level if: -- the skip propagates through needs: instead. Under pull_request_target, the test job is skipped by its own if: (line 110), so test-gate is never scheduled at all on that event -- it produces no check-run, not even a skipped one. Verified twice independently against head 248d5a1 via the GitHub checks API: the check suite for the pull_request_target run contains exactly 2 check-runs (checks, test-skipped) and no test-gate entry, while the paired pull_request run (where test genuinely executed and passed) shows test-gate passing -- asserting success == success, the case that was never in question.
So the guard is reachable exactly when it is unnecessary, and unreachable exactly when it is necessary. The gap this PR was opened to close is still open: a head that produces only a pull_request_target run still reports the whole workflow SUCCESS with npm test never executed.
What this PR now does: corrects two false claims that shipped in the original commits -- the workflow comment claiming test-gate runs on every event including pull_request_target (false), and the test file header claiming to close the PEACHES demonstrated-failure gap (it closes only the adjacent question of shell-conditional correctness, not job-dispatch reachability). Both are now documentation-accurate about what is and is not covered.
What actually closes lr-665c62: branch protection requiring the test check by name. A workflow run cannot see its sibling runs, so nothing expressible in this file can assert this SHA was tested by some other run. Branch protection evaluates across the whole check suite for a SHA, and a required check that is skipped or absent is not satisfied. This is an operator/repo-settings action, not a further workflow edit -- tracked on lr-665c62, not resolvable by any further AMoS build cycle on this YAML.
Do not merge this PR believing it closes lr-665c62. It corrects the artifact record only. Task lr-665c62 remains open pending the branch-protection change.