Skip to content

Commit 3d561e2

Browse files
committed
Merge remote-tracking branch 'origin/main' into PPHA-374-plantuml
2 parents 42c6388 + 9fa430a commit 3d561e2

50 files changed

Lines changed: 1056 additions & 188 deletions

Some content is hidden

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

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,8 @@
11
<!-- markdownlint-disable-next-line first-line-heading -->
2-
## Description
2+
# What is the change?
33

4-
<!-- Describe your changes in detail. -->
4+
<!-- Describe the intended changes. -->
55

6-
## Context
6+
# Why are we making this change?
77

88
<!-- Why is this change required? What problem does it solve? -->
9-
10-
## Type of changes
11-
12-
<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->
13-
14-
- [ ] Refactoring (non-breaking change)
15-
- [ ] New feature (non-breaking change which adds functionality)
16-
- [ ] Breaking change (fix or feature that would change existing functionality)
17-
- [ ] Bug fix (non-breaking change which fixes an issue)
18-
19-
## Checklist
20-
21-
<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
22-
23-
- [ ] I am familiar with the [contributing guidelines](../docs/CONTRIBUTING.md)
24-
- [ ] I have followed the code style of the project
25-
- [ ] I have added tests to cover my changes
26-
- [ ] I have updated the documentation accordingly
27-
- [ ] This PR is a result of pair or mob programming
28-
29-
---
30-
31-
## Sensitive Information Declaration
32-
33-
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including [PII (Personal Identifiable Information) / PID (Personal Identifiable Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.
34-
35-
- [ ] I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: "CI/CD pull request"
33
# The total recommended execution time for the "CI/CD Pull Request" workflow is around 20 minutes.
44

55
on:
6+
push:
7+
branches:
8+
- "**"
9+
- "!main"
610
pull_request:
711
types: [opened, reopened]
812

@@ -62,6 +66,7 @@ jobs:
6266
export TERRAFORM_VERSION="${{ steps.variables.outputs.terraform_version }}"
6367
export VERSION="${{ steps.variables.outputs.version }}"
6468
export DOES_PULL_REQUEST_EXIST="${{ steps.pr_exists.outputs.does_pull_request_exist }}"
69+
export BRANCH_NAME="${{ github.head_ref }}"
6570
make list-variables
6671
commit-stage: # Recommended maximum execution time is 2 minutes
6772
name: "Commit stage"
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: "CI/CD pull request"
2+
3+
# The total recommended execution time for the "CI/CD Pull Request" workflow is around 20 minutes.
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
metadata:
12+
name: "Set CI/CD metadata"
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 1
15+
outputs:
16+
build_datetime_london: ${{ steps.variables.outputs.build_datetime_london }}
17+
build_datetime: ${{ steps.variables.outputs.build_datetime }}
18+
build_timestamp: ${{ steps.variables.outputs.build_timestamp }}
19+
build_epoch: ${{ steps.variables.outputs.build_epoch }}
20+
nodejs_version: ${{ steps.variables.outputs.nodejs_version }}
21+
python_version: ${{ steps.variables.outputs.python_version }}
22+
terraform_version: ${{ steps.variables.outputs.terraform_version }}
23+
version: ${{ steps.variables.outputs.version }}
24+
steps:
25+
- name: "Checkout code"
26+
uses: actions/checkout@v5
27+
- name: "Set CI/CD variables"
28+
id: variables
29+
run: |
30+
datetime=$(date -u +'%Y-%m-%dT%H:%M:%S%z')
31+
BUILD_DATETIME=$datetime make version-create-effective-file
32+
echo "build_datetime_london=$(TZ=Europe/London date --date=$datetime +'%Y-%m-%dT%H:%M:%S%z')" >> $GITHUB_OUTPUT
33+
echo "build_datetime=$datetime" >> $GITHUB_OUTPUT
34+
echo "build_timestamp=$(date --date=$datetime -u +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
35+
echo "build_epoch=$(date --date=$datetime -u +'%s')" >> $GITHUB_OUTPUT
36+
echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
37+
echo "python_version=$(grep "^python\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
38+
echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
39+
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT
40+
- name: "List variables"
41+
run: |
42+
export BUILD_DATETIME_LONDON="${{ steps.variables.outputs.build_datetime_london }}"
43+
export BUILD_DATETIME="${{ steps.variables.outputs.build_datetime }}"
44+
export BUILD_TIMESTAMP="${{ steps.variables.outputs.build_timestamp }}"
45+
export BUILD_EPOCH="${{ steps.variables.outputs.build_epoch }}"
46+
export NODEJS_VERSION="${{ steps.variables.outputs.nodejs_version }}"
47+
export PYTHON_VERSION="${{ steps.variables.outputs.python_version }}"
48+
export TERRAFORM_VERSION="${{ steps.variables.outputs.terraform_version }}"
49+
export VERSION="${{ steps.variables.outputs.version }}"
50+
export BRANCH_NAME="${{ github.head_ref }}"
51+
make list-variables
52+
commit-stage: # Recommended maximum execution time is 2 minutes
53+
name: "Commit stage"
54+
needs: [metadata]
55+
uses: ./.github/workflows/stage-1-commit.yaml
56+
with:
57+
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
58+
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
59+
build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
60+
nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
61+
python_version: "${{ needs.metadata.outputs.python_version }}"
62+
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
63+
version: "${{ needs.metadata.outputs.version }}"
64+
secrets: inherit
65+
test-stage: # Recommended maximum execution time is 5 minutes
66+
name: "Test stage"
67+
needs: [metadata, commit-stage]
68+
uses: ./.github/workflows/stage-2-test.yaml
69+
with:
70+
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
71+
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
72+
build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
73+
nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
74+
python_version: "${{ needs.metadata.outputs.python_version }}"
75+
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
76+
version: "${{ needs.metadata.outputs.version }}"
77+
secrets: inherit
78+
build-stage: # Recommended maximum execution time is 3 minutes
79+
name: "Build stage"
80+
needs: [metadata, test-stage]
81+
uses: ./.github/workflows/stage-3-build.yaml
82+
with:
83+
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
84+
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
85+
build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
86+
nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
87+
python_version: "${{ needs.metadata.outputs.python_version }}"
88+
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
89+
version: "${{ needs.metadata.outputs.version }}"
90+
secrets: inherit
91+
acceptance-stage: # Recommended maximum execution time is 10 minutes
92+
name: "Acceptance stage"
93+
needs: [metadata, build-stage]
94+
uses: ./.github/workflows/stage-4-acceptance.yaml
95+
with:
96+
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
97+
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
98+
build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
99+
nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
100+
python_version: "${{ needs.metadata.outputs.python_version }}"
101+
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
102+
version: "${{ needs.metadata.outputs.version }}"
103+
secrets: inherit

.github/workflows/cicd-4-main-branch.yml

Lines changed: 0 additions & 80 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ __pycache__
1717
lung_cancer_screening/assets/compiled/*
1818
!lung_cancer_screening/assets/compiled/.gitkeep
1919
.DS_Store
20+
.venv

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
terraform 1.7.0
44
pre-commit 4.3.0
55
vale 3.6.0
6+
python 3.13.7
67
# gitleaks 8.18.4
78

89
# ==============================================================================

.vscode/settings.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,23 @@
33
"MD013": false,
44
"MD024": { "siblings_only": true },
55
"MD033": false
6-
}
6+
},
7+
"cSpell.words": [
8+
"dateutil",
9+
"endcall",
10+
"endset",
11+
"fieldset",
12+
"gunicorn",
13+
"jinja",
14+
"makemigrations",
15+
"nhsuk",
16+
"novalidate",
17+
"psycopg",
18+
"relativedelta",
19+
"responseset",
20+
"stylesheet",
21+
"toplevel",
22+
"unsubmitted",
23+
"whitenoise"
24+
]
725
}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM node:24.10.0-alpine3.21 AS asset_builder
1+
FROM node:25.0.0-alpine3.21 AS asset_builder
22

33
WORKDIR /app
44

55
COPY package.json package-lock.json rollup.config.js ./
6-
COPY lung_cancer_screening ./lung_cancer_screening
6+
COPY . .
77
RUN npm ci
88
RUN npm run compile
99

README.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,42 @@ The following software packages, or their equivalents, are expected to be instal
1919

2020
- [Docker](https://www.docker.com/) container runtime or a compatible tool, e.g. [Podman](https://podman.io/),
2121
- [GNU make](https://www.gnu.org/software/make/) 3.82 or later
22+
- [asdf](https://asdf-vm.com/) version manager for managing tool versions (ensure asdf is configured in your shell)
2223

2324
## Setup
2425

25-
To setup the pre commit hooks run
26+
1. Copy the environment file:
2627

27-
```shell
28-
make config
29-
```
28+
```shell
29+
cp .env.example .env
30+
```
31+
32+
1. Setup the pre-commit hooks and install dependencies:
33+
34+
```shell
35+
make config
36+
```
37+
38+
Note: If you encounter Python installation issues on macOS, you may need to install Python with SSL flags:
39+
40+
```shell
41+
CFLAGS="-I$(brew --prefix openssl@3)/include" \
42+
LDFLAGS="-L$(brew --prefix openssl@3)/lib" \
43+
PKG_CONFIG_PATH="$(brew --prefix openssl@3)/lib/pkgconfig" \
44+
asdf install python 3.13.7
45+
```
3046

3147
## Running the app locally
3248

3349
The project runs locally inside docker. Please ensure you have docker installed.
3450

35-
You can run the application by running:
51+
Apply the database migrations:
52+
53+
```shell
54+
make dev-migrate
55+
```
56+
57+
Run the application:
3658

3759
```shell
3860
make dev-run

docker-compose.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ services:
1313
- .env
1414
depends_on:
1515
- db
16+
- asset_builder
1617
volumes:
1718
- ./:/app
1819
- venv:/app/.venv
@@ -26,7 +27,8 @@ services:
2627
target: asset_builder
2728
command: npm run watch
2829
volumes:
29-
- ./lung_cancer_screening/assets/compiled:/app/lung_cancer_screening/assets/compiled
30+
- ./:/app
31+
- node_modules:/app/node_modules
3032

3133
db:
3234
image: postgres:15-alpine
@@ -48,3 +50,4 @@ volumes:
4850
redis_data:
4951
venv:
5052
playwright_browsers:
53+
node_modules:

0 commit comments

Comments
 (0)