Skip to content

Comments

Skip self-hosted tests and benchmarks for draft PRs#1262

Merged
sbryngelson merged 1 commit intomasterfrom
draft
Feb 25, 2026
Merged

Skip self-hosted tests and benchmarks for draft PRs#1262
sbryngelson merged 1 commit intomasterfrom
draft

Conversation

@sbryngelson
Copy link
Member

@sbryngelson sbryngelson commented Feb 25, 2026

User description

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.


CodeAnt-AI Description

Skip self-hosted CI runs for draft pull requests

What Changed

  • Self-hosted test and benchmark jobs no longer run for draft pull requests; workflows now require the PR to be non-draft before allocating Phoenix/Frontier runners.
  • Other trigger conditions (approved reviews, specific user PRs, workflow dispatch) remain unchanged.

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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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

  • Chores
    • Updated CI/CD pipelines to skip benchmark and test runs on draft pull requests, improving resource efficiency during development.

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>
Copilot AI review requested due to automatic review settings February 25, 2026 00:57
@codeant-ai
Copy link
Contributor

codeant-ai bot commented Feb 25, 2026

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 ·
Reddit ·
LinkedIn

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c89a491 and 5267695.

📒 Files selected for processing (2)
  • .github/workflows/bench.yml
  • .github/workflows/test.yml

📝 Walkthrough

Walkthrough

Two GitHub Actions workflow files are modified to add draft PR filtering. The conditions for the self job in both bench.yml and test.yml now include a guard requiring github.event.pull_request.draft != true, preventing benchmark and test workflows from running on draft pull requests.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow Guards
.github/workflows/bench.yml, .github/workflows/test.yml
Added github.event.pull_request.draft != true condition to the self job's conditional logic to prevent workflow execution on draft pull requests.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

size:L

Poem

🐰 A rabbit hops through draft PR land,
With benchmarks halted, tests stayed bland,
No rushing workflows, not just yet—
When drafts are ready, then we'll test!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch draft

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.

@sbryngelson sbryngelson merged commit 29f0da5 into master Feb 25, 2026
29 of 34 checks passed
@sbryngelson sbryngelson deleted the draft branch February 25, 2026 00:58
@github-actions
Copy link

Claude Code Review

Head SHA: 52676951e2181af917ef0e83c5f4658ebb40f1b2

Files changed: 2

  • .github/workflows/bench.yml
  • .github/workflows/test.yml

Summary

  • Adds github.event.pull_request.draft != true guard to the self job in both test.yml and bench.yml
  • Prevents self-hosted runners (Phoenix, Frontier HPC clusters) from being triggered by draft PRs, saving scarce compute resources
  • Change is minimal, focused, and correctly placed in both workflow files

Findings

No issues found. The implementation is correct and consistent:

  1. bench.yml (line 31): Condition added inside the existing ${{ }} expression block, consistent with the surrounding style (no quotes around true, consistent with other conditions in the expression).

  2. test.yml (line 154): Condition added to the bare if: expression (no ${{ }} wrapper), also consistent with the surrounding style.

Both changes correctly use != true rather than == false, which handles the case where github.event.pull_request.draft is null (e.g., on workflow_dispatch events) — a null value is not equal to true, so the condition correctly allows non-PR dispatch events through.

Improvement Opportunities

  • Consistency (minor): bench.yml uses ${{ }} wrapper while test.yml does not — but both were already inconsistent before this PR, so no action needed here.
  • workflow_dispatch path (informational): On workflow_dispatch, github.event.pull_request is absent/null, so .draft will be null, and null != true evaluates to true — self-hosted jobs will still run as expected for manual dispatches. No issue.

@codeant-ai codeant-ai bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Feb 25, 2026
@codeant-ai
Copy link
Contributor

codeant-ai bot commented Feb 25, 2026

CodeAnt AI finished reviewing your PR.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 self job condition in test.yml.
  • Add a draft-PR check to the self job condition in bench.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
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

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'.

Suggested change
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)

Copilot uses AI. Check for mistakes.
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') }}
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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') }}

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.05%. Comparing base (df28255) to head (5267695).
⚠️ Report is 20 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Development

Successfully merging this pull request may close these issues.

1 participant