Skip to content

Commit c08035a

Browse files
Merge remote-tracking branch 'origin/main' into feature/CCM-16035
2 parents 37e3389 + 830c5ba commit c08035a

26 files changed

Lines changed: 428 additions & 37 deletions

.github/scripts/dispatch_internal_repo_workflow.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ while [[ $# -gt 0 ]]; do
104104
version="$2"
105105
shift 2
106106
;;
107+
--tableName) # Table name (optional)
108+
tableName="$2"
109+
shift 2
110+
;;
111+
--force) # Force apply flag (optional)
112+
force="$2"
113+
shift 2
114+
;;
107115
*)
108116
echo "[ERROR] Unknown argument: $1"
109117
exit 1
@@ -202,6 +210,14 @@ if [[ -z "$version" ]]; then
202210
version=""
203211
fi
204212

213+
if [{ -z "$tableName" }]; then
214+
tableName=""
215+
fi
216+
217+
if [[ -z "$force" ]]; then
218+
force=""
219+
fi
220+
205221
echo "==================== Workflow Dispatch Parameters ===================="
206222
echo " infraRepoName: $infraRepoName"
207223
echo " releaseVersion: $releaseVersion"
@@ -221,6 +237,8 @@ echo " apimEnvironment: $apimEnvironment"
221237
echo " boundedContext: $boundedContext"
222238
echo " targetDomain: $targetDomain"
223239
echo " version: $version"
240+
echo " tableName: $tableName"
241+
echo " force: $force"
224242

225243
DISPATCH_EVENT=$(jq -ncM \
226244
--arg infraRepoName "$infraRepoName" \
@@ -240,6 +258,8 @@ DISPATCH_EVENT=$(jq -ncM \
240258
--arg boundedContext "$boundedContext" \
241259
--arg targetDomain "$targetDomain" \
242260
--arg version "$version" \
261+
--arg tableName "$tableName" \
262+
--arg force "$force" \
243263
'{
244264
"ref": "'"$internalRef"'",
245265
"inputs": (
@@ -255,6 +275,8 @@ DISPATCH_EVENT=$(jq -ncM \
255275
(if $boundedContext != "" then { "boundedContext": $boundedContext } else {} end) +
256276
(if $targetDomain != "" then { "targetDomain": $targetDomain } else {} end) +
257277
(if $version != "" then { "version": $version } else {} end) +
278+
(if $tableName != "" then { "tableName": $tableName } else {} end) +
279+
(if $force != "" then { "force": $force } else {} end) +
258280
(if $targetAccountGroup != "" then { "targetAccountGroup": $targetAccountGroup } else {} end) +
259281
{
260282
"releaseVersion": $releaseVersion,
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "4. PR Title Check"
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize, edited]
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
check-pr-title:
14+
name: "Check PR title"
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: "Check PR title format"
18+
uses: NHSDigital/nhs-notify-shared-modules/.github/actions/check-pr-title-format@4e781d1d72739015821a380871aa5a66d070177c # 3.1.0
19+
with:
20+
title: ${{ github.event.pull_request.title }}

.github/workflows/stage-3-build.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,34 @@ jobs:
162162
--terraformAction "apply" \
163163
--overrideProjectName "nhs" \
164164
--overrideRoleName "nhs-main-acct-supplier-api-github-deploy"
165+
populate-config:
166+
name: "Populate Supplier Config"
167+
runs-on: ubuntu-latest
168+
needs: [pr-create-dynamic-environment]
169+
timeout-minutes: 10
170+
171+
steps:
172+
- name: "Checkout code"
173+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
174+
- name: Set Environment Name
175+
id: set-environment
176+
run: echo "environment_name=${{ inputs.pr_number != '' && format('pr{0}', inputs.pr_number) || 'main' }}" >> $GITHUB_OUTPUT
177+
- name: "Trigger populate config workflow in internal repo"
178+
env:
179+
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
180+
APP_PEM_FILE: ${{ secrets.APP_PEM_FILE }}
181+
PR_NUMBER: ${{ inputs.pr_number }}
182+
shell: bash
183+
run: |
184+
.github/scripts/dispatch_internal_repo_workflow.sh \
185+
--infraRepoName "$(echo ${{ github.repository }} | cut -d'/' -f2)" \
186+
--releaseVersion ${{ github.head_ref || github.ref_name }} \
187+
--targetWorkflow "publish-supplier-config.yaml" \
188+
--targetEnvironment "${{ steps.set-environment.outputs.environment_name }}" \
189+
--targetComponent "config" \
190+
--targetAccountGroup "nhs-notify-suppliers-dev" \
191+
--tableName "supplier-config" \
192+
--force "true"
165193
artefact-proxies:
166194
name: "Build proxies"
167195
runs-on: ubuntu-latest
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"campaignIds": [
3+
"client1-campaign"
4+
],
5+
"clientId": "client1",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 3
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 6
26+
}
27+
},
28+
"description": "Colour printing, campaign envelope, Attachment",
29+
"id": "client1-campaign",
30+
"name": "Client1 - campaign",
31+
"packSpecificationIds": [
32+
"client1-campaign"
33+
],
34+
"status": "INT",
35+
"type": "STANDARD",
36+
"volumeGroupId": "volumeGroup-test3"
37+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"constraints": {
3+
"blackCoveragePercentage": {
4+
"operator": "LESS_THAN",
5+
"value": 20
6+
},
7+
"deliveryDays": {
8+
"operator": "LESS_THAN",
9+
"value": 3
10+
},
11+
"sheets": {
12+
"operator": "LESS_THAN",
13+
"value": 5
14+
},
15+
"sides": {
16+
"operator": "LESS_THAN",
17+
"value": 10
18+
}
19+
},
20+
"description": "Dev test variant for happy path testing",
21+
"id": "notify-standard-test1",
22+
"name": "Dev Happy Path",
23+
"packSpecificationIds": [
24+
"notify-c5",
25+
"notify-c4"
26+
],
27+
"status": "PROD",
28+
"type": "STANDARD",
29+
"volumeGroupId": "volumeGroup-test1"
30+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"constraints": {
3+
"blackCoveragePercentage": {
4+
"operator": "LESS_THAN",
5+
"value": 20
6+
},
7+
"deliveryDays": {
8+
"operator": "LESS_THAN",
9+
"value": 3
10+
},
11+
"sheets": {
12+
"operator": "LESS_THAN",
13+
"value": 5
14+
},
15+
"sides": {
16+
"operator": "LESS_THAN",
17+
"value": 10
18+
}
19+
},
20+
"description": "Black printing, economy postage tariff",
21+
"id": "notify-standard",
22+
"name": "Standard Letter",
23+
"packSpecificationIds": [
24+
"notify-c5"
25+
],
26+
"status": "PROD",
27+
"type": "STANDARD",
28+
"volumeGroupId": "volumeGroup-test2"
29+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"assembly": {
3+
"duplex": true,
4+
"envelopeId": "client1-campaign",
5+
"features": [
6+
"ADMAIL"
7+
],
8+
"insertIds": [
9+
"client1-campaign-fast-facts-attachment"
10+
],
11+
"paper": {
12+
"colour": "WHITE",
13+
"id": "paper-std-white-100",
14+
"name": "Standard White 80gsm",
15+
"recycled": true,
16+
"size": "A4",
17+
"weightGSM": 80
18+
},
19+
"printColour": "COLOUR"
20+
},
21+
"billingId": "client1-campaign-billing",
22+
"constraints": {
23+
"blackCoveragePercentage": {
24+
"operator": "LESS_THAN",
25+
"value": 20
26+
},
27+
"colourCoveragePercentage": {
28+
"operator": "LESS_THAN",
29+
"value": 20
30+
},
31+
"deliveryDays": {
32+
"operator": "LESS_THAN",
33+
"value": 3
34+
},
35+
"sheets": {
36+
"operator": "LESS_THAN",
37+
"value": 4
38+
},
39+
"sides": {
40+
"operator": "LESS_THAN",
41+
"value": 8
42+
}
43+
},
44+
"createdAt": "2026-01-12T00:00:00.000Z",
45+
"description": "Envelope and attachment for campaign",
46+
"id": "client1-campaign",
47+
"name": "Client1 - campaign",
48+
"postage": {
49+
"deliveryDays": 3,
50+
"id": "economy",
51+
"maxThicknessMm": 5,
52+
"maxWeightGrams": 100,
53+
"size": "STANDARD"
54+
},
55+
"status": "PROD",
56+
"updatedAt": "2026-02-16T17:00:00.000Z",
57+
"version": 2
58+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"assembly": {
3+
"duplex": true,
4+
"envelopeId": "economy-c5",
5+
"paper": {
6+
"colour": "WHITE",
7+
"id": "paper-std-white-80",
8+
"name": "Standard White 80gsm",
9+
"recycled": true,
10+
"size": "A4",
11+
"weightGSM": 80
12+
},
13+
"printColour": "BLACK"
14+
},
15+
"billingId": "notify-c4",
16+
"constraints": {
17+
"blackCoveragePercentage": {
18+
"operator": "LESS_THAN",
19+
"value": 20
20+
},
21+
"deliveryDays": {
22+
"operator": "LESS_THAN",
23+
"value": 3
24+
},
25+
"sheets": {
26+
"operator": "LESS_THAN",
27+
"value": 20
28+
},
29+
"sides": {
30+
"operator": "LESS_THAN",
31+
"value": 40
32+
}
33+
},
34+
"createdAt": "2026-01-12T00:00:00.000Z",
35+
"description": "C4 pack (large letter)",
36+
"id": "notify-c4",
37+
"name": "Notify standard (C4)",
38+
"postage": {
39+
"deliveryDays": 3,
40+
"id": "economy",
41+
"maxThicknessMm": 25,
42+
"maxWeightGrams": 500,
43+
"size": "LARGE"
44+
},
45+
"status": "DRAFT",
46+
"updatedAt": "2026-01-12T00:00:00.000Z",
47+
"version": 1
48+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"assembly": {
3+
"duplex": true,
4+
"envelopeId": "economy-c4",
5+
"paper": {
6+
"colour": "WHITE",
7+
"id": "paper-std-white-80",
8+
"name": "Standard White 80gsm",
9+
"recycled": true,
10+
"size": "A4",
11+
"weightGSM": 80
12+
},
13+
"printColour": "BLACK"
14+
},
15+
"billingId": "notify-c5-billing",
16+
"constraints": {
17+
"blackCoveragePercentage": {
18+
"operator": "LESS_THAN",
19+
"value": 20
20+
},
21+
"deliveryDays": {
22+
"operator": "LESS_THAN",
23+
"value": 3
24+
},
25+
"sheets": {
26+
"operator": "LESS_THAN",
27+
"value": 5
28+
},
29+
"sides": {
30+
"operator": "LESS_THAN",
31+
"value": 10
32+
}
33+
},
34+
"createdAt": "2026-01-12T00:00:00.000Z",
35+
"description": "C5 pack",
36+
"id": "notify-c5",
37+
"name": "Notify standard",
38+
"postage": {
39+
"deliveryDays": 3,
40+
"id": "economy",
41+
"maxThicknessMm": 5,
42+
"maxWeightGrams": 100,
43+
"size": "STANDARD"
44+
},
45+
"status": "PROD",
46+
"updatedAt": "2026-01-12T00:00:00.000Z",
47+
"version": 1
48+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"allocationPercentage": 30,
3+
"id": "supplier1-volumeGroup-test1",
4+
"status": "PROD",
5+
"supplier": "supplier1",
6+
"volumeGroup": "volumeGroup-test1"
7+
}

0 commit comments

Comments
 (0)