policy: grade only open pull requests against the linked-issue policy - #9
Kartikey1306 wants to merge 1 commit into
Conversation
The reusable job is called from a byte-identical linked-issue.yml in 19 repositories, each triggering on pull_request_target for [opened, edited, reopened, synchronize]. `edited` fires on closed and merged pull requests too, and nothing guarded on the PR's state, so a body edit on a PR merged before the policy existed graded it against the policy and failed it. On 2026-09-14 that produced 50 failing runs across eos, eBoot and ebuild, every one on a merged or closed branch. A merged PR cannot be changed to satisfy the policy, and grading it says nothing about the tree. Only an open PR is a decision still to be made, so the job now runs only when github.event.pull_request.state == 'open' -- `github.event` in a reusable workflow is the caller's event. Open PRs are graded exactly as before. Three callers (eos#154, eBoot#125, ebuild#144) carry the same guard on their own copy; the review on each asked for it to move here, where one bump of the `uses:` pin gives every caller the fix. Those three become no-ops once the pin is bumped. The new test pins the parsed structure rather than the text: the guard must be on the job (a step-level `if` would still spin the job up and report a status for a merged PR). Verified by mutation: guard removed -> 1 failure; guard moved onto a step -> 2 failures; restored -> 20 tests OK under the exact command community-governance-tests.yml runs. Closes embeddedos-org#8
|
Ready for review — this PR has never had one, and it is the org-wide half of a fix three repos are already carrying locally. Head Why it is here rather than in each caller. Verified at
The guard is checked two ways, and both were shown to fail without it — I removed the line and ran the suite rather than assuming:
That second case is the one a substring check would pass and the one that matters: a step-level Not run here: the reusable workflow itself against a live
|
Closes #8
Problem
linked-issue-policy.ymlis called from a byte-identicallinked-issue.ymlin 19 repositories, each onpull_request_targetfor[opened, edited, reopened, synchronize].editedfires on closed and merged PRs too, and nothing — caller or reusable job — guards on the PR's state. So a body edit on a PR merged before the policy existed grades it and fails it. On 2026-09-14 that produced 50 failing runs across eos, eBoot and ebuild (26 / 13 / 11), every one on a merged or closed branch.Three callers already carry the guard on their own copy (eos#154, eBoot#125, ebuild#144); the review on each asked for it to move here so the other 16 repositories get it too.
Change
One
if:on thelinked-issuejob —github.event.pull_request.state == 'open'— with the reason in a comment.github.eventin a reusable workflow is the caller's event. Open PRs are graded exactly as before; the steps are unchanged.A test pins the parsed structure, not the text: the guard must be on the job — a step-level
ifwould still start the job and report a status for a merged PR.Verification
Parsed structure asserted on the change itself:
ifonjobs.linked-issue,nameandruns-onunchanged, the three steps unchanged in order.After this lands
Callers pin
uses: …@92cb596c…withpolicy_ref: 92cb596c…. Bumping both to this merge commit gives every caller the guard; eos#154, eBoot#125 and ebuild#144 then drop to no-ops and can be closed or reduced to the pin bump.Not run
The guard has not been exercised end-to-end, and cannot be from this PR. A
pull_request_targetworkflow runs from the base branch's copy, so no PR against this repository — or against any caller — can trigger a liveeditedevent on a merged PR through the changed job. The evidence that it does what it claims is therefore indirect: the parsed structure (asserted by the new test), theif:expression being the standard GitHub Actions form, and the 26 eos / 13 eBoot / 11 ebuild runs of 2026-09-14 that were resolved branch by branch and that this guard would have skipped. The first real observation comes after merge, on the next body edit of a merged PR in a caller whose pin has been bumped. (Caveat carried over from #10, which was closed in favour of this PR.)