Skip to content

Commit 36f5a3c

Browse files
committed
merge main
Signed-off-by: Tim Ireland <tim.ireland@hscic.gov.uk>
2 parents 75e24c9 + f309183 commit 36f5a3c

File tree

459 files changed

+34031
-18061
lines changed

Some content is hidden

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

459 files changed

+34031
-18061
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
"devDependencies": [
6868
"jest.config.ts",
6969
"jest.setup.ts",
70-
"**/__tests__/**"
70+
"**/__tests__/**",
71+
"**/*.dev.[jt]s?(x)"
7172
]
7273
}
7374
],

.github/CODEOWNERS

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# NHS Notify Code Owners
22

3-
* @NHSDigital/nhs-notify-web-template-management
3+
* @NHSDigital/nhs-notify-web-template-management
44

5-
/.github/ @NHSDigital/nhs-notify-web-template-management-admins
6-
*.code-workspace @NHSDigital/nhs-notify-web-template-management-admins
7-
/docs/ @NHSDigital/nhs-notify-web-template-management
8-
/docs/testing/ @NHSDigital/nhs-notify-web-template-management-testers
9-
/tests/test-team/ @NHSDigital/nhs-notify-web-template-management-testers
5+
/.github/ @NHSDigital/nhs-notify-web-template-management-admins
6+
*.code-workspace @NHSDigital/nhs-notify-web-template-management-admins
7+
/docs/ @NHSDigital/nhs-notify-web-template-management
8+
/infrastructure/terraform/ @NHSDigital/nhs-notify-platform
109

1110
# Codeowners must be final check
12-
/.github/CODEOWNERS @NHSDigital/nhs-notify-code-owners
13-
/CODEOWNERS @NHSDigital/nhs-notify-code-owners
11+
/.github/CODEOWNERS @NHSDigital/nhs-notify-code-owners
12+
/CODEOWNERS @NHSDigital/nhs-notify-code-owners
1413

1514

1615
# Each NHS Notify repository should have clear code owners set.
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
name: "TFSec Scan"
2-
description: "Scan HCL using TFSec"
1+
name: "Trivy Scan"
32
runs:
43
using: "composite"
54
steps:
6-
- name: "TFSec Scan - Components"
5+
- name: "Trivy Terraform IAC Scan"
76
shell: bash
87
run: |
98
components_exit_code=0
109
modules_exit_code=0
1110
12-
./scripts/terraform/tfsec.sh ./infrastructure/terraform/components || components_exit_code=$?
13-
./scripts/terraform/tfsec.sh ./infrastructure/terraform/modules || modules_exit_code=$?
11+
./scripts/terraform/trivy.sh ./infrastructure/terraform/components || components_exit_code=$?
12+
./scripts/terraform/trivy.sh ./infrastructure/terraform/modules || modules_exit_code=$?
1413
1514
if [ $components_exit_code -ne 0 ] || [ $modules_exit_code -ne 0 ]; then
16-
echo "One or more TFSec scans failed."
15+
echo "Trivy misconfigurations detected."
1716
exit 1
1817
fi

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ jobs:
135135
uses: actions/checkout@v4
136136
- name: "Lint Terraform"
137137
uses: ./.github/actions/lint-terraform
138-
tfsec:
139-
name: "TFSec Scan"
138+
trivy:
139+
name: "Trivy Scan"
140140
runs-on: ubuntu-latest
141141
timeout-minutes: 5
142142
needs: detect-terraform-changes
@@ -148,8 +148,8 @@ jobs:
148148
uses: asdf-vm/actions/setup@v3
149149
- name: "Perform Setup"
150150
uses: ./.github/actions/setup
151-
- name: "TFSec Scan"
152-
uses: ./.github/actions/tfsec
151+
- name: "Trivy Scan"
152+
uses: ./.github/actions/trivy
153153
count-lines-of-code:
154154
name: "Count lines of code"
155155
runs-on: ubuntu-latest

.github/workflows/stage-4-acceptance.yaml

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
uses: aws-actions/configure-aws-credentials@v4
5555
with:
5656
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ASSUME_ROLE_NAME }}
57-
role-session-name: deployInfra
57+
role-session-name: templates-ci-sandbox-setup
5858
aws-region: ${{ env.AWS_REGION }}
5959
- name: "Get normalized branch name"
6060
id: normalize_branch_name
@@ -108,7 +108,7 @@ jobs:
108108
uses: aws-actions/configure-aws-credentials@v4
109109
with:
110110
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ASSUME_ROLE_NAME }}
111-
role-session-name: deployInfra
111+
role-session-name: templates-ci-accessibility-tests
112112
aws-region: eu-west-2
113113
- name: "Run accessibility test"
114114
run: make test-accessibility
@@ -143,7 +143,7 @@ jobs:
143143
uses: aws-actions/configure-aws-credentials@v4
144144
with:
145145
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ASSUME_ROLE_NAME }}
146-
role-session-name: deployInfra
146+
role-session-name: templates-ci-component-tests
147147
aws-region: eu-west-2
148148
- name: "Run ui component test"
149149
run: |
@@ -179,7 +179,7 @@ jobs:
179179
uses: aws-actions/configure-aws-credentials@v4
180180
with:
181181
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ASSUME_ROLE_NAME }}
182-
role-session-name: deployInfra
182+
role-session-name: templates-ci-api-tests
183183
aws-region: eu-west-2
184184
- name: "Run API test"
185185
run: |
@@ -190,7 +190,43 @@ jobs:
190190
with:
191191
name: API test report
192192
path: "tests/test-team/playwright-report"
193-
193+
test-e2e:
194+
name: "E2E test"
195+
runs-on: ubuntu-latest
196+
needs: [sandbox-set-up]
197+
environment: dev
198+
timeout-minutes: 10
199+
steps:
200+
- name: "Checkout code"
201+
uses: actions/checkout@v4
202+
- uses: actions/download-artifact@v4
203+
with:
204+
name: sandbox_tf_outputs.json
205+
path: ./
206+
- uses: actions/download-artifact@v4
207+
with:
208+
name: amplify_outputs.json
209+
path: ./frontend
210+
- name: "Repo setup"
211+
run: |
212+
npm ci
213+
- name: Install Playwright Browsers
214+
run: npx playwright install --with-deps
215+
- name: Configure AWS credentials
216+
uses: aws-actions/configure-aws-credentials@v4
217+
with:
218+
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ASSUME_ROLE_NAME }}
219+
role-session-name: templates-ci-e2e-tests
220+
aws-region: eu-west-2
221+
- name: "Run E2E test"
222+
run:
223+
npm -w tests/test-team run test:e2e
224+
- name: Archive e2e test results
225+
if: success() || failure()
226+
uses: actions/upload-artifact@v4
227+
with:
228+
name: e2e test report
229+
path: "tests/test-team/playwright-report"
194230
sandbox-tear-down:
195231
name: "Sandbox tear down"
196232
if: success() || failure()
@@ -199,6 +235,7 @@ jobs:
199235
- test-accessibility
200236
- test-ui-component
201237
- test-api
238+
- test-e2e
202239
environment: dev
203240
steps:
204241
- uses: hashicorp/setup-terraform@v3
@@ -209,7 +246,7 @@ jobs:
209246
uses: aws-actions/configure-aws-credentials@v4
210247
with:
211248
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ASSUME_ROLE_NAME }}
212-
role-session-name: deployInfra
249+
role-session-name: templates-ci-sandbox-teardown
213250
aws-region: eu-west-2
214251
- name: "Get normalized branch name"
215252
id: normalize_branch_name

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ node_modules
3535

3636
# production
3737
/build
38+
dist
3839

3940
# misc
4041
.DS_Store
@@ -63,6 +64,7 @@ reports
6364
tests/screenshots/*
6465
plugin-cache/
6566

67+
# terraform
6668
*.terraform*
6769
terraform.tfstate
6870
terraform.tfstate.backup
@@ -86,3 +88,6 @@ tests/test-team/playwright-report/
8688
tests/test-team/blob-report/
8789
tests/test-team/playwright/.cache/
8890
lambdas/backend-api/src/email/email-template.json
91+
92+
# vscode
93+
.vscode/settings.local.json

.gitleaksignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# SEE: https://github.com/gitleaks/gitleaks/blob/master/README.md#gitleaksignore
1+
# SEE: <https://github.com/gitleaks/gitleaks/blob/master/README.md#gitleaksignore>
22

33
cd9c0efec38c5d63053dd865e5d4e207c0760d91:docs/guides/Perform_static_analysis.md:generic-api-key:37
44
87312c6a627a7b0420956d49187fd15b130df170:src/__tests__/components/molecules/LoginStatus.test.tsx:jwt:23
55
37ca9f5670f4cd7d91869845ca27defbe6156bb9:src/__tests__/components/molecules/LoginStatus.test.tsx:jwt:23
66
b19d88d1d92b0530f065feefcf25d8cdd82a876a:tests/test-team/auth/user.json:jwt:15
77
b19d88d1d92b0530f065feefcf25d8cdd82a876a:tests/test-team/auth/user.json:jwt:25
8+
bc79df4f82052918ae6bf69d36279e5dd391d61e:tests/test-team/auth/user.json:jwt:15
9+
bc79df4f82052918ae6bf69d36279e5dd391d61e:tests/test-team/auth/user.json:jwt:25

.tool-versions

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
act 0.2.64
22
gitleaks 8.24.0
3+
jq 1.6
4+
nodejs 20.18.2
5+
make 4.4
36
pre-commit 3.6.0
47
terraform 1.9.2
58
terraform-docs 0.19.0
9+
trivy 0.61.0
610
vale 3.6.0
7-
tfsec 1.28.10
8-
nodejs 20.18.2
9-
jq 1.6
10-
python 3.9.18
11-
direnv 2.32.1
12-
make 4.4
11+
python 3.12.2
1312

1413
# ==============================================================================
1514
# The section below is reserved for Docker image versions.

.vscode/settings.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"markdownlint.config": {
33
"MD013": false,
4-
"MD024": { "siblings_only": true },
4+
"MD024": {
5+
"siblings_only": true
6+
},
57
"MD033": false
68
},
79
"editor.codeActionsOnSave": {
810
"source.fixAll.eslint": "explicit"
911
},
10-
"eslint.codeActionsOnSave.mode": "problems"
12+
"eslint.codeActionsOnSave.mode": "problems",
1113
}

frontend/jest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const config: Config = {
2222
...baseJestConfig,
2323

2424
coveragePathIgnorePatterns: [
25+
...(baseJestConfig.coveragePathIgnorePatterns ?? []),
2526
'.types.ts',
2627
'layout.tsx',
2728
'container.tsx',

0 commit comments

Comments
 (0)