Skip to content

Commit ae3b063

Browse files
committed
Merge branch 'main' into dependabotCombined
# Conflicts: # .github/workflows/stage-5-publish.yaml # package-lock.json # package.json
2 parents b208482 + 580c6fc commit ae3b063

File tree

108 files changed

+10375
-2196
lines changed

Some content is hidden

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

108 files changed

+10375
-2196
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
"installDockerComposeSwitch": true,
7777
"moby": true,
7878
"version": "latest"
79+
},
80+
"ghcr.io/devcontainers/features/dotnet:2.4.0": {
81+
"version": "8.0"
7982
}
8083
},
8184
"mounts": [

.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/actions/build-sdk/action.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ runs:
4949
run: |
5050
make build VERSION="${{ inputs.version }}"
5151
52-
5352
- name: Upload API OAS specification artifact
5453
uses: actions/upload-artifact@v4
5554
with:
@@ -86,13 +85,6 @@ runs:
8685
path: "sdk/csharp"
8786
name: sdk-csharp-${{ inputs.version }}
8887

89-
# - name: Upload artifact
90-
# # Automatically uploads an artifact from the './_site' directory by default
91-
# uses: actions/upload-pages-artifact@v3
92-
# with:
93-
# path: "docs/_site/"
94-
# name: jekyll-docs-${{ inputs.version }}
95-
9688
- name: Upload artifact
9789
uses: actions/upload-pages-artifact@v3
9890
with:

.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

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

Lines changed: 24 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ on:
3838

3939
permissions:
4040
id-token: write # This is required for requesting the JWT
41-
contents: read # This is required for actions/checkout
41+
contents: read # This is required for actions/checkout
4242
jobs:
4343
artefact-jekyll-docs:
4444
name: "Build Docs"
@@ -64,29 +64,29 @@ jobs:
6464
with:
6565
version: "${{ inputs.version }}"
6666

67-
artefact-servers:
68-
name: "Build servers"
69-
runs-on: ubuntu-latest
70-
timeout-minutes: 10
71-
steps:
72-
- name: "Checkout code"
73-
uses: actions/checkout@v5
74-
- name: "Build servers"
75-
uses: ./.github/actions/build-server
76-
with:
77-
version: "${{ inputs.version }}"
78-
79-
artefact-libs:
80-
name: "Build libs"
81-
runs-on: ubuntu-latest
82-
timeout-minutes: 10
83-
steps:
84-
- name: "Checkout code"
85-
uses: actions/checkout@v5
86-
- name: "Build servers"
87-
uses: ./.github/actions/build-libraries
88-
with:
89-
version: "${{ inputs.version }}"
67+
# Take out for now - might add again in the future
68+
# artefact-servers:
69+
# name: "Build servers"
70+
# runs-on: ubuntu-latest
71+
# timeout-minutes: 10
72+
# steps:
73+
# - name: "Checkout code"
74+
# uses: actions/checkout@v5
75+
# - name: "Build servers"
76+
# uses: ./.github/actions/build-server
77+
# with:
78+
# version: "${{ inputs.version }}"
79+
# artefact-libs:
80+
# name: "Build libs"
81+
# runs-on: ubuntu-latest
82+
# timeout-minutes: 10
83+
# steps:
84+
# - name: "Checkout code"
85+
# uses: actions/checkout@v5
86+
# - name: "Build servers"
87+
# uses: ./.github/actions/build-libraries
88+
# with:
89+
# version: "${{ inputs.version }}"
9090

9191
artefact-proxies:
9292
name: "Build proxies"
@@ -109,38 +109,3 @@ jobs:
109109
runId: "${{ github.run_id }}"
110110
buildSandbox: true
111111
releaseVersion: ${{ github.head_ref || github.ref_name }}
112-
113-
# artefact-1:
114-
# name: "Artefact 1"
115-
# runs-on: ubuntu-latest
116-
# timeout-minutes: 3
117-
# steps:
118-
# - name: "Checkout code"
119-
# uses: actions/checkout@v5
120-
# - name: "Build artefact 1"
121-
# run: |
122-
# echo "Building artefact 1 ..."
123-
# - name: "Check artefact 1"
124-
# run: |
125-
# echo "Checking artefact 1 ..."
126-
# - name: "Upload artefact 1"
127-
# run: |
128-
# echo "Uploading artefact 1 ..."
129-
# # Use either action/cache or action/upload-artifact
130-
# artefact-n:
131-
# name: "Artefact n"
132-
# runs-on: ubuntu-latest
133-
# timeout-minutes: 3
134-
# steps:
135-
# - name: "Checkout code"
136-
# uses: actions/checkout@v5
137-
# - name: "Build artefact n"
138-
# run: |
139-
# echo "Building artefact n ..."
140-
# - name: "Check artefact n"
141-
# run: |
142-
# echo "Checking artefact n ..."
143-
# - name: "Upload artefact n"
144-
# run: |
145-
# echo "Uploading artefact n ..."
146-
# # Use either action/cache or action/upload-artifact

0 commit comments

Comments
 (0)