Skip to content

Commit db39aa1

Browse files
authored
Initial commit
0 parents  commit db39aa1

18 files changed

Lines changed: 833 additions & 0 deletions

.devcontainer/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ARG IMAGE_NAME=node_24_python_3_14
2+
ARG IMAGE_VERSION=latest
3+
FROM ghcr.io/nhsdigital/eps-devcontainers/${IMAGE_NAME}:${IMAGE_VERSION}
4+
5+
USER root
6+
# specify DOCKER_GID to force container docker group id to match host
7+
RUN if [ -n "${DOCKER_GID}" ]; then \
8+
if ! getent group docker; then \
9+
groupadd -g ${DOCKER_GID} docker; \
10+
else \
11+
groupmod -g ${DOCKER_GID} docker; \
12+
fi && \
13+
usermod -aG docker vscode; \
14+
fi
15+

.devcontainer/devcontainer.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"name": "eps-account-resources",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "..",
6+
"args": {
7+
"DOCKER_GID": "${env:DOCKER_GID:}",
8+
"IMAGE_NAME": "node_24_python_3_14",
9+
"IMAGE_VERSION": "v1.4.4",
10+
"USER_UID": "${localEnv:USER_ID:}",
11+
"USER_GID": "${localEnv:GROUP_ID:}"
12+
}
13+
},
14+
"mounts": [
15+
"source=${env:HOME}${env:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind",
16+
"source=${env:HOME}${env:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind",
17+
"source=${env:HOME}${env:USERPROFILE}/.gnupg,target=/home/vscode/.gnupg,type=bind",
18+
"source=${env:HOME}${env:USERPROFILE}/.npmrc,target=/home/vscode/.npmrc,type=bind",
19+
"source=${env:HOME}${env:USERPROFILE}/.gitconfig,target=/home/vscode/.gitconfig,type=bind"
20+
],
21+
"features": {},
22+
"customizations": {
23+
"vscode": {
24+
"extensions": [
25+
"AmazonWebServices.aws-toolkit-vscode",
26+
"redhat.vscode-yaml",
27+
"ms-python.python",
28+
"ms-python.flake8",
29+
"eamodio.gitlens",
30+
"github.vscode-pull-request-github",
31+
"lfm.vscode-makefile-term",
32+
"GrapeCity.gc-excelviewer",
33+
"redhat.vscode-xml",
34+
"streetsidesoftware.code-spell-checker",
35+
"timonwong.shellcheck",
36+
"mkhl.direnv",
37+
"github.vscode-github-actions",
38+
"dbaeumer.vscode-eslint",
39+
"vitest.explorer"
40+
],
41+
"settings": {
42+
"python.defaultInterpreterPath": "/workspaces/electronic-prescription-service-account-resources/.venv/bin/python",
43+
"python.analysis.autoSearchPaths": true,
44+
"python.analysis.extraPaths": [],
45+
"python.testing.unittestEnabled": false,
46+
"python.testing.pytestEnabled": true,
47+
"python.linting.pylintEnabled": false,
48+
"python.linting.flake8Enabled": true,
49+
"python.linting.enabled": true,
50+
"editor.formatOnPaste": false,
51+
"editor.formatOnType": false,
52+
"editor.formatOnSave": false,
53+
"editor.formatOnSaveMode": "file",
54+
"cSpell.words": [
55+
"fhir",
56+
"Formik",
57+
"pino",
58+
"serialisation"
59+
],
60+
"eslint.useFlatConfig": true,
61+
"eslint.format.enable": true,
62+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
63+
}
64+
}
65+
},
66+
"remoteEnv": {
67+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
68+
}
69+
}

.gitallowed

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
token: ?"?\$\{\{\s*secrets\.GITHUB_TOKEN\s*\}\}"?
2+
github-token: ?"?\$\{\{\s*secrets\.GITHUB_TOKEN\s*\}\}"?
3+
token: ?"?\$\{\{\s*secrets\.DEPENDABOT_TOKEN\s*\}\}"?
4+
id-token: write
5+
--token=\$\{\{\s*steps\.generate-token\.outputs\.token\s*\}\}
6+
--token=\$GITHUB-TOKEN
7+
--token="\$GITHUB-TOKEN"
8+
"accountId": "123456789012"
9+
accountId: "123456789012"
10+
"AWSAccountId": "123456789012"
11+
poetry.lock

