Skip to content

ci/maintenance-unit-tests: skip draft PRs#910

Merged
igorpecovnik merged 1 commit into
mainfrom
unit-tests-skip-drafts
May 10, 2026
Merged

ci/maintenance-unit-tests: skip draft PRs#910
igorpecovnik merged 1 commit into
mainfrom
unit-tests-skip-drafts

Conversation

@igorpecovnik

Copy link
Copy Markdown
Member

Summary

Don't burn CI on PRs that are still in draft. Two coupled tweaks to .github/workflows/maintenance-unit-tests.yml:

  1. 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 — there's no guaranteed synchronize edge across the draft → ready transition, so the suite would only run on the next code push.

  2. Gate the prepare job on github.event.pull_request.draft != true.
    The three downstream jobs (gradle-native, gradle-emulated, stop) all needs: prepare, so skipping prepare cascades — the whole pipeline becomes a no-op on a draft PR. When the author marks it ready, the new ready_for_review trigger fires the suite once.

No regression for non-PR triggers

schedule, workflow_dispatch, and repository_dispatch events have no pull_request payload, so github.event.pull_request.draft evaluates to null. The condition null != true is true, so:

  • nightly cron at 02:00 UTC: still runs.
  • the watchdog rerun: still runs.
  • manual workflow_dispatch: still runs.

Test plan

  • Open a draft PR — workflow either doesn't trigger, or runs and the prepare job appears as Skipped. Either way, no compute consumed past the trigger.
  • Same PR: convert to ready-for-review → workflow fires, full matrix runs.
  • Push another commit on the (now non-draft) PR → synchronize fires it again.
  • Nightly schedule run still goes through unchanged.

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.
@coderabbitai

coderabbitai Bot commented May 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@igorpecovnik has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 34 minutes and 5 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7fd2cebd-49a7-48f7-b23a-0c21b49bfe89

📥 Commits

Reviewing files that changed from the base of the PR and between 5ded5c7 and 2feb47f.

📒 Files selected for processing (1)
  • .github/workflows/maintenance-unit-tests.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch unit-tests-skip-drafts

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added 05 Milestone: Second quarter release size/small PR with less then 50 lines GitHub Actions GitHub Actions code labels May 10, 2026
@igorpecovnik igorpecovnik merged commit ec83e60 into main May 10, 2026
14 of 219 checks passed
@igorpecovnik igorpecovnik deleted the unit-tests-skip-drafts branch May 10, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release GitHub Actions GitHub Actions code size/small PR with less then 50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant