ci/maintenance-unit-tests: skip draft PRs#910
Conversation
Two coupled changes so the suite runs on PRs that are actually ready
for review and stays out of the way while a contributor is still
iterating in draft mode:
- Add 'ready_for_review' to the pull_request trigger types. Without
it, a PR opened as a draft and later marked ready would never
fire the workflow (no later 'synchronize' guarantees a draft →
ready edge).
- Gate the prepare job on github.event.pull_request.draft != true.
The downstream jobs (gradle-native, gradle-emulated, stop) all
'needs: prepare' so skipping prepare cascades.
For non-PR triggers (schedule, workflow_dispatch, repository_dispatch)
github.event.pull_request is null, draft evaluates to null, and the
condition stays true — the nightly cron and ad-hoc reruns are
unaffected.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
Don't burn CI on PRs that are still in draft. Two coupled tweaks to
.github/workflows/maintenance-unit-tests.yml:Add
ready_for_reviewto thepull_requesttrigger types.Without it, a PR opened as a draft and later marked ready would never fire the workflow — there's no guaranteed
synchronizeedge across the draft → ready transition, so the suite would only run on the next code push.Gate the
preparejob ongithub.event.pull_request.draft != true.The three downstream jobs (
gradle-native,gradle-emulated,stop) allneeds: prepare, so skippingpreparecascades — the whole pipeline becomes a no-op on a draft PR. When the author marks it ready, the newready_for_reviewtrigger fires the suite once.No regression for non-PR triggers
schedule,workflow_dispatch, andrepository_dispatchevents have nopull_requestpayload, sogithub.event.pull_request.draftevaluates tonull. The conditionnull != trueis true, so:workflow_dispatch: still runs.Test plan
preparejob appears asSkipped. Either way, no compute consumed past the trigger.synchronizefires it again.