From 9486d92368435d88cef4157f9cbedc1a8da5f3ed Mon Sep 17 00:00:00 2001 From: Jeffrey Sica Date: Tue, 29 Sep 2026 16:23:15 -0500 Subject: [PATCH] ci(build): queue main runs instead of cancelling them; upload installer logs A push to main cancelled the in-progress run for the previous merge (#289 cancelled 6d49f9b's run), so that version never released. Only pull requests now cancel superseded runs; main runs queue in the same group. The boot-test log upload also missed dist/dogfood-installer/, so the offline installer test's serial logs were lost on failure. Assisted-by: Claude Opus 5.5 via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build.yml | 5 ++++- tests/unit/test_release_workflow.py | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7460585..85e42934 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,9 +6,11 @@ on: branches: [main] workflow_dispatch: +# Pull requests cancel superseded runs. Pushes to main queue instead: a run +# on main ends in a release, and cancelling it would skip that version. concurrency: group: build-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.event_name == 'pull_request' }} # Least privilege by default: this workflow executes PR-controlled build code # (the Justfile and build scripts come from the PR head), so the workflow-wide @@ -286,6 +288,7 @@ jobs: path: | dist/*/dogfood-*.log dist/dogfood-install/*.log + dist/dogfood-installer/*.log if-no-files-found: ignore retention-days: 7 diff --git a/tests/unit/test_release_workflow.py b/tests/unit/test_release_workflow.py index a258626e..e887d9bf 100644 --- a/tests/unit/test_release_workflow.py +++ b/tests/unit/test_release_workflow.py @@ -8,7 +8,8 @@ import yaml ROOT = Path(__file__).resolve().parents[2] -JOBS = yaml.safe_load((ROOT / ".github" / "workflows" / "build.yml").read_text(encoding="utf-8"))["jobs"] +WORKFLOW = yaml.safe_load((ROOT / ".github" / "workflows" / "build.yml").read_text(encoding="utf-8")) +JOBS = WORKFLOW["jobs"] RELEASE = JOBS["release"] DRY_RUN = JOBS["release-dry-run"] @@ -70,3 +71,15 @@ def test_release_attests_files_and_oci_artifact() -> None: assert RELEASE["permissions"]["id-token"] == "write" assert RELEASE["permissions"]["attestations"] == "write" assert not any("id-token" in (job.get("permissions") or {}) for name, job in JOBS.items() if name != "release") + + +def test_pushes_to_main_never_cancel_a_release_run() -> None: + concurrency = WORKFLOW["concurrency"] + assert concurrency["cancel-in-progress"] == "${{ github.event_name == 'pull_request' }}" + + +def test_boot_test_uploads_every_harness_log_directory() -> None: + upload = next(s for s in WORKFLOW["jobs"]["boot-test"]["steps"] if s.get("name") == "Upload boot logs") + paths = upload["with"]["path"].split() + for d in ("dist/dogfood-install/", "dist/dogfood-installer/"): + assert any(p.startswith(d) for p in paths), d