Repository navigation
shepherd: a dropped head goes back to draft, so fix rounds run cheap audits only (Part of #6278) - #6972
Merged
Conversation
…audits only (Part of #6278) When a push moves a labelled PR to an unapproved head, the shepherd now also converts it to a draft and cancels that head's in-flight heavy pull_request runs (everything outside CHEAP_ON_DRAFT, the #5104 allowlist, now shared with test_workflow_draft_gate.py). Re-adding shepherd:merge marks it ready, which starts the full set once. No infra/flake rerun while a draft (a rerun replays draft=false). Replay over 40 merged PRs in docs/ci.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
No description provided. |
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #6278 (item 6: intermediate pushes run cheap gates only; heavy jobs run once the PR carries
shepherd:merge).Checklist: done [c:c1b5ac83]
What changes
The #5104 draft rule already keeps heavy
pull_requestworkflows off drafts, and churn PRs stay drafts until the shepherd marks them ready onshepherd:merge. The hole: once a PR is ready, a fix-round push dropsshepherd:merge, but the PR stays ready, so every later push runs the full heavy set (det, db2, ground-truth, equivalence-e2e, smoke, ...) on heads nobody can merge yet.tests/tools/shepherd_gh.py: whendecide()dropsshepherd:mergefrom a non-draft PR, it also emits adraftop.apply()runsgh pr ready --undoand cancels that head's incompletepull_requestruns outsideCHEAP_ON_DRAFT, so the heavy jobs already started stop too (the drop runs on thesynchronizepass, seconds after the push). Re-adding the label goes through the existingreadyop, so the full set runs once, on the head that will merge. While the PR is a draft, the shepherd does not rerun infra or flake failures: a rerun replays the old event (draft == false) and would start the heavy jobs again.CHEAP_ON_DRAFTis the ci: draft PRs skip the heavy PR workflows (free-tier runner pool saturated by churn WIP pushes) #5104 allowlist (ruff, mypy, small-audits, answer-key-guard).tests/core_engine/test_workflow_draft_gate.pynow imports it, so the cancel list and the draft gate cannot drift apart.docs/ci.md: the rule, the replay, and the "Left under CI cost: one change classifier so each PR runs only the jobs and tests it can affect (docs, ground-truth, det/db2, suite, re-runs) #6278" line.No required check is weakened. A draft cannot merge, and a ready PR (labelled or not) still runs everything. No workflow
if:reads a label, so a hand-merged PR is never green on skipped checks. Noshepherd-*.ymledits; the shepherd's app token already marks PRs ready and reruns runs, which are the same permissions convert-to-draft and cancel need.Measurement (replay, 40 newest merged PRs)
Method: for each PR head, take the
pull_requestruns outside the cheap audits and sum job minutes, each rounded up. A head counts as approved ifshepherd:mergewas added while it was the head, or if it is the merged head.Class / Sibling gaps
Class: heavy CI spent on a PR head nobody can merge yet.
shepherd:fulldet rerun: writer-only, deliberate.Sibling gaps (not filed):
cancelledchecks until the ready run supersedes them (pr_check.classifytakes the newest deciding run per name). If a workflow does not fire onready_for_review, its stale cancelled check would read as infra and be rerun once the PR is ready.test_workflow_draft_gate.pyrequiresready_for_reviewon every heavy workflow, so this is not reachable today.cancel-in-progresson PR runs keep running a superseded head's jobs after a fresh push (separate CI cost: one change classifier so each PR runs only the jobs and tests it can affect (docs, ground-truth, det/db2, suite, re-runs) #6278 slice, not swept here).Remaining slices
Gates
pytest tests/tools/test_shepherd_gh.py tests/core_engine/test_workflow_draft_gate.py: 201 passed (draft gate also run from /tmp: 32 passed)audit_check.py: all clear (ruff baseline, format, mypy, dead-key, ast-accuracy)pr_gates.py --fast(heavy-run, on the pushed HEAD): 9/9 gates passCross-repo
None: engine-repo shepherd tooling only.
🤖 Generated with Claude Code