From cc5c14a179120e58515180ca131e2c36dd37e72d Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sat, 5 Sep 2026 12:53:57 +0900 Subject: [PATCH 1/2] fix(actions): avoid inactive PR runs --- .github/workflows/ci.yml | 8 ++++---- .../tests/test_workflow_concurrency_contract.py | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84e52aa..1cc4bcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: push: branches: [main] pull_request: - types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, closed] + types: [opened, synchronize, reopened, ready_for_review] # Cancel superseded evidence for the same pull request or branch. This keeps the # runner queue bounded during review-fix loops while preserving the newest head. @@ -18,7 +18,7 @@ permissions: jobs: account-unification-tests: - if: ${{ github.event_name != 'pull_request' || (github.event.action != 'closed' && github.event.pull_request.draft == false) }} + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} runs-on: ubuntu-latest defaults: run: @@ -51,7 +51,7 @@ jobs: run: uv build --out-dir dist realm-config-validates: - if: ${{ github.event_name != 'pull_request' || (github.event.action != 'closed' && github.event.pull_request.draft == false) }} + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -71,7 +71,7 @@ jobs: PY compose-config-validates: - if: ${{ github.event_name != 'pull_request' || (github.event.action != 'closed' && github.event.pull_request.draft == false) }} + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/services/account_unification/tests/test_workflow_concurrency_contract.py b/services/account_unification/tests/test_workflow_concurrency_contract.py index 116062f..1226b7a 100644 --- a/services/account_unification/tests/test_workflow_concurrency_contract.py +++ b/services/account_unification/tests/test_workflow_concurrency_contract.py @@ -18,16 +18,15 @@ def test_ci_cancels_only_superseded_heads_from_the_same_pull_request() -> None: assert "cancel-in-progress: ${{ github.event_name == 'pull_request' }}" in workflow -def test_ci_skips_draft_and_closed_pull_requests() -> None: +def test_ci_admits_only_useful_pull_request_events_and_skips_drafts() -> None: workflow = (WORKFLOWS / "ci.yml").read_text(encoding="utf-8") - assert ( - "types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, closed]" - in workflow - ) + assert "types: [opened, synchronize, reopened, ready_for_review]" in workflow + assert "converted_to_draft" not in workflow + assert "closed" not in workflow admission = ( "if: ${{ github.event_name != 'pull_request' || " - "(github.event.action != 'closed' && github.event.pull_request.draft == false) }}" + "github.event.pull_request.draft == false }}" ) assert workflow.count(admission) == 3 From 3674a77ab24ff03be04b9d920d01b6ef7e81b240 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sat, 5 Sep 2026 13:05:34 +0900 Subject: [PATCH 2/2] revert(actions): preserve lifecycle cancellation --- .github/workflows/ci.yml | 8 ++++---- .../tests/test_workflow_concurrency_contract.py | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cc4bcd..84e52aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: push: branches: [main] pull_request: - types: [opened, synchronize, reopened, ready_for_review] + types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, closed] # Cancel superseded evidence for the same pull request or branch. This keeps the # runner queue bounded during review-fix loops while preserving the newest head. @@ -18,7 +18,7 @@ permissions: jobs: account-unification-tests: - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} + if: ${{ github.event_name != 'pull_request' || (github.event.action != 'closed' && github.event.pull_request.draft == false) }} runs-on: ubuntu-latest defaults: run: @@ -51,7 +51,7 @@ jobs: run: uv build --out-dir dist realm-config-validates: - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} + if: ${{ github.event_name != 'pull_request' || (github.event.action != 'closed' && github.event.pull_request.draft == false) }} runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -71,7 +71,7 @@ jobs: PY compose-config-validates: - if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} + if: ${{ github.event_name != 'pull_request' || (github.event.action != 'closed' && github.event.pull_request.draft == false) }} runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/services/account_unification/tests/test_workflow_concurrency_contract.py b/services/account_unification/tests/test_workflow_concurrency_contract.py index 1226b7a..116062f 100644 --- a/services/account_unification/tests/test_workflow_concurrency_contract.py +++ b/services/account_unification/tests/test_workflow_concurrency_contract.py @@ -18,15 +18,16 @@ def test_ci_cancels_only_superseded_heads_from_the_same_pull_request() -> None: assert "cancel-in-progress: ${{ github.event_name == 'pull_request' }}" in workflow -def test_ci_admits_only_useful_pull_request_events_and_skips_drafts() -> None: +def test_ci_skips_draft_and_closed_pull_requests() -> None: workflow = (WORKFLOWS / "ci.yml").read_text(encoding="utf-8") - assert "types: [opened, synchronize, reopened, ready_for_review]" in workflow - assert "converted_to_draft" not in workflow - assert "closed" not in workflow + assert ( + "types: [opened, synchronize, reopened, ready_for_review, converted_to_draft, closed]" + in workflow + ) admission = ( "if: ${{ github.event_name != 'pull_request' || " - "github.event.pull_request.draft == false }}" + "(github.event.action != 'closed' && github.event.pull_request.draft == false) }}" ) assert workflow.count(admission) == 3