diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0f4889ad..75ee73274 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,9 +10,20 @@ on: permissions: {} +# A pull request supersedes itself: a new push means the previous run is +# answering a question nobody is asking any more. +# +# A run on `testing` does not. It is the run that produces the images, and the +# one that dispatches the ISO end-to-end validation the release gate reads. When +# two land close together the older one is killed mid-build and its E2E +# dispatch dies with it -- which is why the promotion gate keeps reporting +# E2E_LAST_STATUS: skipped and refusing to promote. On 2026-09-19 two testing +# builds were cancelled within two minutes of each other (runs at 11:09 and +# 11:11), and the promotion that followed was blocked for want of the evidence +# they would have produced. concurrency: group: utah-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: # Resolve the complete transaction against the same pinned inputs as the diff --git a/tests/test_iso_ci.py b/tests/test_iso_ci.py index b0f35a9aa..f04a67e46 100644 --- a/tests/test_iso_ci.py +++ b/tests/test_iso_ci.py @@ -419,3 +419,26 @@ def test_a_cache_hit_still_reports_the_image_as_available(self): if s.get("id") == "cache") hit = step["run"].index("Cache hit") self.assertIn("available=true", step["run"][hit:hit + 200]) + +class ConcurrencyTests(unittest.TestCase): + """A testing build must not be cancelled by the next one. + + build.yml on `testing` is what produces the images and dispatches the ISO + end-to-end validation the release gate reads. Cancelling it throws away the + evidence: on 2026-09-19 two testing builds were cancelled within two minutes + (11:09 and 11:11) and the promotion that followed failed with + E2E_LAST_STATUS: skipped. + """ + + def test_only_pull_requests_are_cancelled(self): + import yaml + build = yaml.safe_load((ROOT / ".github/workflows/build.yml").read_text()) + self.assertEqual(build["concurrency"]["cancel-in-progress"], + "${{ github.event_name == 'pull_request' }}") + + def test_the_group_still_separates_refs(self): + # Sharing one group across refs would make a testing build queue behind + # an unrelated PR's. + import yaml + build = yaml.safe_load((ROOT / ".github/workflows/build.yml").read_text()) + self.assertIn("github.ref", build["concurrency"]["group"])