Skip to content

Commit 3b562ce

Browse files
authored
Merge branch 'main' into feature/CCM-12649
2 parents fc5ac32 + c934c3c commit 3b562ce

File tree

102 files changed

+11451
-2640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+11451
-2640
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,6 @@ trim_trailing_whitespace = unset
6767
indent_style = unset
6868
indent_size = unset
6969
generated_code = true
70+
71+
[/internal/events/**/*.schema.json]
72+
insert_final_newline = unset

.github/workflows/pr_destroy_dynamic_env.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ concurrency:
88
group: ${{ github.workflow }}-${{ github.ref }}
99
cancel-in-progress: false
1010

11+
permissions:
12+
id-token: write
13+
contents: read
14+
1115
jobs:
12-
create-dynamic-environment:
16+
destroy-dynamic-environment:
1317
name: Destroy Dynamic Environment
1418
runs-on: ubuntu-latest
1519

@@ -32,3 +36,25 @@ jobs:
3236
--terraformAction "destroy" \
3337
--overrideProjectName "nhs" \
3438
--overrideRoleName "nhs-main-acct-supplier-api-github-deploy"
39+
40+
destroy-dynamic-proxy:
41+
name: Destroy Dynamic Proxy
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- uses: actions/checkout@v5
46+
47+
- name: Trigger dynamic proxy destruction
48+
env:
49+
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
50+
APP_PEM_FILE: ${{ secrets.APP_PEM_FILE }}
51+
shell: bash
52+
run: |
53+
.github/scripts/dispatch_internal_repo_workflow.sh \
54+
--infraRepoName "nhs-notify-supplier-api" \
55+
--releaseVersion "main" \
56+
--targetComponent "api" \
57+
--targetWorkflow "proxy-destroy.yaml" \
58+
--targetEnvironment "pr${{ github.event.number }}" \
59+
--apimEnvironment "internal-dev-sandbox" \
60+
--boundedContext "notify-supplier"

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ jobs:
6868
# Upload the results to GitHub's code scanning dashboard (optional).
6969
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.0
71+
uses: github/codeql-action/upload-sarif@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
7272
with:
7373
sarif_file: results.sarif

.github/workflows/stage-1-commit.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,95 @@ jobs:
199199
idp_aws_report_upload_region: "${{ secrets.IDP_AWS_REPORT_UPLOAD_REGION }}"
200200
idp_aws_report_upload_role_name: "${{ secrets.IDP_AWS_REPORT_UPLOAD_ROLE_NAME }}"
201201
idp_aws_report_upload_bucket_endpoint: "${{ secrets.IDP_AWS_REPORT_UPLOAD_BUCKET_ENDPOINT }}"
202+
203+
detect-event-schema-package-changes:
204+
name: "Check for changes to event schema package compared to main branch"
205+
runs-on: ubuntu-latest
206+
permissions:
207+
contents: read
208+
outputs:
209+
changed: ${{ steps.check.outputs.changed }}
210+
main_version: ${{ steps.check.outputs.main_version }}
211+
212+
steps:
213+
- name: "Checkout code"
214+
uses: actions/checkout@v4
215+
with:
216+
fetch-depth: 0
217+
218+
- name: Detect package changes and current version
219+
id: check
220+
run: |
221+
git fetch origin main
222+
223+
if git diff --quiet origin/main...HEAD -- internal/events; then
224+
echo "No changes in event schemas package"
225+
echo "changed=false" >> $GITHUB_OUTPUT
226+
else
227+
echo "Changes detected in event schemas"
228+
echo "changed=true" >> $GITHUB_OUTPUT
229+
fi
230+
231+
if content=$(git show origin/main:internal/events/schemas/package.json 2>/dev/null); then
232+
version=$(jq -r .version <<< $content);
233+
else
234+
version=null;
235+
fi
236+
237+
echo "Detected package version $version in main branch"
238+
echo "main_version=$version" >> $GITHUB_OUTPUT
239+
240+
check-schemas-generated:
241+
name: Check event schemas have been regenerated
242+
needs: detect-event-schema-package-changes
243+
if: needs.detect-event-schema-package-changes.outputs.changed == 'true'
244+
runs-on: ubuntu-latest
245+
permissions:
246+
contents: read
247+
steps:
248+
- name: "Checkout code"
249+
uses: actions/checkout@v4
250+
251+
# Simplified caching - template management has more complex caching of installed modules from another build step
252+
- name: "Cache node_modules"
253+
uses: actions/cache@v4
254+
with:
255+
path: |
256+
**/node_modules
257+
key: ${{ runner.os }}-node-${{ inputs.nodejs_version }}-${{ hashFiles('**/package-lock.json') }}
258+
restore-keys: |
259+
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
260+
261+
- name: "Re-generate schemas"
262+
run: |
263+
npm ci --workspace internal/events
264+
npm --workspace internal/events run gen:jsonschema
265+
266+
- name: Check for schema changes
267+
run: git diff --quiet internal/events/schemas
268+
269+
check-schema-version-change:
270+
name: Check event schema version has been updated
271+
needs: detect-event-schema-package-changes
272+
if: needs.detect-event-schema-package-changes.outputs.changed == 'true'
273+
runs-on: ubuntu-latest
274+
permissions:
275+
contents: read
276+
steps:
277+
- name: Checkout code
278+
uses: actions/checkout@v4
279+
280+
- name: Check schema versions
281+
run: |
282+
source scripts/is_valid_increment.sh
283+
284+
main_version="${{ needs.detect-event-schema-package-changes.outputs.main_version }}"
285+
echo "Main version: ${{ needs.detect-event-schema-package-changes.outputs.main_version }}"
286+
287+
local_version=$(jq -r '.version' internal/events/package.json)
288+
echo "Local version: $local_version"
289+
290+
if ! is_valid_increment "$main_version" "$local_version" ; then
291+
echo "Error: Event Schema package has changed, but new version ($local_version) is not a valid increment from latest version on main branch ($main_version)."
292+
exit 1
293+
fi

.github/workflows/stage-2-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
with:
144144
fetch-depth: 0 # Full history is needed to improving relevancy of reporting
145145
- name: "Download coverage report for SONAR"
146-
uses: actions/download-artifact@v5
146+
uses: actions/download-artifact@v6
147147
with:
148148
name: code-coverage-report
149149
- name: "Perform static analysis"

.github/workflows/stage-5-publish.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,56 +46,56 @@ jobs:
4646
uses: actions/checkout@v5
4747

4848
- name: "Get the artefacts 1"
49-
uses: actions/download-artifact@v5
49+
uses: actions/download-artifact@v6
5050
with:
5151
path: ./artifacts/jekyll-docs-${{ inputs.version }}
5252
name: jekyll-docs-${{ inputs.version }}
5353

5454
- name: "Get the artefacts 2"
55-
uses: actions/download-artifact@v5
55+
uses: actions/download-artifact@v6
5656
with:
5757
path: ./artifacts/sdk-html-docs-${{ inputs.version }}
5858
name: sdk-html-docs-${{ inputs.version }}
5959

6060
- name: "Get the artefacts 3"
61-
uses: actions/download-artifact@v5
61+
uses: actions/download-artifact@v6
6262
with:
6363
path: ./artifacts/sdk-swagger-docs-${{ inputs.version }}
6464
name: sdk-swagger-docs-${{ inputs.version }}
6565

6666
- name: "Get the artefacts 4"
67-
uses: actions/download-artifact@v5
67+
uses: actions/download-artifact@v6
6868
with:
6969
path: ./artifacts/sdk-html-${{ inputs.version }}
7070
name: sdk-html-${{ inputs.version }}
7171

7272
- name: "Get the artefacts 5"
73-
uses: actions/download-artifact@v5
73+
uses: actions/download-artifact@v6
7474
with:
7575
path: ./artifacts/sdk-ts-${{ inputs.version }}
7676
name: sdk-ts-${{ inputs.version }}
7777

7878
- name: "Get the artefacts 6"
79-
uses: actions/download-artifact@v5
79+
uses: actions/download-artifact@v6
8080
with:
8181
path: ./artifacts/sdk-python-${{ inputs.version }}
8282
name: sdk-python-${{ inputs.version }}
8383

8484
- name: "Get the artefacts 7"
85-
uses: actions/download-artifact@v5
85+
uses: actions/download-artifact@v6
8686
with:
8787
path: ./artifacts/sdk-csharp-${{ inputs.version }}
8888
name: sdk-csharp-${{ inputs.version }}
8989

9090
- name: "Get the artefacts 8"
91-
uses: actions/download-artifact@v5
91+
uses: actions/download-artifact@v6
9292
with:
9393
path: ./artifacts/api-oas-specification-${{ inputs.version }}
9494
name: api-oas-specification-${{ inputs.version }}
9595

9696
# Take out for now - might add again in the future
9797
# - name: "Get the artefacts 9"
98-
# uses: actions/download-artifact@v5
98+
# uses: actions/download-artifact@v6
9999
# with:
100100
# path: ./artifacts/server-csharp-${{ inputs.version }}
101101
# name: server-csharp-${{ inputs.version }}
@@ -252,12 +252,12 @@ jobs:
252252
# contents: read
253253
# steps:
254254
# - name: "Get the artefacts csharp docker"
255-
# uses: actions/download-artifact@v5
255+
# uses: actions/download-artifact@v6
256256
# with:
257257
# path: .
258258
# name: server-csharp-docker-${{ inputs.version }}
259259
# - name: "Get the artefacts csharp server"
260-
# uses: actions/download-artifact@v5
260+
# uses: actions/download-artifact@v6
261261
# with:
262262
# path: ./csharp-server
263263
# name: server-csharp-${{ inputs.version }}
@@ -279,7 +279,7 @@ jobs:
279279
contents: read
280280
steps:
281281
- name: "Get the artefacts"
282-
uses: actions/download-artifact@v5
282+
uses: actions/download-artifact@v6
283283
with:
284284
path: .
285285
name: sdk-csharp-${{ inputs.version }}
@@ -335,7 +335,7 @@ jobs:
335335
contents: read
336336
steps:
337337
- name: "Get the artefacts"
338-
uses: actions/download-artifact@v5
338+
uses: actions/download-artifact@v6
339339
with:
340340
path: .
341341
name: sdk-ts-${{ inputs.version }}
@@ -439,7 +439,7 @@ jobs:
439439
# contents: read
440440
# steps:
441441
# - name: "Get the artefacts"
442-
# uses: actions/download-artifact@v5
442+
# uses: actions/download-artifact@v6
443443
# with:
444444
# path: .
445445
# name: libs-letter-${{ inputs.version }}

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ clean:: # Clean-up project resources (main) @Operations
3030
# (cd src/server && make clean)
3131

3232
guard-%:
33-
@ if [ "${${*}}" = "" ]; then \
33+
@if [ -z "$${$*}" ]; then \
3434
echo "Variable $* not set"; \
35-
echo "Usage: make <target> APIM_ENV=<env>"
35+
echo "Usage: make <target> $*=<env>"; \
3636
exit 1; \
3737
fi
3838
serve:
@@ -59,6 +59,9 @@ set-security: guard-APIM_ENV
5959
@ SECURITY=security-$$APIM_ENV.yml \
6060
envsubst '$${SECURITY}' \
6161
< specification/api/components/security/security-template.yml > specification/api/components/security/security.yml
62+
@ SECURITY_SCHEMES=security-schemes-$$APIM_ENV.yml \
63+
envsubst '$${SECURITY_SCHEMES}' \
64+
< specification/api/components/security-schemes/security-schemes-template.yml > specification/api/components/security-schemes/security-schemes.yml
6265

6366
construct-spec: guard-APIM_ENV
6467
$(MAKE) set-target APIM_ENV=$$APIM_ENV

docs/assets/diagrams/types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Data Store Schemas
1+
# Data Store Schemas
22

33
This document contains the mermaid diagrams for the data store schemas used in the application.
44

@@ -10,7 +10,7 @@ The schemas are generated from Zod definitions and provide a visual representati
1010
erDiagram
1111
Letter {
1212
string id
13-
string status "enum: PENDING, ACCEPTED, REJECTED, PRINTED, ENCLOSED, CANCELLED, DISPATCHED, FAILED, RETURNED, DESTROYED, FORWARDED, DELIVERED"
13+
string status "enum: PENDING, ACCEPTED, REJECTED, PRINTED, ENCLOSED, CANCELLED, DISPATCHED, FAILED, RETURNED, FORWARDED, DELIVERED"
1414
string specificationId
1515
string groupId
1616
number reasonCode

docs/collections/_consumers/integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ The mandatory statuses are: **ACCEPTED**, **REJECTED**, **FORWARDED**, **DISPATC
105105
- **CANCELLED:** The letter was cancelled following a request from the NHS Notify team
106106

107107
**Optional statuses** - additional, non-mandatory updates that can provide greater operational insight.
108-
The optional statuses are: **PRINTED**, **ENCLOSED**, **DELIVERED**, and **DESTROYED**.
108+
The optional statuses are: **PRINTED**, **ENCLOSED**, and **DELIVERED**.
109109
These can be used if your internal workflow supports more granular reporting.
110110

111111
- **PRINTED:** The letter has been printed.

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "",
33
"dependencies": {
4-
"nhsuk-frontend": "^8.1.1"
4+
"nhsuk-frontend": "^10.1.0"
55
},
66
"description": "",
77
"devDependencies": {},

0 commit comments

Comments
 (0)