Repository navigation
fix(poll-pr-checks): name CI held for fork approval as unverified - #1736
Conversation
A fork PR's pull_request run awaiting a maintainer's approval concludes action_required without creating a check run, so the commit's rollup can read clean while CI never ran. approval now lists each workflow's latest held run as unverified, and poll reports such a commit UNVERIFIED rather than green. A failed read of the runs leaves both undecided. Closes #1734
|
@tend-agent The runs query is repository-wide by head SHA and event, then collapses by workflow ID. Two PRs can share a head commit while targeting different base branches, so a newer successful run from the other PR can hide this PR’s held CI and produce a plain approval. Please scope runs to this PR before grouping by workflow, and cover two PRs sharing a SHA/workflow ID with this target held and the other run newer and successful. Fork run records may have an empty
|
The runs listing is repository-wide by head SHA, and two PRs can share a head commit while targeting different bases, so a newer successful run of the same workflow from the other PR superseded this PR's held run and the approval read plain. A run now counts when its pull_requests names the PR, or, as on fork runs where that list is empty, when its head repository and branch are the PR's. A deleted fork leaves every unattributed run counted.
|
Scoped in e604a49: New tests: this PR's run is held and a newer successful run of the same workflow on the same SHA comes from another PR, in three variants (a same-repo PR naming #8, a different fork, the same fork on a different branch). All three now name the held run. Another test checks that another PR's held run doesn't gate this one. All four fail on the previous commit. The file passes 114 tests and CI is green at the new head. One case remains that the run record can't separate: two PRs opened from the same fork branch into different bases. Both have empty |
|
@tend-agent The new scoping still drops held CI when two PRs use the same fork branch against different bases. I reproduced this head's
|
…ld run Two PRs from one fork branch against different bases share head repo, branch and SHA, and GitHub links neither's runs to a PR, so a newer success from the other PR hid this PR's held CI. Runs naming no PR now count when held but never supersede a held run; only a run naming this PR does.
|
Fixed in 53ca32c. A run that names no PR can't be told apart from a sibling PR on the same fork branch, so
|
… bare 'no findings' (#1741) The review skill's check before submitting accepted "no findings" as the second pass's result. Reviews have been passing it without running the pass: they load `/tend-ci-runner:code-review`, take 0–4 tool calls with no angle-by-angle work, and record "no findings". The check now asks what the pass examined: the angles it covered, the candidates each raised with their verdicts (refuted ones included), and the findings that survived. A bare "no findings" no longer counts as running the pass. `code-review` already covers the defects these reviews missed. Angle A says to read each hunk's enclosing function and look for falsy-value checks. Angle C traces how changed code is called and what inputs it can see. Its Output section already tells the caller to report how the pass ran. The defect is in the review skill's compliance check, which a one-line claim satisfies, so this edits that check rather than adding a new rule. Validation: unvalidated by model evals so far. `evals/cases/review-second-pass-falsey-default` is a runnable trajectory case for the failure: it pins #1738 at `21db473` (the head whose review recorded "no findings") with that session's frozen preflight, review-state and CI observations. It expects a `COMMENT` reporting that the new type checks run after `or {}` has already turned `workflows: false` or `secrets: []` into `{}`, and its rubric requires tool events showing the reviewer read or exercised that code in context. `prepare.py` stages it on both arms, and `evals/` pytest, `npm --prefix evals test` and `pre-commit` pass. The blocker for running it: the Codex executor needs a subscription login, and this CI sandbox has none. A filtered `npm --prefix evals run eval -- --filter-pattern "second pass"` errors with `ENOENT ... /home/tend-sandbox/.codex/auth.json`. The Claude harness excludes trajectory cases. To get the before/after comparison, run it locally: `uv run python evals/prepare.py && npm --prefix evals run eval -- --filter-pattern "second pass"`. <details><summary>Evidence from this window's session logs</summary> Tool calls each review session made between loading `code-review` and its next step, from the JSONL logs: | Run | PR | Calls | Outcome | |---|---|---|---| | 45562114460 | #1738 at 21db473 | 0 | "The second review pass found nothing new". `max-sixty` then reported that `or {}` defaulting runs before the new type checks, so `workflows: false` and `secrets: []` still load defaults. The `or {}` line sat directly above the new check in the diff hunk the session read. | | 45352540521 | #1736 at fc70bcf | 2 (an `ls` for instruction files and one grep) | "found nothing". `max-sixty` then reported that the head-SHA runs query lets another PR's successful run hide this PR's held CI. | | 45470428466 | #1736 at e604a49 | 1 (one `sed`) | "every candidate was already handled". It never exercised the same-fork-branch case the fix's fallback gets wrong, which `max-sixty` then reproduced. | | 45473678051 | #1736 at 53ca32c | 4 | "Second pass done with no findings" | The earlier corrections on #1724 (44995176016: 2 calls) and #1730 (45126081051: 1 call) have the same shape. The monthly tracker #1631 records those misses as separate input-enumeration gaps and proposed no fix. This window's logs show they share a cause: the pass didn't run. None of these was a wrong outward action. Every PR was bot-authored under `restricted`, so no approval was possible, and the maintainer caught each defect within minutes. The same nominal pass on a human-authored PR would back an approval. </details> --------- Co-authored-by: tend-agent <[email protected]>
When a fork PR's
pull_requestrun waits for a maintainer to approve it, GitHub concludes the runaction_requiredbefore any job starts, so no check run exists and the commit's status-check rollup never shows it. On such a headpoll-pr-checks approvalsaw only tend-review's own check, filtered it out, and printed a plainapprove:, so the approval went out reading like green CI.pollhad a related gap: a commit whose only checks were external (codecov, apull_request_targetworkflow) would read green while the repo's own CI was held.Both commands now read
GET /repos/{repo}/actions/runs?head_sha=<sha>&event=pull_requestand treat each workflow's latest held run as unverified, named as e.g.ci (awaiting maintainer approval to run) <run url>:approvaladds it to the existingapprove: …; unverified:list, whichreview/references/approving.mdalready tells the session to name in the review body. That reference's list of no-result causes now includes this case.pollreports the commitUNVERIFIED, not green(exit 2) instead of green.Only this PR's runs count: the listing is repository-wide, and two PRs can share a head commit. A run whose
pull_requestsnames the PR is this PR's, and the newest such run of a workflow supersedes an older held one. Fork runs leavepull_requestsempty, and two PRs from one fork branch against different bases share head repository, branch and commit, so a run naming no PR whose head matches (or any, once the fork is deleted) can't be attributed: it counts when held and never supersedes a held run. Runs from other events, like thepull_request_reviewtend-mention-relayruns held on the same PR, don't count, and--skipnames apply to run names too.Against the commit from the report (
max-sixty/cargo-affected1aa9f72), the new helper returnsci (awaiting maintainer approval to run) https://github.com/max-sixty/cargo-affected/actions/runs/45276898167and leaves out the three held relay runs. The new tests intest_poll_scripts.pycover the reported approval, the external-only poll, an approved rerun on a same-repo PR, a skipped run, an unreadable runs listing, and another PR's run on the same commit and workflow (same-repo, other fork, other fork branch, and the same fork branch against another base) that must not supersede or add a held run. The full file passes (115 tests).Closes #1734 — automated triage