From 705b370e230375b91327f5d8f937548e79f59c2a Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sun, 25 Oct 2026 18:22:57 +0000 Subject: [PATCH 1/3] fix(ci): let a push to main finish its Lint and Build runs The concurrency group was the ref, so a second merge to main cancelled the run of the first. Key the group on the sha outside pull requests and cancel only on pull_request. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm --- .gitea/workflows/build.yml | 6 ++++-- .gitea/workflows/lint.yml | 7 ++++--- changelogs/fragments/ci-concurrency-main-runs.yml | 2 ++ 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 changelogs/fragments/ci-concurrency-main-runs.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 762faff..c9d1ce7 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -18,9 +18,11 @@ on: # yamllint disable-line rule:truthy permissions: contents: read +# A newer push to the same pull request cancels the running run; a push to main or a tag +# never cancels another run. concurrency: - group: build-${{ github.ref }} - cancel-in-progress: true + group: build-${{ github.event_name == 'pull_request' && github.ref || github.sha }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: build: diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index c2f3e27..d5e3c3b 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -19,10 +19,11 @@ on: # yamllint disable-line rule:truthy permissions: contents: read -# A newer push to the same ref makes the running lint obsolete. +# A newer push to the same pull request makes the running run obsolete. A push to main or a +# tag is never cancelled: each merge commit keeps its own result. concurrency: - group: lint-${{ github.ref }} - cancel-in-progress: true + group: lint-${{ github.event_name == 'pull_request' && github.ref || github.sha }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: lint: diff --git a/changelogs/fragments/ci-concurrency-main-runs.yml b/changelogs/fragments/ci-concurrency-main-runs.yml new file mode 100644 index 0000000..9c037e5 --- /dev/null +++ b/changelogs/fragments/ci-concurrency-main-runs.yml @@ -0,0 +1,2 @@ +trivial: + - A later push to main no longer cancels the Lint and Build runs of an earlier one; pull request runs still cancel their predecessors. -- 2.43.0 From 3b19cfd65e1edc98e3ea55b74aabaa1696000f0b Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sun, 25 Oct 2026 18:52:57 +0000 Subject: [PATCH 2/3] fix(ci): give tag runs their own concurrency group A tag run and the main run of the same commit shared the group keyed by the commit SHA, so one could wait on the other. Tag runs are now keyed by their ref. Cancellation stays limited to pull requests. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm --- .gitea/workflows/build.yml | 5 +++-- .gitea/workflows/lint.yml | 5 +++-- changelogs/fragments/ci-concurrency-main-runs.yml | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index c9d1ce7..b9ebd24 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -19,9 +19,10 @@ permissions: contents: read # A newer push to the same pull request cancels the running run; a push to main or a tag -# never cancels another run. +# never cancels another run. A tag run has its own group, so it never shares one with the +# main run of the same commit. concurrency: - group: build-${{ github.event_name == 'pull_request' && github.ref || github.sha }} + group: build-${{ github.event_name == 'pull_request' && github.ref || (github.ref_type == 'tag' && github.ref || github.sha) }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index d5e3c3b..3546e2f 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -20,9 +20,10 @@ permissions: contents: read # A newer push to the same pull request makes the running run obsolete. A push to main or a -# tag is never cancelled: each merge commit keeps its own result. +# tag is never cancelled: each merge commit keeps its own result, and a tag run has its own +# group, so it never shares one with the main run of the same commit. concurrency: - group: lint-${{ github.event_name == 'pull_request' && github.ref || github.sha }} + group: lint-${{ github.event_name == 'pull_request' && github.ref || (github.ref_type == 'tag' && github.ref || github.sha) }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: diff --git a/changelogs/fragments/ci-concurrency-main-runs.yml b/changelogs/fragments/ci-concurrency-main-runs.yml index 9c037e5..6fe8632 100644 --- a/changelogs/fragments/ci-concurrency-main-runs.yml +++ b/changelogs/fragments/ci-concurrency-main-runs.yml @@ -1,2 +1,4 @@ trivial: - - A later push to main no longer cancels the Lint and Build runs of an earlier one; pull request runs still cancel their predecessors. + - >- + A later push to main no longer cancels the Lint and Build runs of an earlier one; pull request + runs still cancel their predecessors, and a tag run has its own group. -- 2.43.0 From 39fd0c385ac9b173ef7fa1628295ce73cdd1e9ea Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sun, 25 Oct 2026 19:18:28 +0000 Subject: [PATCH 3/3] fix(ci): drop the dead tag branch from the Lint concurrency group lint.yml has no tag trigger, so the ref_type == 'tag' branch of its concurrency group could never run. Keep it in build.yml, which has one, and correct the comment and changelog fragment accordingly. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm --- .gitea/workflows/lint.yml | 8 ++++---- changelogs/fragments/ci-concurrency-main-runs.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index 3546e2f..944ee2e 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -19,11 +19,11 @@ on: # yamllint disable-line rule:truthy permissions: contents: read -# A newer push to the same pull request makes the running run obsolete. A push to main or a -# tag is never cancelled: each merge commit keeps its own result, and a tag run has its own -# group, so it never shares one with the main run of the same commit. +# A newer push to the same pull request makes the running run obsolete. A push to main is +# never cancelled: each merge commit keeps its own result, so its group is the commit SHA. +# (This workflow has no tag trigger, so no tag branch in the group.) concurrency: - group: lint-${{ github.event_name == 'pull_request' && github.ref || (github.ref_type == 'tag' && github.ref || github.sha) }} + group: lint-${{ github.event_name == 'pull_request' && github.ref || github.sha }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: diff --git a/changelogs/fragments/ci-concurrency-main-runs.yml b/changelogs/fragments/ci-concurrency-main-runs.yml index 6fe8632..9ac883d 100644 --- a/changelogs/fragments/ci-concurrency-main-runs.yml +++ b/changelogs/fragments/ci-concurrency-main-runs.yml @@ -1,4 +1,4 @@ trivial: - >- A later push to main no longer cancels the Lint and Build runs of an earlier one; pull request - runs still cancel their predecessors, and a tag run has its own group. + runs still cancel their predecessors, and in the Build workflow a tag run has its own group. -- 2.43.0