Skip to content

ci: cancel superseded PR runs in presubmit workflows - #9697

Merged
quirogas merged 1 commit into
mainfrom
ci/cancel-superseded-presubmit-runs
Oct 22, 2026
Merged

quirogas merged 1 commit into
mainfrom
ci/cancel-superseded-presubmit-runs

Conversation

@ohmayr

@ohmayr ohmayr commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Context & Problem

breaking-change-check.yaml, generation_check.yaml, and librarian_tidy.yml configure a concurrency group to cancel in-progress runs when a new commit is pushed to the same pull request. However, presubmit.yaml, windows-presubmit.yaml, presubmit-bun.yml, and generator-tests.yaml do not have a concurrency group configured.

As a result, pushing follow-up commits to an open PR (or release-please[bot] updating release-please--branches--main as PRs merge) leaves outdated runs executing in parallel with the latest commit—accounting for ~171 superseded PR runs (~614 obsolete jobs / ~35 runner-hours) over a recent 14-day window.

Summary of Changes

  • Add the standard repository concurrency group (${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}) with cancel-in-progress: true to:
    • .github/workflows/presubmit.yaml
    • .github/workflows/windows-presubmit.yaml
    • .github/workflows/presubmit-bun.yml
  • Add the same concurrency group to .github/workflows/generator-tests.yaml with cancel-in-progress: ${{ github.event_name == 'pull_request' }} so superseded PR runs are cancelled while post-merge push runs on main always run to completion.
  • All workflow names, job names, and required branch-protection status checks remain unchanged.

Verification

  • Validated workflow YAML syntax across all 4 modified files.
  • Verified that presubmit.yaml, windows-presubmit.yaml, and presubmit-bun.yml trigger exclusively on pull_request, and scoped cancel-in-progress in generator-tests.yaml to github.event_name == 'pull_request'.

Configure concurrency groups on presubmit.yaml, windows-presubmit.yaml,
presubmit-bun.yml, and generator-tests.yaml to cancel in-progress runs
when a newer commit is pushed to the same pull request, matching
breaking-change-check.yaml, generation_check.yaml, and
librarian_tidy.yml. Scope cancel-in-progress on generator-tests.yaml to
pull_request events so post-merge push runs on main always complete.
@ohmayr
ohmayr requested a review from a team as a code owner October 22, 2026 00:25
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@github-actions
github-actions Bot requested a review from shivanee-p October 22, 2026 00:25
@quirogas
quirogas merged commit 96926ff into main Oct 22, 2026
46 of 47 checks passed
@quirogas
quirogas deleted the ci/cancel-superseded-presubmit-runs branch October 22, 2026 06:49
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