Skip to content

fix(pr-management-triage): post-filter on conclusion to find action_required runs - #112

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/action-required-filter
May 11, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/action-required-filter

Conversation

@potiuk

@potiuk potiuk commented May 11, 2026

Copy link
Copy Markdown
Member

Summary

The ?status=action_required query parameter on GET /repos/{owner}/{repo}/actions/runs does not return runs awaiting maintainer approval. GitHub returns those runs as status: "completed" with conclusion: "action_required" (the queueing phase is finished, but the run is blocked pending approval).

The triage skill used ?status=action_required in 4 places — none of them returned anything, which let pending_workflow_approval PRs slip through classification as passing and would have caused the mark-ready guard to silently fail-open.

Empirical evidence

Hit live during a triage sweep on apache/airflow today: the mandatory action_required REST index missed 13 pending workflow runs across 4 first-time-contributor PRs (caught by the rollup-pattern Real-CI guard, but only because all 4 had no real CI in the rollup). One of the two mark-ready-classified PRs (#65974) had 3 pending workflow runs at its head SHA — the broken pre-check would have label-added it as ready for review.

Changes

Replace ?status=action_required with ?per_page=N + jq post-filter select(.conclusion == "action_required") in 4 places:

  • fetch-and-batch.md — mandatory per-page REST index
  • actions.md — mark-ready pre-mutation guard
  • actions.md — mark-ready-with-ping pre-mutation guard
  • actions.md — approve-workflow recipe (used to discover the run IDs to approve)

Add explanatory text in fetch-and-batch.md and inline comments in the recipes so a future reader doesn't reintroduce the broken filter.

The gh api -X POST .../approve mutation itself works against runs in this state (verified: 16 successful approvals during the same triage sweep) — only the discovery query was broken.

Test plan

  • Visual diff review — all 4 buggy uses replaced; explanatory text only references the broken filter to warn against it
  • prek run --files passes (markdownlint, skill-validate, etc.)
  • Verified the corrected jq filter returns the expected runs against apache/airflow (16 runs across 5 PRs)

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7)

Generated-by: Claude Code (Opus 4.7) following the guidelines

…equired runs

The `?status=action_required` query parameter on the Actions runs
REST endpoint does not match runs awaiting maintainer approval.
GitHub returns those runs as `status: "completed"` with
`conclusion: "action_required"`, so `?status=action_required`
silently returns an empty result.

Replace the broken filter in all four places it was used
(`fetch-and-batch.md` mandatory index + three recipes in
`actions.md`) with `?per_page=N` and a jq post-filter on
`conclusion`. Add explanatory text in fetch-and-batch.md and
inline comments in the recipes so a future reader does not
reintroduce the broken filter.

The `gh api -X POST .../approve` mutation itself works fine
against runs in this state — only the discovery queries were
broken.
@potiuk
potiuk merged commit 1445c52 into apache:main May 11, 2026
12 checks passed
@potiuk

potiuk commented May 11, 2026

Copy link
Copy Markdown
Member Author

Found during testing with steward adopted in Airflow :)

@zeroshade zeroshade mentioned this pull request Oct 13, 2026
4 of 5 tasks
@potiuk potiuk added capability:triage Sweep + classify + propose disposition family:pr-management pr-management-* skills labels Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:triage Sweep + classify + propose disposition family:pr-management pr-management-* skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant