From 5c74e1bee68d904797dd8b92500504d1b2676ea1 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Fri, 13 Mar 2026 13:55:35 +0000 Subject: [PATCH 01/10] CLDC-4263: implement minimal label-based approach --- .github/workflows/review_pipeline.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/review_pipeline.yml b/.github/workflows/review_pipeline.yml index b31f81e23..da45db9b1 100644 --- a/.github/workflows/review_pipeline.yml +++ b/.github/workflows/review_pipeline.yml @@ -9,6 +9,7 @@ on: - opened - synchronize - reopened + - labeled workflow_dispatch: defaults: @@ -18,6 +19,7 @@ defaults: jobs: infra: name: Deploy review app infrastructure + if: contains(github.event.pull_request.labels.*.name, 'deploy-review') uses: communitiesuk/submit-social-housing-lettings-and-sales-data-infrastructure/.github/workflows/create_review_app_infra.yml@main with: key: ${{ github.event.pull_request.number }} @@ -40,6 +42,7 @@ jobs: comment: name: Add link to PR + if: contains(github.event.pull_request.labels.*.name, 'deploy-review') needs: [code] runs-on: ubuntu-latest permissions: From 0372a51938b06f7803b23639ac3638de6d9961d9 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Fri, 13 Mar 2026 14:35:07 +0000 Subject: [PATCH 02/10] CLDC-4263: add descriptive comment --- .github/workflows/review_pipeline.yml | 49 +++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/.github/workflows/review_pipeline.yml b/.github/workflows/review_pipeline.yml index da45db9b1..7d8d38392 100644 --- a/.github/workflows/review_pipeline.yml +++ b/.github/workflows/review_pipeline.yml @@ -17,6 +17,32 @@ defaults: shell: bash jobs: + hint: + name: Add review app hint + if: github.event.action == 'opened' && !contains(github.event.pull_request.labels.*.name, 'deploy-review') + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Comment on PR + uses: actions/github-script@v7 + with: + script: | + const msg = 'To deploy a review app for this PR, add the `deploy-review` label.'; + const { data: comments } = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + }); + if (!comments.find(c => c.body.startsWith('To deploy a review app'))) { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: msg, + }); + } + infra: name: Deploy review app infrastructure if: contains(github.event.pull_request.labels.*.name, 'deploy-review') @@ -51,10 +77,21 @@ jobs: steps: - name: Comment on PR with URL - uses: unsplash/comment-on-pr@v1.3.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: actions/github-script@v7 with: - msg: "Created review app at https://review.submit-social-housing-data.communities.gov.uk/${{ github.event.pull_request.number }}. Note that the review app will be automatically deprovisioned after 30 days and will need the review app pipeline running again." - check_for_duplicate_msg: true - duplicate_msg_pattern: Created review app at* + script: | + const prNumber = context.issue.number; + const msg = `Created review app at https://review.submit-social-housing-data.communities.gov.uk/${prNumber}. Note that the review app will be automatically deprovisioned after 30 days and will need the review app pipeline running again.`; + const { data: comments } = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: prNumber, + }); + if (!comments.find(c => c.body.startsWith('Created review app at'))) { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: prNumber, + body: msg, + }); + } From ee43b3ec76b977f42bb67c1b38707bf670f9ed5d Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Fri, 13 Mar 2026 17:16:54 +0000 Subject: [PATCH 03/10] CLDC-4263: separate comment workflow --- .github/workflows/review_app_hint.yml | 24 ++++++++++++++++++++++++ .github/workflows/review_pipeline.yml | 27 --------------------------- 2 files changed, 24 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/review_app_hint.yml diff --git a/.github/workflows/review_app_hint.yml b/.github/workflows/review_app_hint.yml new file mode 100644 index 000000000..f54cd6345 --- /dev/null +++ b/.github/workflows/review_app_hint.yml @@ -0,0 +1,24 @@ +name: Review app hint + +on: + pull_request: + types: [opened] + +jobs: + hint: + name: Add review app hint + if: "!contains(github.event.pull_request.labels.*.name, 'deploy-review')" + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Comment on PR + uses: actions/github-script@v7 + with: + script: | + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: 'To deploy a review app for this PR, add the `deploy-review` label.', + }); diff --git a/.github/workflows/review_pipeline.yml b/.github/workflows/review_pipeline.yml index 7d8d38392..9344b5e5b 100644 --- a/.github/workflows/review_pipeline.yml +++ b/.github/workflows/review_pipeline.yml @@ -6,7 +6,6 @@ concurrency: on: pull_request: types: - - opened - synchronize - reopened - labeled @@ -17,32 +16,6 @@ defaults: shell: bash jobs: - hint: - name: Add review app hint - if: github.event.action == 'opened' && !contains(github.event.pull_request.labels.*.name, 'deploy-review') - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - name: Comment on PR - uses: actions/github-script@v7 - with: - script: | - const msg = 'To deploy a review app for this PR, add the `deploy-review` label.'; - const { data: comments } = await github.rest.issues.listComments({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - }); - if (!comments.find(c => c.body.startsWith('To deploy a review app'))) { - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: msg, - }); - } - infra: name: Deploy review app infrastructure if: contains(github.event.pull_request.labels.*.name, 'deploy-review') From 939ac9ad5f1a0128729a3c415e3d3d14621ea00d Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Fri, 13 Mar 2026 17:28:56 +0000 Subject: [PATCH 04/10] CLDC-4263: add label check to code workflow --- .github/workflows/review_pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/review_pipeline.yml b/.github/workflows/review_pipeline.yml index 9344b5e5b..79a5ce892 100644 --- a/.github/workflows/review_pipeline.yml +++ b/.github/workflows/review_pipeline.yml @@ -28,6 +28,7 @@ jobs: code: name: Deploy review app code + if: contains(github.event.pull_request.labels.*.name, 'deploy-review') needs: [infra] uses: ./.github/workflows/aws_deploy.yml with: From 03c5dbdde86eadfd2376c0c01decec70f23b52e3 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Fri, 13 Mar 2026 17:44:34 +0000 Subject: [PATCH 05/10] CLDC-4263: always hint initially --- .github/workflows/review_app_hint.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/review_app_hint.yml b/.github/workflows/review_app_hint.yml index f54cd6345..1d01c6572 100644 --- a/.github/workflows/review_app_hint.yml +++ b/.github/workflows/review_app_hint.yml @@ -7,7 +7,6 @@ on: jobs: hint: name: Add review app hint - if: "!contains(github.event.pull_request.labels.*.name, 'deploy-review')" runs-on: ubuntu-latest permissions: pull-requests: write From 09df8ab28f4cd86ca22c32a7abd8450cc379535c Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Mon, 16 Mar 2026 10:28:41 +0000 Subject: [PATCH 06/10] CLDC-4263: copy change test --- app/views/start/index.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/start/index.html.erb b/app/views/start/index.html.erb index 491d68d49..baf13bf17 100644 --- a/app/views/start/index.html.erb +++ b/app/views/start/index.html.erb @@ -4,6 +4,7 @@
+

REMOVE ME

Use this service to submit social housing lettings and sales data to the Ministry of Housing, Communities and Local Government (MHCLG).

We’ll ask you questions about a letting or sale, like details about the household or property. Your answers will create a log that you can submit directly to us.

Your organisation can also set up and manage user accounts.

From b67833ef25fee2b72fc937e67f60eb37f6907a55 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Mon, 16 Mar 2026 11:20:07 +0000 Subject: [PATCH 07/10] Revert "CLDC-4263: copy change test" This reverts commit 09df8ab28f4cd86ca22c32a7abd8450cc379535c. --- app/views/start/index.html.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/views/start/index.html.erb b/app/views/start/index.html.erb index baf13bf17..491d68d49 100644 --- a/app/views/start/index.html.erb +++ b/app/views/start/index.html.erb @@ -4,7 +4,6 @@
-

REMOVE ME

Use this service to submit social housing lettings and sales data to the Ministry of Housing, Communities and Local Government (MHCLG).

We’ll ask you questions about a letting or sale, like details about the household or property. Your answers will create a log that you can submit directly to us.

Your organisation can also set up and manage user accounts.

From 976dc049a94ab6f552f9b1eec5207eda75c414f5 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Mon, 16 Mar 2026 11:58:23 +0000 Subject: [PATCH 08/10] CLDC-4263: rename review app workflows for clarity --- .github/workflows/manual_review_code_pipeline.yml | 2 +- .github/workflows/review_app_hint.yml | 2 +- .github/workflows/review_pipeline.yml | 2 +- .github/workflows/review_teardown_pipeline.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/manual_review_code_pipeline.yml b/.github/workflows/manual_review_code_pipeline.yml index 2ea0719ca..0e4ad747b 100644 --- a/.github/workflows/manual_review_code_pipeline.yml +++ b/.github/workflows/manual_review_code_pipeline.yml @@ -1,4 +1,4 @@ -name: Manual review app code pipeline +name: "Review App: Manual Code Redeploy" concurrency: group: review-${{ inputs.review_app_key }} diff --git a/.github/workflows/review_app_hint.yml b/.github/workflows/review_app_hint.yml index 1d01c6572..d6a936c39 100644 --- a/.github/workflows/review_app_hint.yml +++ b/.github/workflows/review_app_hint.yml @@ -1,4 +1,4 @@ -name: Review app hint +name: "Review App: PR Hint Comment" on: pull_request: diff --git a/.github/workflows/review_pipeline.yml b/.github/workflows/review_pipeline.yml index 79a5ce892..8e4a106b7 100644 --- a/.github/workflows/review_pipeline.yml +++ b/.github/workflows/review_pipeline.yml @@ -1,4 +1,4 @@ -name: Review app pipeline +name: "Review App: Deploy" concurrency: group: review-${{ github.event.pull_request.number }} diff --git a/.github/workflows/review_teardown_pipeline.yml b/.github/workflows/review_teardown_pipeline.yml index 8925b3340..8c2f00b16 100644 --- a/.github/workflows/review_teardown_pipeline.yml +++ b/.github/workflows/review_teardown_pipeline.yml @@ -1,4 +1,4 @@ -name: Review app teardown pipeline +name: "Review App: Teardown" concurrency: group: review-${{ github.event.pull_request.number }} From c15d79b0f80407b530c04157801912a001a5c516 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Mon, 16 Mar 2026 11:59:43 +0000 Subject: [PATCH 09/10] CLDC-4263: remove broken workflow_dispatches --- .github/workflows/production_pipeline.yml | 1 - .github/workflows/review_teardown_pipeline.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/production_pipeline.yml b/.github/workflows/production_pipeline.yml index b4a188415..45a31167f 100644 --- a/.github/workflows/production_pipeline.yml +++ b/.github/workflows/production_pipeline.yml @@ -3,7 +3,6 @@ name: Production CI/CD Pipeline on: release: types: [released] - workflow_dispatch: defaults: run: diff --git a/.github/workflows/review_teardown_pipeline.yml b/.github/workflows/review_teardown_pipeline.yml index 8c2f00b16..d2a49db4e 100644 --- a/.github/workflows/review_teardown_pipeline.yml +++ b/.github/workflows/review_teardown_pipeline.yml @@ -7,7 +7,6 @@ on: pull_request: types: - closed - workflow_dispatch: env: app_repo_role: arn:aws:iam::815624722760:role/core-application-repo From 676a92cbade106e4af1a2211e7964e6d30e46bfe Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Mon, 16 Mar 2026 15:57:38 +0000 Subject: [PATCH 10/10] CLDC-4263: rename label --- .github/workflows/review_app_hint.yml | 2 +- .github/workflows/review_pipeline.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/review_app_hint.yml b/.github/workflows/review_app_hint.yml index d6a936c39..ead73c856 100644 --- a/.github/workflows/review_app_hint.yml +++ b/.github/workflows/review_app_hint.yml @@ -19,5 +19,5 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, - body: 'To deploy a review app for this PR, add the `deploy-review` label.', + body: 'To deploy a review app for this PR, add the `review-app` label.', }); diff --git a/.github/workflows/review_pipeline.yml b/.github/workflows/review_pipeline.yml index 8e4a106b7..c106b7a3c 100644 --- a/.github/workflows/review_pipeline.yml +++ b/.github/workflows/review_pipeline.yml @@ -18,7 +18,7 @@ defaults: jobs: infra: name: Deploy review app infrastructure - if: contains(github.event.pull_request.labels.*.name, 'deploy-review') + if: contains(github.event.pull_request.labels.*.name, 'review-app') uses: communitiesuk/submit-social-housing-lettings-and-sales-data-infrastructure/.github/workflows/create_review_app_infra.yml@main with: key: ${{ github.event.pull_request.number }} @@ -28,7 +28,7 @@ jobs: code: name: Deploy review app code - if: contains(github.event.pull_request.labels.*.name, 'deploy-review') + if: contains(github.event.pull_request.labels.*.name, 'review-app') needs: [infra] uses: ./.github/workflows/aws_deploy.yml with: @@ -42,7 +42,7 @@ jobs: comment: name: Add link to PR - if: contains(github.event.pull_request.labels.*.name, 'deploy-review') + if: contains(github.event.pull_request.labels.*.name, 'review-app') needs: [code] runs-on: ubuntu-latest permissions: