Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/scripts/test_desktop_swift_ci_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ def test_closed_prs_release_the_same_pr_concurrency_group_without_allocating_a_r
changes = self.jobs["changes"]

self.assertRegex(workflow, r"types:\s*\[[^]]*closed[^]]*\]")
self.assertIn("github.event.action == 'closed' && github.event.pull_request.merged", workflow)
self.assertIn("format('merged-{0}', github.event.pull_request.number)", workflow)
self.assertIn("github.event.pull_request.number || github.sha", workflow)
self.assertIn(
"cancel-in-progress: ${{ github.event_name == 'pull_request' && (github.event.action != 'closed' || !github.event.pull_request.merged) }}",
Expand Down Expand Up @@ -255,7 +257,7 @@ def test_later_main_push_cannot_cancel_exact_sha_release_evidence(self):
# push gets an immutable group and therefore runs its own exact-SHA
# Build & Tests and Release Compile checks to a terminal conclusion.
self.assertIn(
"group: desktop-swift-${{ github.event.pull_request.number || github.sha }}",
"group: desktop-swift-${{ (github.event.action == 'closed' && github.event.pull_request.merged && format('merged-{0}', github.event.pull_request.number)) || github.event.pull_request.number || github.sha }}",
concurrency,
)
self.assertIn(
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/desktop-swift-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
concurrency:
# Supersede stale revisions of the same PR, but never let a later main push
# cancel the exact-SHA evidence consumed by desktop release planning.
group: desktop-swift-${{ github.event.pull_request.number || github.sha }}
group: desktop-swift-${{ (github.event.action == 'closed' && github.event.pull_request.merged && format('merged-{0}', github.event.pull_request.number)) || github.event.pull_request.number || github.sha }}
# An abandoned PR's `closed` run may cancel obsolete work. A merged PR's
# bookkeeping run must not cancel exact-SHA evidence still finishing for the
# merge, so only unmerged closures retain cancellation authority.
Expand Down
Loading