.github/dependabot.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#########################################################################
2+
# Dependabot configuration file
3+
#########################################################################
4+
5+
version: 2
6+
registries:
7+
npm-github:
8+
type: npm-registry
9+
url: https://npm.pkg.github.com
10+
token: ${{secrets.DEPENDABOT_TOKEN}}
11+
12+
updates:
13+
###################################
14+
# Poetry #########################
15+
###################################
16+
- package-ecosystem: "pip"
17+
directory: "/"
18+
schedule:
19+
interval: "weekly"
20+
day: "friday"
21+
time: "18:00" #UTC
22+
versioning-strategy: increase
23+
open-pull-requests-limit: 20
24+
commit-message:
25+
prefix: "Upgrade: [dependabot] - "
26+
cooldown:
27+
default-days: 7
28+
- package-ecosystem: "github-actions"
29+
# Workflow files stored in the
30+
# default location of `.github/workflows`
31+
directory: "/"
32+
schedule:
33+
interval: "weekly"
34+
day: "friday"
35+
time: "20:00" #UTC
36+
open-pull-requests-limit: 20
37+
commit-message:
38+
prefix: "Upgrade: [dependabot] - "
39+
cooldown:
40+
default-days: 7
41+
42+
###################################
43+
# NPM workspace ##################
44+
###################################
45+
- package-ecosystem: "npm"
46+
directory: "/"
47+
schedule:
48+
interval: "weekly"
49+
day: "friday"
50+
time: "22:00" #UTC
51+
versioning-strategy: increase
52+
open-pull-requests-limit: 20
53+
commit-message:
54+
prefix: "Upgrade: [dependabot] - "
55+
registries:
56+
- npm-github
57+
cooldown:
58+
default-days: 7

.github/pull_request_template.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
## Summary
2+
3+
**Remove items from this list if they are not relevant. Remove this line once this has been done**
4+
5+
- Routine Change
6+
- :exclamation: Breaking Change
7+
- :robot: Operational or Infrastructure Change
8+
- :sparkles: New Feature
9+
- :warning: Potential issues that might be caused by this change
10+
11+
### Details
12+
13+
Add any summary information of what is in the change. **Remove this line if you have nothing to add.**
14+
15+
## Pull Request Naming
16+
17+
Pull requests should be named using the following format:
18+
19+
```text
20+
Tag: [AEA-NNNN] - Short description
21+
```
22+
23+
Tag can be one of:
24+
25+
- `Fix` - for a bug fix. (Patch release)
26+
- `Update` - either for a backwards-compatible enhancement or for a rule change that adds reported problems. (Patch release)
27+
- `New` - implemented a new feature. (Minor release)
28+
- `Breaking` - for a backwards-incompatible enhancement or feature. (Major release)
29+
- `Docs` - changes to documentation only. (Patch release)
30+
- `Build` - changes to build process only. (No release)
31+
- `Upgrade` - for a dependency upgrade. (Patch release)
32+
- `Chore` - for refactoring, adding tests, etc. (anything that isn't user-facing). (Patch release)
33+
34+
If the current release is x.y.z then
35+
- a patch release increases z by 1
36+
- a minor release increases y by 1
37+
- a major release increases x by 1
38+
39+
Correct tagging is necessary for our automated versioning and release process.
40+
41+
The description of your pull request will be used as the commit message for the merge, and also be included in the changelog. Please ensure that your title is sufficiently descriptive.
42+
43+
### Rerunning Checks
44+
45+
If you need to rename your pull request, you can restart the checks by either:
46+
47+
- Closing and reopening the pull request
48+
- pushing an empty commit
49+
```bash
50+
git commit --allow-empty -m 'trigger build'
51+
git push
52+
```
53+
- Amend your last commit and force push to the branch
54+
```bash
55+
git commit --amend --no-edit
56+
git push --force
57+
```
58+
59+
Rerunning the checks from within the pull request will not use the updated title.

.github/workflows/sync_copilot.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Sync Copilot Instructions
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 6 * * 1'
7+
permissions: {}
8+
9+
jobs:
10+
sync-copilot-instructions:
11+
runs-on: ubuntu-22.04
12+
environment: create_pull_request
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- name: Sync shared instructions
18+
uses: NHSDigital/eps-copilot-instructions@8b4d7f546fe9825a149cb8cc8cfdb31df58c3730
19+
with:
20+
copilot_instructions_ref: main
21+
calling_repo_base_branch: main
22+
CREATE_PULL_REQUEST_APP_ID: ${{ secrets.CREATE_PULL_REQUEST_APP_ID }}
23+
CREATE_PULL_REQUEST_PEM: ${{ secrets.CREATE_PULL_REQUEST_PEM }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Update devcontainer version
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 6 * * 1'
7+
permissions: {}
8+
9+
jobs:
10+
update-devcontainer-version:
11+
runs-on: ubuntu-22.04
12+
environment: create_pull_request
13+
permissions:
14+
contents: read
15+
packages: read
16+
17+
steps:
18+
- name: Update devcontainer version
19+
uses: NHSDigital/eps-update-devcontainer@dc3a8c5f11e7226ee4f5f2bb35bd0d1265092306
20+
with:
21+
calling_repo_base_branch: main
22+
CREATE_PULL_REQUEST_APP_ID: ${{ secrets.CREATE_PULL_REQUEST_APP_ID }}
23+
CREATE_PULL_REQUEST_PEM: ${{ secrets.CREATE_PULL_REQUEST_PEM }}

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
*.log
2+
**/build/
3+
**/dist/
4+
**/newman/
5+
**/public/
6+
**/coverage/
7+
**/node_modules/
8+
.#*
9+
__pycache__/
10+
.envrc
11+
.idea
12+
.venv
13+
lib/
14+
*.tsbuildinfo
15+
*.zip
16+
node_modules
17+
_site/
18+
.sass-cache
19+
.jekyll-cache
20+
.jekyll-metadata
21+
vendor
22+
.secrets
23+
cdk.out
24+
.local_config
25+
.npmrc
26+
.trivy_out/
27+
.cfn_guard_out/
28+
.sbom/

.pre-commit-config.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: check-merge-conflict
6+
name: Check for merge conflict strings
7+
8+
- id: end-of-file-fixer
9+
name: Fix missing newline at the end of files
10+
11+
- id: check-shebang-scripts-are-executable
12+
name: Check shell scripts are executable
13+
files: \.(sh)$
14+
15+
- id: check-yaml
16+
name: Check pipelines configuration
17+
files: ^(.github)
18+
19+
- repo: local
20+
hooks:
21+
- id: grype-scan-local
22+
name: Grype scan local changes
23+
entry: make
24+
args: ["grype-scan-local"]
25+
language: system
26+
pass_filenames: false
27+
always_run: true
28+
29+
- id: check-commit-signing
30+
name: Check commit signing
31+
description: Ensures that commits are GPG signed
32+
entry: bash
33+
args:
34+
- -c
35+
- |
36+
if ! git config --get commit.gpgsign | grep -q "true" > /dev/null 2>&1; then
37+
echo "Error: Commit signing is not enabled."
38+
echo "Please enable commit signing with:"
39+
echo " git config commit.gpgsign true"
40+
echo ""
41+
echo "For more information, see: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits"
42+
exit 1
43+
fi
44+
echo "Commit signing is properly configured."
45+
language: system
46+
pass_filenames: false
47+
always_run: true
48+
49+
- id: lint-githubactions
50+
name: Lint github actions
51+
entry: make
52+
args: ["actionlint"]
53+
language: system
54+
files: ^.github
55+
types_or: [yaml]
56+
pass_filenames: false
57+
58+
- id: lint-githubaction-scripts
59+
name: Lint github action scripts
60+
entry: make
61+
args: ["shellcheck"]
62+
language: system
63+
files: ^.github/scripts
64+
types_or: [sh, shell]
65+
pass_filenames: false
66+
67+
68+
- id: git-secrets
69+
name: Git Secrets
70+
description: git-secrets scans commits, commit messages, and --no-ff merges to prevent adding secrets into your git repositories.
71+
entry: bash
72+
args:
73+
- -c
74+
- 'git-secrets --pre_commit_hook'
75+
language: system
76+
77+
fail_fast: true
78+
default_stages: [pre-commit]

0 commit comments

Comments
 (0)