Skip to content

Conversation

@frankbria
Copy link
Owner

@frankbria frankbria commented Jan 28, 2026

Summary

Add concurrency control to all review workflows to prevent duplicate runs when PRs are updated rapidly or multiple comments are posted in quick succession.

Changes

Added concurrency blocks to:

Workflow Concurrency Group
opencode-review.yml opencode-review-{PR#}
claude-code-review.yml claude-code-review-{PR#}
claude.yml claude-{issue/PR#}

Behavior

When a new workflow run starts for the same PR/issue:

  • cancel-in-progress: true - Cancels any currently running workflow for that PR/issue
  • Prevents duplicate reviews and wasted compute time
  • Ensures only the most recent code is reviewed

Test Plan

  • Syntax validated (YAML is valid)
  • Test by rapidly pushing commits to a PR

Summary by CodeRabbit

  • Chores
    • Optimized automated review workflows to prevent duplicate reviews and responses on pull requests.

✏️ Tip: You can customize this high-level summary in your review settings.

Add concurrency control to all review workflows:
- opencode-review.yml: Cancel in-progress for same PR
- claude-code-review.yml: Cancel in-progress for same PR
- claude.yml: Cancel in-progress for same issue/PR

This prevents duplicate reviews when PRs are updated rapidly
or multiple comments are posted in quick succession.
@coderabbitai
Copy link

coderabbitai bot commented Jan 28, 2026

Walkthrough

Three GitHub Actions workflows are updated to add concurrency blocks that cancel in-progress runs for the same pull request or issue, preventing duplicate automated reviews and responses from being triggered simultaneously.

Changes

Cohort / File(s) Summary
GitHub Actions Concurrency Configuration
.github/workflows/claude-code-review.yml, .github/workflows/claude.yml, .github/workflows/opencode-review.yml
Added concurrency block to each workflow to prevent duplicate runs. Each workflow now cancels in-progress runs for the same PR/issue using group keys like claude-code-review-${{ github.event.pull_request.number }} with cancel-in-progress: true. No changes to job steps or trigger logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Three workflows dance in harmony now,
No duplicate runs shall we allow,
With concurrency blocks standing guard so true,
One review per PR—that's our debut!
Cancel the old, embrace the new. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately describes the main change: adding concurrency blocks to workflow files to prevent duplicate runs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/workflow-concurrency

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

@macroscopeapp
Copy link
Contributor

macroscopeapp bot commented Jan 28, 2026

Add concurrency groups with cancel-in-progress to GitHub Actions workflows to prevent duplicate runs for PRs and issues

Add concurrency blocks keyed by PR or issue number with cancel-in-progress: true across review and Claude workflows.

📍Where to Start

Start with the concurrency configuration in .github/workflows/claude.yml.


Macroscope summarized 1be9684.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/claude.yml:
- Around line 13-17: The current concurrency block uses a fixed group key
"claude-${{ github.event.issue.number || github.event.pull_request.number }}"
which causes new comment events to cancel in‑progress Claude runs; update the
group to be unique for events that do not actually invoke Claude by conditioning
on the comment body or comment id. Modify the concurrency.group expression (the
concurrency and cancel-in-progress entries) to include a conditional: if the
event contains an invocation marker (e.g., contains(github.event.comment.body,
'@claude') or a similar trigger check) use the existing issue/PR-based group,
otherwise append the comment id (github.event.comment.id) or unique suffix so
non-invoking comments do not collide and cancel active runs.

@frankbria frankbria merged commit 0bd260d into main Jan 28, 2026
6 of 8 checks passed
@frankbria frankbria deleted the fix/workflow-concurrency branch January 28, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants