Skip benchmark workflow for bot review events#1192
Skip benchmark workflow for bot review events#1192sbryngelson merged 3 commits intoMFlowCode:masterfrom
Conversation
Bot reviews (AI code reviewers) trigger pull_request_review events that start a new Benchmark workflow run. The concurrency group then cancels the real benchmark run from the pull_request event, causing all benchmark jobs to be cancelled on every PR with AI reviewers enabled. Fix: skip the workflow early when the review author is a Bot account. Co-Authored-By: Claude Opus 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 · |
|
Warning Rate limit exceeded
⌛ 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. ✨ 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 |
|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this comment.
Pull request overview
Prevents benchmark workloads from being started by bot-authored PR review events (which can interfere with “real” benchmark runs).
Changes:
- Adds a job-level
ifguard to skip thefile-changesjob when the triggering event ispull_request_reviewand the reviewer is a Bot.
Job-level `if` doesn't prevent the workflow run from being created, so the concurrency group still cancels in-progress runs. Fix by giving bot review runs a unique concurrency group (appending run_id) so they can't cancel real benchmark runs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AI reviewer accounts (coderabbitai, copilot-pull-request-reviewer, etc.) are Organization or User type, not Bot. Instead of trying to detect bots, give all pull_request_review runs a unique concurrency group so they never cancel pull_request benchmark runs. The self job's if condition already gates for approved human reviews only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/bench.yml">
<violation number="1" location=".github/workflows/bench.yml:10">
P2: This concurrency group now makes every pull_request_review run unique, so human review approvals won’t cancel the pull_request benchmark run and you can end up running benchmarks twice for the same PR. If the intent is only to avoid bot cancellations, restrict the run_id suffix to bot reviews.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| group: ${{ github.workflow }}-${{ github.ref }}${{ github.event_name == 'pull_request_review' && format('-review-{0}', github.run_id) || '' }} |
There was a problem hiding this comment.
P2: This concurrency group now makes every pull_request_review run unique, so human review approvals won’t cancel the pull_request benchmark run and you can end up running benchmarks twice for the same PR. If the intent is only to avoid bot cancellations, restrict the run_id suffix to bot reviews.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/bench.yml, line 10:
<comment>This concurrency group now makes every pull_request_review run unique, so human review approvals won’t cancel the pull_request benchmark run and you can end up running benchmarks twice for the same PR. If the intent is only to avoid bot cancellations, restrict the run_id suffix to bot reviews.</comment>
<file context>
@@ -7,15 +7,12 @@ on:
concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}${{ github.event_name == 'pull_request_review' && github.event.review.user.type == 'Bot' && format('-bot-{0}', github.run_id) || '' }}
+ group: ${{ github.workflow }}-${{ github.ref }}${{ github.event_name == 'pull_request_review' && format('-review-{0}', github.run_id) || '' }}
cancel-in-progress: true
</file context>
| group: ${{ github.workflow }}-${{ github.ref }}${{ github.event_name == 'pull_request_review' && format('-review-{0}', github.run_id) || '' }} | |
| group: ${{ github.workflow }}-${{ github.ref }}${{ github.event_name == 'pull_request_review' && github.event.review.user.type == 'Bot' && format('-review-{0}', github.run_id) || '' }} |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1192 +/- ##
=======================================
Coverage 44.05% 44.05%
=======================================
Files 70 70
Lines 20498 20498
Branches 1990 1990
=======================================
Hits 9030 9030
Misses 10329 10329
Partials 1139 1139 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
User description
Summary
pull_request_reviewevents that start a new Benchmark workflow runpull_requesteventAdds an
ifcondition on thefile-changesjob to skip the workflow when the review author is a Bot account type.Test plan
pull_requesttrigger🤖 Generated with Claude Code
CodeAnt-AI Description
Skip benchmark workflow when review is from a bot
What Changed
Impact
✅ Fewer cancelled benchmark runs✅ Benchmarks from pull_request triggers complete reliably✅ Reduced wasted CI time💡 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.