Skip self-hosted tests and benchmarks for draft PRs#1262
Conversation
Add `github.event.pull_request.draft != true` condition to the `self` job in both test.yml and bench.yml so that self-hosted runners (Phoenix, Frontier) are not triggered by draft pull requests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo GitHub Actions workflow files are modified to add draft PR filtering. The conditions for the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Poem
✨ 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 |
Claude Code ReviewHead SHA: Files changed: 2
Summary
FindingsNo issues found. The implementation is correct and consistent:
Both changes correctly use Improvement Opportunities
|
|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this comment.
Pull request overview
This PR updates the CI workflow gating to avoid scheduling self-hosted (Phoenix/Frontier) jobs when a pull request is marked as a draft, reducing unnecessary use of scarce runners.
Changes:
- Add a draft-PR check to the
selfjob condition intest.yml. - Add a draft-PR check to the
selfjob condition inbench.yml.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/test.yml | Adds a draft PR guard to skip the self-hosted test matrix for draft PRs. |
| .github/workflows/bench.yml | Adds a draft PR guard to skip the self-hosted benchmark matrix for draft PRs. |
| self: | ||
| name: "${{ matrix.cluster_name }} (${{ matrix.device }}${{ matrix.interface != 'none' && format('-{0}', matrix.interface) || '' }})" | ||
| if: github.repository == 'MFlowCode/MFC' && needs.file-changes.outputs.checkall == 'true' | ||
| if: github.repository == 'MFlowCode/MFC' && needs.file-changes.outputs.checkall == 'true' && github.event.pull_request.draft != true |
There was a problem hiding this comment.
github.event.pull_request.draft is evaluated unconditionally here. On non-pull_request events (e.g., push and workflow_dispatch in this workflow), github.event.pull_request is absent and this can cause expression evaluation failures. Consider guarding the access, e.g. by wrapping it in (github.event.pull_request == null || github.event.pull_request.draft != true) or only checking draft when github.event_name == 'pull_request'.
| if: github.repository == 'MFlowCode/MFC' && needs.file-changes.outputs.checkall == 'true' && github.event.pull_request.draft != true | |
| if: github.repository == 'MFlowCode/MFC' && needs.file-changes.outputs.checkall == 'true' && (github.event_name != 'pull_request' || github.event.pull_request.draft != true) |
| self: | ||
| name: "${{ matrix.name }} (${{ matrix.device }}${{ matrix.interface != 'none' && format('-{0}', matrix.interface) || '' }})" | ||
| if: ${{ github.repository=='MFlowCode/MFC' && needs.file-changes.outputs.checkall=='true' && ((github.event_name=='pull_request_review' && github.event.review.state=='approved') || (github.event_name=='pull_request' && (github.event.pull_request.user.login=='sbryngelson' || github.event.pull_request.user.login=='wilfonba')) || github.event_name=='workflow_dispatch') }} | ||
| if: ${{ github.repository=='MFlowCode/MFC' && needs.file-changes.outputs.checkall=='true' && github.event.pull_request.draft != true && ((github.event_name=='pull_request_review' && github.event.review.state=='approved') || (github.event_name=='pull_request' && (github.event.pull_request.user.login=='sbryngelson' || github.event.pull_request.user.login=='wilfonba')) || github.event_name=='workflow_dispatch') }} |
There was a problem hiding this comment.
This if: now references github.event.pull_request.draft outside of any github.event_name guard. For workflow_dispatch runs there is no pull_request object in the event payload, and accessing github.event.pull_request.draft may fail evaluation. To keep workflow_dispatch working while skipping drafts, guard it with (github.event.pull_request == null || github.event.pull_request.draft != true) or move the draft check inside the pull_request / pull_request_review branches.
| if: ${{ github.repository=='MFlowCode/MFC' && needs.file-changes.outputs.checkall=='true' && github.event.pull_request.draft != true && ((github.event_name=='pull_request_review' && github.event.review.state=='approved') || (github.event_name=='pull_request' && (github.event.pull_request.user.login=='sbryngelson' || github.event.pull_request.user.login=='wilfonba')) || github.event_name=='workflow_dispatch') }} | |
| if: ${{ github.repository=='MFlowCode/MFC' && needs.file-changes.outputs.checkall=='true' && (github.event.pull_request == null || github.event.pull_request.draft != true) && ((github.event_name=='pull_request_review' && github.event.review.state=='approved') || (github.event_name=='pull_request' && (github.event.pull_request.user.login=='sbryngelson' || github.event.pull_request.user.login=='wilfonba')) || github.event_name=='workflow_dispatch') }} |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1262 +/- ##
=======================================
Coverage 44.05% 44.05%
=======================================
Files 70 70
Lines 20496 20496
Branches 1989 1989
=======================================
Hits 9030 9030
Misses 10328 10328
Partials 1138 1138 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
User description
Add
github.event.pull_request.draft != truecondition to theselfjob in both test.yml and bench.yml so that self-hosted runners (Phoenix, Frontier) are not triggered by draft pull requests.CodeAnt-AI Description
Skip self-hosted CI runs for draft pull requests
What Changed
Impact
✅ Fewer self-hosted runner allocations for draft PRs✅ Lower queueing on Phoenix/Frontier runners✅ Faster availability of runners for ready (non-draft) PRs💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
Summary by CodeRabbit