fix(ci): skip the heavy job fan-out for draft pull requests - #6448
Conversation
validate-code, the 6-way validate-tests shard matrix, validate-tests-merge, and security were running their full 11-job fan-out on every draft PR open and push, identical to a ready PR. Combined with the account's shared GitHub-hosted runner pool (already flagged in this file's own comments as capacity-constrained, not billing-constrained), this meaningfully worsens queue contention for every other PR in flight whenever a contributor opens or pushes to a draft -- confirmed via live workflow-run data showing multi-minute gaps between shard start times under load. Each affected job's if-condition now requires the PR not be a draft; push runs are unaffected since github.event.pull_request is unset there. The pull_request trigger now explicitly lists ready_for_review alongside the prior default types, since the default list omits it -- without this, marking a draft ready would silently wait for the next push before CI ran at all.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6448 +/- ##
=======================================
Coverage 95.61% 95.61%
=======================================
Files 598 598
Lines 47308 47310 +2
Branches 15053 15056 +3
=======================================
+ Hits 45233 45235 +2
Misses 1291 1291
Partials 784 784
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-16 08:19:59 UTC
Review summary Nits — 4 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agentDecision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
…farming
Contributors were opening PRs directly as draft (or converting to draft
immediately after opening) to get labels, AI review, and slop-gate feedback
from the bot without ever being subject to a real one-shot disposition --
distinct from the existing reviewEvasionProtection family, which only
enforces after a review has already run against the PR's current head, or
on the 2nd+ ready<->draft conversion.
Adds draftPrClosePolicy ("off" | "close", off by default) as a new
RepositorySettings field (migration + schema + resolver + openapi, mirroring
reviewEvasionProtection's exact wiring) and a new maybeCloseDraftPr guard in
src/queue/review-evasion.ts, closely modeled on the existing draft-conversion
review-evasion guard but firing on ANY draft (opened directly as one, or
converted to one) rather than requiring a prior review pass. Deliberately
does not record a moderation strike -- this is a blanket repo policy against
ordinary GitHub draft usage, not a detected abuse pattern. Enabled for this
repo's own dogfood config (.loopover.yml + the bundled fallback manifest).
Companion to the CI-side fix (JSONbored#6448, merged) that stops the heavy job
fan-out from running on draft PRs in the first place.
Summary
validate-code, the 6-wayvalidate-testsshard matrix,validate-tests-merge, andsecuritywere running their full 11-job fan-out on every draft PR open and push, identical to a ready PR.queued).if:now requires the PR not be a draft; push runs are unaffected (github.event.pull_requestis unset there).pull_requesttrigger now explicitly listsready_for_reviewalongside the prior default types — the default list omits it, so without this change, marking a draft ready would silently wait for the next push before CI ran at all.Test plan
test/unit/ci-skip-draft-prs.test.ts(6 tests) asserting the trigger types and each job's draft-guard conditionnpm run test:ci) green