fix: Split concurrency for builds for each branch#297
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Code Review by Qodo
1. PR blocks main deploy
|
| concurrency: | ||
| group: "pages" | ||
| group: "pages-${{ github.head_ref || github.ref_name }}" | ||
| cancel-in-progress: false |
There was a problem hiding this comment.
1. Pr blocks main deploy 🐞 Bug ☼ Reliability
The workflow-wide concurrency key uses github.head_ref for pull_request runs, so a PR whose source branch is named main will share the same group (pages-main) as push-to-main runs and can queue/delay production deployments. Because cancel-in-progress: false, a long PR build can block subsequent main deployments until it completes.
Agent Prompt
## Issue description
The workflow-level `concurrency.group` is derived from `github.head_ref || github.ref_name`, which can produce the same group name for different event types (notably `pull_request` vs `push`). This can cause non-deploying PR runs to block production deploy runs when the PR source branch name matches the protected branch name (e.g., `main`).
## Issue Context
This workflow runs on both `push` to `main` and `pull_request` targeting `main`, but only deploys when `github.ref == 'refs/heads/main'`.
## Fix Focus Areas
- .github/workflows/build-ui.yml[21-23]
## Suggested change
Make the concurrency key unique across event types (or use `github.ref`), e.g.:
- `group: "pages-${{ github.event_name }}-${{ github.head_ref || github.ref_name }}"`
This keeps branch-based grouping while preventing `pull_request` runs from sharing the same key as `push` runs on `main`.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
PR Summary by Qodo
Fix GitHub Pages workflow concurrency to be per-branch
🐞 Bug fix⚙️ Configuration changes🕐 Less than 5 minutesWalkthroughs
Description
Diagram
graph TD A["build-ui workflow"] --> B{"Concurrency group"} --> C["GitHub Pages deploy"] B --> D["Branch/ref name"]High-Level Assessment
The following are alternative approaches to this PR:
1. Use github.workflow + github.ref for grouping
2. Group by environment (e.g., pages-prod vs pages-preview)
Recommendation: Current approach is appropriate: scoping the group to
${{ github.head_ref || github.ref_name }}directly addresses the cross-branch concurrency issue with minimal change. Consider adding${{ github.workflow }}to the group if there is (or will be) more than one workflow deploying to Pages.File Changes
Other (1)