Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Plain `APPROVE` and `FIXUP` stay in the overrides unless CI is still running; a

1. **Post the `APPROVE`** as usual — immediately, even while real CI is still running (`ci_pending_held_by_auto_merge`), provided every running check is a required one (auto-merge waits only for those; a running check that is not required keeps the CI gate); for the fixup variant, right after the push ([`disposition-fixup.md`](disposition-fixup.md) step 6).
Failing CI, a rollup green from bot checks only, and workflows waiting for approval still rule it out (Golden rule 8); `ci_action` names the run to approve or re-run first.
A held run that shows up as a pending check that is not required rules it out too, and step 3 cannot release it, because `release-runs` needs an approval: follow `ci_action` and approve it through `pr-management-triage` first.
2. **Refresh the liveness read and re-run `guard`** against the head the approval was made on — save `gql-pr-liveness <N>` again first, so `guard` is not reading the pre-post copy. New commits since → stop; do not enable auto-merge on a head nobody reviewed.
3. **Release held workflow runs at the head.** Auto-merge only works if the required checks run, and a push — the fixup, or a contributor push the guard just saw — can leave the head's runs held in `action_required`.
Read them per head (the repository-wide `runs-action-required` list is capped at 1000 and can miss them):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ uv run --project <framework>/tools/pr-management pr-management triage guard appr
gh api -X POST repos/<upstream>/actions/runs/<run_id>/approve
```

GitHub accepts this only for first-time contributors' runs. A run that answers HTTP 403 *"This workflow run is not waiting for approval"* needs a full re-run instead; one that then answers *"already running"* is done:

```bash
gh run rerun <run_id> --repo <upstream>
```

- `proceed: false` with "already approved" → nothing to do; say so in one line, so the no-op is visible.

No note is posted: CI starting is what the contributor wanted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ def pick(
+ ", ".join(f"`{n}`" for n in pending_not_required)
+ " (not a required check)"
)
# `release-runs` needs an approval, which this gate withholds, so held runs go through triage.
ci_action = (
"wait for those checks; if their runs are waiting for workflow approval, "
"approve them (pr-management-triage); then re-run disposition"
)
elif ci_state == "EXPECTED":
gates.append("CI is waiting for workflow approval — the project's real CI has not run")
ci_action = "approve the waiting workflow runs (pr-management-triage), then re-run disposition"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ def pick(
+ ", ".join(f"`{n}`" for n in pending_not_required)
+ " (not a required check)"
)
# `release-runs` needs an approval, which this gate withholds, so held runs go through triage.
ci_action = (
"wait for those checks; if their runs are waiting for workflow approval, "
"approve them (pr-management-triage); then re-run disposition"
)
elif ci_state == "EXPECTED":
gates.append("CI is waiting for workflow approval — the project's real CI has not run")
ci_action = "approve the waiting workflow runs (pr-management-triage), then re-run disposition"
Expand Down
1 change: 1 addition & 0 deletions tools/pr-management/tests/code_review/test_decisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def test_running_ci_without_auto_merge_still_gates() -> None:
{"ci_state": "EXPECTED"},
{"ci_state": "PENDING", "real_ci": False},
{"ci_state": "SUCCESS", "real_ci": False},
{"ci_state": "PENDING", "pending_not_required": ("Workflow approval",)},
],
)
def test_ci_that_never_ran_names_the_workflow_action(ci: dict[str, Any]) -> None:
Expand Down
Loading