Skip to content

ci: add concurrency control to build workflows#474

Merged
nschimme merged 1 commit intoMUME:masterfrom
nschimme:add-github-actions-concurrency-2301220694189045903
Mar 17, 2026
Merged

ci: add concurrency control to build workflows#474
nschimme merged 1 commit intoMUME:masterfrom
nschimme:add-github-actions-concurrency-2301220694189045903

Conversation

@nschimme
Copy link
Contributor

@nschimme nschimme commented Mar 17, 2026

Add concurrency cancels for GitHub Actions workflows that build on PRs. This ensures that in-progress runs are cancelled when new ones are started for the same branch.

The following workflows were updated:

  • build-appimage.yml
  • build-appx.yml
  • build-flatpak.yml
  • build-release.yml
  • build-snap.yml
  • build-test.yml
  • build-wasm.yml

The build-clang-format.yml workflow was intentionally excluded.

Summary by Sourcery

CI:

  • Configure concurrency groups for PR-triggered build workflows (AppImage, AppX, Flatpak, release, Snap, test, and WASM) with cancel-in-progress enabled to avoid redundant runs.

Add concurrency cancels for GitHub Actions workflows that build on PRs.
This ensures that in-progress runs are cancelled when new ones are started
for the same branch.

The following workflows were updated:
- build-appimage.yml
- build-appx.yml
- build-flatpak.yml
- build-release.yml
- build-snap.yml
- build-test.yml
- build-wasm.yml

The `build-clang-format.yml` workflow was intentionally excluded.
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 17, 2026

Reviewer's Guide

Adds GitHub Actions concurrency settings to all PR/build workflows (except clang-format) so that older runs for the same branch are cancelled when a new run starts.

Sequence diagram for GitHub Actions concurrency cancellation on new PR build

sequenceDiagram
    actor Developer
    participant GitHubRepo
    participant GitHubActions
    participant WorkflowRunOld
    participant WorkflowRunNew

    Developer->>GitHubRepo: push commits to branch
    GitHubRepo-->>GitHubActions: trigger workflow with concurrency_group
    GitHubActions->>WorkflowRunOld: start run (concurrency_group)

    Developer->>GitHubRepo: push new commits to same branch
    GitHubRepo-->>GitHubActions: trigger new workflow with same concurrency_group
    GitHubActions->>WorkflowRunOld: cancel in progress (cancel_in_progress true)
    GitHubActions->>WorkflowRunNew: start new run (same concurrency_group)
Loading

File-Level Changes

Change Details Files
Introduce standardized concurrency configuration to cancel superseded runs on PR/build workflows.
  • Add a top-level concurrency block to each build workflow that defines a group key combining workflow name with either PR head ref or commit SHA, depending on event type.
  • Enable cancel-in-progress: true so that any in-progress run for the same concurrency group is automatically cancelled when a new run is triggered.
  • Apply the same concurrency pattern across all main build workflows while intentionally excluding the clang-format workflow from these changes.
.github/workflows/build-appimage.yml
.github/workflows/build-appx.yml
.github/workflows/build-flatpak.yml
.github/workflows/build-release.yml
.github/workflows/build-snap.yml
.github/workflows/build-test.yml
.github/workflows/build-wasm.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@nschimme nschimme merged commit cd408f4 into MUME:master Mar 17, 2026
18 checks passed
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/build-appimage.yml" line_range="12-14" />
<code_context>
   pull_request:
   workflow_dispatch:

+concurrency:
+  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
+  cancel-in-progress: true
+
 jobs:
</code_context>
<issue_to_address>
**suggestion:** Consider whether you want concurrency to apply to push/workflow_dispatch events as well, not only PRs.

With this `group` expression, PR runs are grouped by `head_ref` and will be cancelled on new pushes to the same PR, but `push`/`workflow_dispatch` runs are grouped by `sha`, so `cancel-in-progress: true` effectively does nothing for them. If you also want cancellation for non-PR runs (e.g., on new commits to the same branch or manual re-runs), consider using `github.ref` or another branch-level identifier instead of `github.sha` for those events.

```suggestion
concurrency:
  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
  cancel-in-progress: true
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +12 to +14
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
Copy link

Choose a reason for hiding this comment

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

suggestion: Consider whether you want concurrency to apply to push/workflow_dispatch events as well, not only PRs.

With this group expression, PR runs are grouped by head_ref and will be cancelled on new pushes to the same PR, but push/workflow_dispatch runs are grouped by sha, so cancel-in-progress: true effectively does nothing for them. If you also want cancellation for non-PR runs (e.g., on new commits to the same branch or manual re-runs), consider using github.ref or another branch-level identifier instead of github.sha for those events.

Suggested change
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
cancel-in-progress: true

@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.52%. Comparing base (26d1a9d) to head (48576db).
⚠️ Report is 216 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #474       +/-   ##
===========================================
- Coverage   66.48%   25.52%   -40.97%     
===========================================
  Files          85      506      +421     
  Lines        4186    41525    +37339     
  Branches      255     4529     +4274     
===========================================
+ Hits         2783    10598     +7815     
- Misses       1403    30927    +29524     

☔ 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant