Skip to content

Commit a616c06

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/CCM-11600-API-GW-Authorizer
2 parents 0121de0 + ec75f5e commit a616c06

File tree

70 files changed

+9678
-1730
lines changed

Some content is hidden

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

70 files changed

+9678
-1730
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/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

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.

0 commit comments

Comments
 (0)