Skip to content

ci: run no CI on draft pull requests - #2130

Open
kanat wants to merge 1 commit into
mainfrom
ci/skip-draft-prs
Open

kanat wants to merge 1 commit into
mainfrom
ci/skip-draft-prs

Conversation

@kanat

@kanat kanat commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Every push to a PR starts CI, and a push to a draft does too. Agents push to drafts many times during review: the author pushes, fixers push, and the base gets merged in. On 2026-11-19, 43 PR branches started 128 CI (unit) runs (median 3 per branch, max 8), and 834 of the 2,925 jobs that day ended cancelled. Bursts of these runs filled the org-wide limit of 60 running jobs (Slack thread in #video-ai, follow-up to #2126).

How it works

push to a PR
├─ PR is a draft        -> each workflow starts, its jobs are skipped (no runner)
└─ PR is ready
   ├─ ready_for_review  -> CI runs once on the head
   └─ each later push   -> CI runs again (cancel-in-progress drops the old run)
push to main            -> unchanged: draft != true holds on a push
Workflow Job given if: github.event.pull_request.draft != true
CI (Go) go
CI (Python) unit (calls run_tests.yml)
CI (SDKs) sdks
CI (client SDKs) changes. kotlin, dart and swift need it, so they skip with it
Integration (router) integration (all 6 groups)
Python compatibility check resolve

Each workflow's pull_request gets types: [opened, synchronize, reopened, ready_for_review]. Without ready_for_review in the list, marking a draft ready would start nothing. The path filters stay as they are: on a pull request they are matched against the whole PR diff, so the ready event starts the workflows the PR touches.

No status check is required on main (the two rulesets require 1 approval and resolved threads, nothing else), so a skipped job blocks no merge.

Changes

  • The six PR workflows above: the types line and the if on their top job.
  • The pr skill: a draft runs no CI, so gh pr ready once the branch is done.

What it does not change

  • CodeQL (3 jobs) and the labeler (1) still run on drafts. CodeQL is the repo's default setup, a setting, not a workflow file.
  • Publish Kotlin SDK is left as it is: its only PR job is skipped unless the branch is release-kotlin-*.

Validation

  • actionlint on the six files: no finding on a changed line.
  • This PR tests itself, since its diff touches all six workflows: opened as a draft, then marked ready. Results in a comment below.

🤖 Generated with Claude Code

Every pull_request workflow now lists ready_for_review in its types and
skips its jobs while the pull request is a draft. CI starts when a pull
request is marked ready and runs on every push after that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kanat
kanat marked this pull request as ready for review November 19, 2026 17:00
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

Six GitHub Actions workflows now listen for ready_for_review events and skip specified jobs when a pull request is a draft. The PR skill documents that draft pull requests run only CodeQL and the labeler, and that marking a pull request ready starts CI.

Merge Risk: Low · up to 87da7

Draft PRs will skip CI as intended and run it once marked ready. The skill note slightly overpromises, since PRs that match no path filter still run no CI. This is a minor documentation fix and not a merge blocker.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 58b951a and 87da79d.

Files selected for processing: 7

  • .claude/skills/pr/SKILL.md
  • .github/workflows/ci-go.yml
  • .github/workflows/ci-python.yml
  • .github/workflows/ci-sdks.yml
  • .github/workflows/client-sdks.yml
  • .github/workflows/integration.yml
  • .github/workflows/python-versions.yml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

## Creating

- Always `gh pr create --draft`. Push the branch first.
- A draft runs no CI, only CodeQL and the labeler. `gh pr ready` starts CI, and every push after it runs CI again, so mark it ready once the branch is done, not before.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Qualify when marking a PR ready starts CI.

The six workflows retain path filters. A PR that changes only this skill file does not match any of them, so gh pr ready starts none of those workflows. State that ready events and later pushes run the workflows only when their filters match. (docs.github.com)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant