From 9f2df920375a7c1a634c80bf6f62f3094afc0840 Mon Sep 17 00:00:00 2001 From: Matt Jarvis Date: Fri, 27 Feb 2026 14:09:44 +0000 Subject: [PATCH 1/3] Prevent workflow cancellation while Terraform holds a state lock. --- .github/workflows/deploy-backend.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/deploy-backend.yml b/.github/workflows/deploy-backend.yml index f67f0b1530..eb9775823b 100644 --- a/.github/workflows/deploy-backend.yml +++ b/.github/workflows/deploy-backend.yml @@ -78,6 +78,9 @@ jobs: run: make init - name: Terraform Plan + # Ignore cancellations to prevent Terraform from being killed while it holds a state lock + # A stuck process can still be killed with the force-cancel API operation + if: ${{ !failure() }} working-directory: infrastructure/instance run: make plan-ci @@ -120,6 +123,9 @@ jobs: run: make init - name: Terraform Apply + # Ignore cancellations to prevent Terraform from being killed while it holds a state lock + # A stuck process can still be killed with the force-cancel API operation + if: ${{ !failure() }} working-directory: infrastructure/instance run: | make apply-ci From 88101ffae73ddde3028471e16db8c39e65182baf Mon Sep 17 00:00:00 2001 From: Matt Jarvis Date: Fri, 27 Feb 2026 14:48:21 +0000 Subject: [PATCH 2/3] Switch to a different approach which still allows manual cancellation. --- .github/workflows/deploy-backend.yml | 6 ------ .github/workflows/pr-deploy-and-test.yml | 14 ++++++++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy-backend.yml b/.github/workflows/deploy-backend.yml index eb9775823b..f67f0b1530 100644 --- a/.github/workflows/deploy-backend.yml +++ b/.github/workflows/deploy-backend.yml @@ -78,9 +78,6 @@ jobs: run: make init - name: Terraform Plan - # Ignore cancellations to prevent Terraform from being killed while it holds a state lock - # A stuck process can still be killed with the force-cancel API operation - if: ${{ !failure() }} working-directory: infrastructure/instance run: make plan-ci @@ -123,9 +120,6 @@ jobs: run: make init - name: Terraform Apply - # Ignore cancellations to prevent Terraform from being killed while it holds a state lock - # A stuck process can still be killed with the force-cancel API operation - if: ${{ !failure() }} working-directory: infrastructure/instance run: | make apply-ci diff --git a/.github/workflows/pr-deploy-and-test.yml b/.github/workflows/pr-deploy-and-test.yml index 76db9846d7..acc204b548 100644 --- a/.github/workflows/pr-deploy-and-test.yml +++ b/.github/workflows/pr-deploy-and-test.yml @@ -4,17 +4,20 @@ on: pull_request: types: [opened, synchronize, reopened] -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: run-quality-checks: + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true uses: ./.github/workflows/quality-checks.yml secrets: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} deploy-pr-backend: + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + # Avoid automatic cancellation while Terraform holds a state lock + cancel-in-progress: false needs: [run-quality-checks] uses: ./.github/workflows/deploy-backend.yml with: @@ -24,6 +27,9 @@ jobs: sub_environment: pr-${{github.event.pull_request.number}} run-e2e-automation-tests: + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true needs: [deploy-pr-backend] strategy: matrix: From 2c69d8c4b769e1789842fbe245398eb7b5d68985 Mon Sep 17 00:00:00 2001 From: Matt Jarvis Date: Fri, 27 Feb 2026 14:57:19 +0000 Subject: [PATCH 3/3] Revert "Switch to a different approach which still allows manual cancellation." This reverts commit 88101ffae73ddde3028471e16db8c39e65182baf. --- .github/workflows/deploy-backend.yml | 6 ++++++ .github/workflows/pr-deploy-and-test.yml | 14 ++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy-backend.yml b/.github/workflows/deploy-backend.yml index f67f0b1530..eb9775823b 100644 --- a/.github/workflows/deploy-backend.yml +++ b/.github/workflows/deploy-backend.yml @@ -78,6 +78,9 @@ jobs: run: make init - name: Terraform Plan + # Ignore cancellations to prevent Terraform from being killed while it holds a state lock + # A stuck process can still be killed with the force-cancel API operation + if: ${{ !failure() }} working-directory: infrastructure/instance run: make plan-ci @@ -120,6 +123,9 @@ jobs: run: make init - name: Terraform Apply + # Ignore cancellations to prevent Terraform from being killed while it holds a state lock + # A stuck process can still be killed with the force-cancel API operation + if: ${{ !failure() }} working-directory: infrastructure/instance run: | make apply-ci diff --git a/.github/workflows/pr-deploy-and-test.yml b/.github/workflows/pr-deploy-and-test.yml index acc204b548..76db9846d7 100644 --- a/.github/workflows/pr-deploy-and-test.yml +++ b/.github/workflows/pr-deploy-and-test.yml @@ -4,20 +4,17 @@ on: pull_request: types: [opened, synchronize, reopened] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: run-quality-checks: - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true uses: ./.github/workflows/quality-checks.yml secrets: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} deploy-pr-backend: - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - # Avoid automatic cancellation while Terraform holds a state lock - cancel-in-progress: false needs: [run-quality-checks] uses: ./.github/workflows/deploy-backend.yml with: @@ -27,9 +24,6 @@ jobs: sub_environment: pr-${{github.event.pull_request.number}} run-e2e-automation-tests: - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true needs: [deploy-pr-backend] strategy: matrix: