Skip to content

Commit 403cd27

Browse files
authored
Merge branch 'main' into PRMP-809
2 parents a1c7f4d + 3dea456 commit 403cd27

Some content is hidden

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

56 files changed

+13747
-63
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!-- markdownlint-disable-next-line first-line-heading -->
2+
## Overview
3+
4+
**Jira ticket**: [TBC](https://nhsd-jira.digital.nhs.uk/browse/XXX)
5+
6+
### Description
7+
8+
<!-- Describe your changes in detail. -->
9+
10+
### Context
11+
12+
<!-- Why is this change required? What problem does it solve? -->
13+
14+
## Checklist
15+
16+
<!--
17+
18+
Put an `x` in the completed tasks.
19+
20+
If a task is not relevant, `x` it, then strike through the text e.g.:
21+
- [x] ~~This task is not relevant.~~
22+
23+
-->
24+
25+
Tasks for all changes:
26+
27+
- [ ] 1. I have linked this PR to its Jira ticket.
28+
- [ ] 2. I have run git pre-commits.
29+
- [ ] 3. I have updated relevant documentation.
30+
- [ ] 4. I have considered the cross-team impact (and have PR approval from both Core & Demographics if necessary).
31+
- [ ] 5. I have successfully [deployed this change to a sandbox](https://github.com/NHSDigital/national-document-repository-infrastructure/actions/workflows/deploy-sandbox.yml) and witnessed it build: [Workflow run: TBC](https://github.com/NHSDigital/national-document-repository-infrastructure/actions/runs/XXX)
32+
- [ ] 6. I have checked the Terraform Plan from this PR against `ndr-dev`.

.github/workflows/automated-sbom-repo-scan.yml renamed to .github/workflows/automated-pr-validator.yml

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
name: 'Z-AUTOMATED: SBOM Repo Scan'
1+
name: "Z-AUTOMATED: PR Validator"
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened]
5+
types: [opened, synchronize, reopened, edited]
66

7-
permissions:
8-
actions: read # Required for anchore/sbom-action
9-
contents: write # Required for anchore/sbom-action
10-
id-token: write # Required for requesting the JWT
11-
pull-requests: write
7+
permissions: {}
128

139
jobs:
1410
sbom_scan:
1511
name: SBOM Repo Scan
1612
runs-on: ubuntu-latest
13+
permissions:
14+
actions: read # Required for anchore/sbom-action
15+
contents: write # Required for anchore/sbom-action
16+
id-token: write # Required for requesting the JWT
17+
pull-requests: write
1718
steps:
18-
- uses: actions/checkout@v5
19+
- name: Checkout
20+
uses: actions/checkout@v5
1921
with:
20-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
22+
fetch-depth: 0
2123

2224
- uses: anchore/sbom-action@v0
2325
with:
@@ -51,14 +53,14 @@ jobs:
5153
repo: context.repo.repo,
5254
issue_number: context.issue.number,
5355
})
54-
56+
5557
const botComment = comments.find(comment => {
5658
return comment.user.type === 'Bot' && comment.body.includes('Code security issues found')
5759
})
5860
5961
// 2. Prepare format of the comment
6062
const output = `### Code security issues found
61-
63+
6264
View full details [here](https://github.com/${{ github.repository }}/security/code-scanning?query=is%3Aopen+pr%3A${{ github.event.pull_request.number }}).`;
6365
6466
// 3. If we have a comment, update it, otherwise create a new one
@@ -70,7 +72,7 @@ jobs:
7072
body: output
7173
})
7274
}
73-
75+
7476
github.rest.issues.createComment({
7577
issue_number: context.issue.number,
7678
owner: context.repo.owner,
@@ -89,7 +91,7 @@ jobs:
8991
repo: context.repo.repo,
9092
issue_number: context.issue.number,
9193
})
92-
94+
9395
const botComment = comments.find(comment => {
9496
return comment.user.type === 'Bot' && comment.body.includes('Code security issues found')
9597
})
@@ -102,3 +104,41 @@ jobs:
102104
comment_id: botComment.id
103105
})
104106
}
107+
108+
markdown-validation:
109+
name: Markdown Validation
110+
runs-on: ubuntu-latest
111+
permissions:
112+
contents: read
113+
steps:
114+
- name: Checkout
115+
uses: actions/checkout@v6
116+
with:
117+
fetch-depth: 0
118+
119+
- name: Run Markdown Validation Script
120+
id: validate
121+
run: |
122+
BRANCH_NAME=${{ github.event.repository.default_branch }}
123+
chmod +x scripts/markdown-validator.sh
124+
scripts/markdown-validator.sh
125+
126+
checklist_validator:
127+
name: Checklist Validation
128+
runs-on: ubuntu-latest
129+
permissions:
130+
contents: read
131+
steps:
132+
- name: Checkout repository
133+
uses: actions/checkout@v5
134+
135+
- name: Set up Python 3.11
136+
uses: actions/setup-python@v6
137+
with:
138+
python-version: 3.11
139+
140+
- name: Run checklist validator
141+
run: |
142+
python3 scripts/github/checklist_validator/main.py
143+
env:
144+
PR_BODY: ${{ github.event.pull_request.body }}

.github/workflows/cron-daily-health-check.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ jobs:
119119
runTests: false
120120
build: npm run build
121121
working-directory: ./app
122+
123+
- name: Copy main.html to index.html for serve compatibility
124+
run: cp ./dist/main.html ./dist/index.html
125+
working-directory: ./app
122126

123127
- name: npm install serve -g
124128
run: npm install serve -g

.markdownlint.jsonc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"MD013": false,
3+
"MD033": false
4+
}

.terraform-docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ sections:
1414

1515
content: |-
1616
{{ .Requirements }}
17+
1718
{{ .Resources }}
19+
1820
{{ .Inputs }}
21+
1922
{{ .Outputs }}
2023
2124
output:

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ This repository is used to build the infrastructure the NDR. That is it's sole p
88
- [Terraform docs](https://github.com/terraform-docs/terraform-docs)
99

1010
To install terraform-docs on WSL use the following commands (e.g. for v0.20.0):
11-
```
11+
12+
```shell
1213
curl -sSLo ./terraform-docs.tar.gz https://terraform-docs.io/dl/v0.20.0/terraform-docs-v0.20.0-$(uname)-amd64.tar.gz
1314
tar -xzf terraform-docs.tar.gz
1415
chmod +x terraform-docs
@@ -24,8 +25,8 @@ As this repository is a standalone infrastructure there is no python/node based
2425

2526
- Set this repository to get it's pre-commit hooks from .githooks
2627

27-
```
28+
```shell
2829
git config core.hooksPath .githooks
2930
```
3031

31-
Pre-commits will run on any commit. This will build docs and format the terraform.
32+
Pre-commits will run on all commits. This will build docs and format the terraform.

bootstrap/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Terraform Bootstrap
2+
13
## Requirements
24

35
| Name | Version |

infrastructure/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# National Document Repository - Infrastructure as Code
2+
13
## Requirements
24

35
| Name | Version |

infrastructure/api.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,15 @@ resource "aws_api_gateway_deployment" "ndr_api_deploy" {
7676
module.send-feedback-gateway,
7777
module.send-feedback-lambda,
7878
module.review_document_version_gateway,
79+
module.review_document_status_gateway,
80+
module.review-document-status-check-lambda,
7981
module.update-doc-ref-lambda,
8082
module.update-upload-state-gateway,
8183
module.update-upload-state-lambda,
8284
module.document-status-check-gateway,
8385
module.document-status-check-lambda,
8486
module.post-document-references-fhir-lambda,
87+
module.post_document_review_lambda,
8588
module.patch_document_review_lambda,
8689
module.virus_scan_result_gateway,
8790
module.virus_scan_result_lambda

infrastructure/backup-cross-account.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ resource "aws_backup_selection" "cross_account_backup_selection" {
6060
module.bulk_upload_report_dynamodb_table.dynamodb_table_arn,
6161
module.statistical-reports-store.bucket_arn,
6262
module.pdm_dynamodb_table.dynamodb_table_arn,
63-
module.pdm-document-store.bucket_arn
63+
module.pdm-document-store.bucket_arn,
64+
module.core_dynamodb_table.dynamodb_table_arn,
6465
]
6566
}
6667

0 commit comments

Comments
 (0)