Skip to content

ci: draft PRs skip the heavy PR workflows (free-tier runner pool saturated by churn WIP pushes) #5104

Closed

Description

@squid-protocol

Problem (owner 2026-10-14): the free-tier runner pool (~20 concurrent jobs on a public repo) is saturated by draft PRs. Churn workers push WIP to their draft PRs about every 30 minutes (so a cut-off loses little), and every push starts the full set of ~25 PR workflows (det-sweep shards, smoke matrix, crucibles, ...). Measured 2026-10-14 11:19Z: 31 runs queued, median queued wait 24 min, max 90 min; 4 of the 11 open PRs were drafts. The PRs that are actually approved (shepherd:merge) wait behind WIP runs nobody needs yet. GitHub has no job priority, so the fix is to keep drafts out of the heavy queue.

concurrency: cancel-in-progress is already on every PR workflow; that only cancels a PR's own superseded runs.

Do:

  1. Every pull_request-triggered workflow except the cheap audits (ruff-audit.yml, mypy-audit.yml, small-audits.yml, answer-key-guard.yml; keep these on drafts) gets types: [opened, synchronize, reopened, ready_for_review] and a job-level if: github.event.pull_request.draft == false on every job (or one gate job the rest needs:), so a draft PR starts no heavy job and ready_for_review starts the full set.
  2. Required status checks must still pass for a ready PR: confirm a skipped job on a draft doesn't satisfy a required check in a way that lets an unreviewed draft merge (the shepherd only merges after shepherd:merge marks it ready, which re-runs everything).
  3. pull_request_target workflows (the shepherd's label events) are unchanged.
  4. A guard test (like test_pipeline_pins.py) that fails when a heavy PR workflow lacks the draft condition, with the cheap-audit allowlist in the test.
  5. docs/ci.md: one paragraph on why drafts skip heavy CI and that ready_for_review (done by the shepherd on shepherd:merge) is what starts it.

Acceptance: pushing to a draft PR starts only the cheap audits; marking it ready starts the full set; the guard test passes; no pull_request_target change.

Workflow edits allowed (owner request 2026-10-14).

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority: highscope:infra

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions