Skip to content

ci: cancel the runs of a pull request's older commits - #1973

Merged
lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:ci/cancel-superseded-pull-request-runs
Nov 12, 2026
Merged

lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:ci/cancel-superseded-pull-request-runs

Conversation

@lagergren

Copy link
Copy Markdown
Collaborator

Each push to a pull request starts three workflows: Java CI with Gradle, Build Plugin zip, and Validate against IJ versions. Each push, and each edit of the PR's title or description, also starts the Conventional Commits check. When a PR got another push, the runs for its older commit kept going, and they waited for the organization's shared runners alongside the new ones. Today, three pushes and two description edits to #1941 left 10 runs queued at once, half of them for a commit that had already been replaced.

Change

  • ci.yml, IJ.yml and buildZip.yml: a concurrency group per workflow and pull request, with cancel-in-progress: true. A new push to a pull request cancels that workflow's runs for the older commits.
  • Pushes to main get a group of their own, from github.run_id. A concurrency group keeps at most one waiting run and cancels any other, so a shared group for main could skip checking some of its commits. With this, every commit on main is still checked.
  • conventionalCheck.yml: a group per pull request. A new push, or an edit of the title, cancels the older check.

release.yml already has its own group and is unchanged.

Checks

  • actionlint finds nothing new. Its only findings are shellcheck notes that main has too.
  • This PR's own runs use the new pull request groups.
  • After the merge, the first runs on main should finish rather than be cancelled.

Each push to a pull request starts the Java CI, Build Plugin zip and
Validate against IJ versions workflows, and each push or edit of its
title the Conventional Commits check. The runs of a superseded commit
kept going, and queued for the shared runners with the new ones.

A concurrency group per workflow and pull request now cancels them. A
push to main gets a group of its own, from its run id, since a group
keeps one pending run only and cancels any other: every commit of main
is still checked.
@lagergren lagergren added this to the 0.30.0 milestone Nov 11, 2026
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Chores
    • Automated build and validation runs now group related pull-request activity and stop older in-progress runs when a newer run starts.
    • Runs without an associated pull request are handled separately, helping keep automated checks current and reducing overlap. These changes affect project automation rather than app features.

Four GitHub Actions workflows add concurrency controls. Runs are grouped by workflow and pull-request number. Three workflows use the run ID when no pull-request number exists. New runs cancel in-progress runs in the same group.

Changes: Workflow concurrency controls

Layer / File(s) Summary
Concurrency groups
.github/workflows/IJ.yml, .github/workflows/buildZip.yml, .github/workflows/ci.yml, .github/workflows/conventionalCheck.yml
The workflows add concurrency groups. IJ, buildZip, and ci use the run ID as a fallback when no pull-request number exists. New runs cancel in-progress runs in the same group.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: Minimal · up to faea2

The change cancels superseded pull request runs and keeps each push to main checked. No actionable merge risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly identifies the main change: cancelling older pull request runs.
Description check Passed The description accurately explains the new concurrency groups, cancellation behavior, main-branch handling, and unchanged release workflow.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 562c59e8-358d-45ed-bb8e-4f933157935d
Commits

Reviewing files that changed from the base of the PR and between ed14f1c and faea2cc.

Files selected for processing: 4

  • .github/workflows/IJ.yml
  • .github/workflows/buildZip.yml
  • .github/workflows/ci.yml
  • .github/workflows/conventionalCheck.yml

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@lagergren lagergren closed this Nov 12, 2026
@lagergren lagergren reopened this Nov 12, 2026
@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.34%. Comparing base (7e638a3) to head (faea2cc).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1973   +/-   ##
=======================================
  Coverage   48.34%   48.34%           
=======================================
  Files         809      809           
  Lines       32527    32527           
  Branches     6631     6631           
=======================================
  Hits        15724    15724           
  Misses      14301    14301           
  Partials     2502     2502           

☔ View full report in Codecov by Harness.
📢 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.

@lagergren
lagergren merged commit a196477 into redhat-developer:main Nov 12, 2026
10 checks passed
lagergren added a commit that referenced this pull request Nov 21, 2026
…it for an edit of the description (#2067)

Fixes #2066.

The *Conventional Commits PR Check* ran for every edit of a pull request, its description included, and since #1973 a newer run cancelled the one in progress. A push followed within seconds by an edit of the description left a cancelled run of `main` on the commit, which GitHub counts as a failed check: the pull request showed a red cross and the merge state `UNSTABLE`, while the other run of the same check passed (#2049, #2053, #2052).

- The workflow has no concurrency group any more, so no run is cancelled. `cancel-in-progress: false` would not be enough: a run that waits in the group is still cancelled when a newer one joins it. The check takes a few seconds.
- The job is skipped for an edit that doesn't change the title (`github.event.changes.title`). A skipped run doesn't count as a failure.

Pushes and title edits run the check as before. The other workflows keep the cancellation of #1973, where it saves runners.

Test: `actionlint` passes. This pull request runs the changed workflow: the check ran and passed when it was opened, and this edit of its description, which changes no title, skips it.
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