Skip to content

Commit 85067fb

Browse files
Merge dependabot/npm_and_yarn/eslint-plugin-unicorn-62.0.0 into dependabotCombined
2 parents 90a376f + 2b27ddf commit 85067fb

File tree

331 files changed

+22590
-8729
lines changed

Some content is hidden

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

331 files changed

+22590
-8729
lines changed

.devcontainer/devcontainer.json

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"build": {
3+
"dockerfile": "../scripts/devcontainer/Dockerfile"
4+
},
25
"customizations": {
36
"codespaces": {
47
"openFiles": [
@@ -9,11 +12,7 @@
912
},
1013
"vscode": {
1114
"extensions": [
12-
"ms-dotnettools.csdevkit",
1315
"42crunch.vscode-openapi",
14-
"alefragnani.bookmarks",
15-
"AmazonWebServices.aws-toolkit-vscode",
16-
"chdsbd.github-code-owners",
1716
"davidanson.vscode-markdownlint",
1817
"dbaeumer.vscode-eslint",
1918
"donjayamanne.githistory",
@@ -26,7 +25,6 @@
2625
"github.vscode-github-actions",
2726
"github.vscode-pull-request-github",
2827
"hediet.vscode-drawio",
29-
"johnpapa.vscode-peacock",
3028
"joshx.workspace-terminals",
3129
"maattdd.gitless",
3230
"mhutchie.git-graph",
@@ -40,14 +38,10 @@
4038
"streetsidesoftware.code-spell-checker-british-english",
4139
"takumii.markdowntable",
4240
"tamasfe.even-better-toml",
43-
"tomoki1207.pdf",
44-
"vscode-icons-team.vscode-icons",
45-
"vstirbu.vscode-mermaid-preview",
4641
"wayou.vscode-todo-highlight",
4742
"yzane.markdown-pdf",
4843
"yzhang.dictionary-completion",
49-
"yzhang.markdown-all-in-one",
50-
"zoma.vscode-auto-open-workspace"
44+
"yzhang.markdown-all-in-one"
5145
],
5246
"settings": {
5347
"[makefile]": {
@@ -69,34 +63,25 @@
6963
"omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions.git https://github.com/zsh-users/zsh-syntax-highlighting.git",
7064
"plugins": "zsh-autosuggestions zsh-syntax-highlighting"
7165
},
66+
"ghcr.io/devcontainers/features/aws-cli:1": {},
7267
"ghcr.io/devcontainers/features/common-utils": {
7368
"configureZshAsDefaultShell": true,
7469
"installOhMyZsh": true,
7570
"installOhMyZshConfig": true,
7671
"installZsh": true
7772
},
7873
"ghcr.io/devcontainers/features/docker-in-docker:2": {
79-
"azureDnsAutoDetection": true,
8074
"dockerDashComposeVersion": "v2",
8175
"installDockerBuildx": true,
8276
"installDockerComposeSwitch": true,
8377
"moby": true,
8478
"version": "latest"
85-
},
86-
"ghcr.io/devcontainers/features/dotnet:2": {
87-
"aspNetCoreRuntimeVersions": "8.0",
88-
"dotnetRuntimeVersions": "8.0",
89-
"version": "8.0"
90-
},
91-
"ghcr.io/devcontainers/features/go:1": {},
92-
"ghcr.io/devcontainers/features/node:1": {},
93-
"ghcr.io/devcontainers/features/python:1": {},
94-
"ghcr.io/devcontainers/features/ruby:1": {}
79+
}
9580
},
96-
"image": "mcr.microsoft.com/devcontainers/base:noble",
9781
"mounts": [
98-
"source=${localEnv:HOME}/.gnupg,target=/home/vscode/.gnupg,type=bind,consistency=cached"
82+
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
83+
"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached"
9984
],
100-
"name": "Ubuntu",
85+
"name": "Devcontainer",
10186
"postCreateCommand": "scripts/devcontainer/postcreatecommand.sh"
10287
}

.github/CODEOWNERS

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
# NHS Notify Code Owners
22

3-
* @NHSDigital/nhs-notify-supplier-api
4-
/.github/ @NHSDigital/nhs-notify-admins
5-
*.code-workspace @NHSDigital/nhs-notify-admins
3+
* @NHSDigital/nhs-notify-supplier-api
4+
5+
/.github/ @NHSDigital/nhs-notify-supplier-api-admins
6+
*.code-workspace @NHSDigital/nhs-notify-supplier-api-admins
7+
/docs/ @NHSDigital/nhs-notify-supplier-api
8+
/infrastructure/terraform/ @NHSDigital/nhs-notify-platform
69

710
# Codeowners must be final check
8-
/.github/CODEOWNERS @NHSDigital/nhs-notify-code-owners
9-
/CODEOWNERS @NHSDigital/nhs-notify-code-owners
11+
/.github/CODEOWNERS @NHSDigital/nhs-notify-code-owners
12+
/CODEOWNERS @NHSDigital/nhs-notify-code-owners
13+
14+
# Each NHS Notify repository should have clear code owners set.
15+
# Do not use GitHub team names, instead use the GitHub usernames
16+
# of the people who are responsible for the code maintenance.
1017

1118
# This is a comment.
1219
# Each line is a file pattern followed by one or more owners.

.github/actions/build-docs/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ runs:
1313
with:
1414
node-version: 18
1515
- name: Npm cli install
16-
working-directory: ./docs
16+
working-directory: .
1717
run: npm ci
1818
shell: bash
1919
- name: Setup Ruby
Lines changed: 77 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
11
name: "Build Proxies"
22
description: "Build Proxies"
3+
34
inputs:
45
version:
56
description: "Version number"
7+
required: false
8+
releaseVersion:
9+
description: "Release, tag, branch, or commit ID to be used for deployment"
10+
required: true
11+
environment:
12+
description: "Deployment environment"
13+
required: true
14+
apimEnv:
15+
description: "APIM environment"
616
required: true
17+
runId:
18+
description: "GitHub Actions run ID to fetch the OAS artifact from"
19+
required: true
20+
buildSandbox:
21+
description: "Whether to build the sandbox OAS spec"
22+
required: false
23+
default: false
24+
targetComponent:
25+
description: "Name of the Component to deploy"
26+
required: true
27+
default: 'api'
28+
729
runs:
830
using: composite
931

@@ -19,46 +41,76 @@ runs:
1941
run: npm ci
2042
shell: bash
2143

22-
- name: Build oas
23-
working-directory: .
44+
- name: Setup Proxy Name and target
2445
shell: bash
2546
run: |
26-
make publish-oas
2747
28-
- name: Setup Proxy Name
29-
shell: bash
30-
run: |
48+
ENV="${{ inputs.apimEnv }}"
49+
if [[ "$ENV" == "internal-dev" || "$ENV" == *pr ]]; then
50+
echo "TARGET_DOMAIN=suppliers.dev.nhsnotify.national.nhs.uk" >> $GITHUB_ENV
51+
elif [[ "$ENV" == "int" ]]; then
52+
echo "TARGET_DOMAIN=suppliers.nonprod.nhsnotify.national.nhs.uk" >> $GITHUB_ENV
53+
elif [[ "$ENV" == "prod" ]]; then
54+
echo "TARGET_DOMAIN=suppliers.prod.nhsnotify.national.nhs.uk" >> $GITHUB_ENV
55+
else
56+
echo "TARGET_DOMAIN=suppliers.dev.nhsnotify.national.nhs.uk" >> $GITHUB_ENV
57+
fi
3158
3259
if [ -z $PR_NUMBER ]
3360
then
3461
echo "INSTANCE=$PROXYGEN_API_NAME" >> $GITHUB_ENV
62+
echo "TARGET=https://main.$TARGET_DOMAIN" >> $GITHUB_ENV
63+
echo "SANDBOX_TAG=latest" >> $GITHUB_ENV
64+
echo "MTLS_NAME=notify-supplier-mtls" >> $GITHUB_ENV
3565
else
66+
echo "TARGET=https://pr$PR_NUMBER.$TARGET_DOMAIN" >> $GITHUB_ENV
3667
echo "INSTANCE=$PROXYGEN_API_NAME-PR-$PR_NUMBER" >> $GITHUB_ENV
68+
echo "SANDBOX_TAG=pr$PR_NUMBER" >> $GITHUB_ENV
69+
echo "MTLS_NAME=notify-supplier-mtls-pr$PR_NUMBER" >> $GITHUB_ENV
3770
fi
3871
39-
40-
- name: Install Proxygen client
72+
- name: Build ${{ inputs.apimEnv }} oas
73+
working-directory: .
74+
env:
75+
APIM_ENV: ${{ inputs.apimEnv }}
4176
shell: bash
4277
run: |
43-
# Install proxygen cli
44-
pip install pipx
45-
pipx install proxygen-cli
46-
47-
# Setup proxygen auth and settings
48-
mkdir -p ${HOME}/.proxygen
49-
echo -n $PROXYGEN_PRIVATE_KEY | base64 --decode > ${HOME}/.proxygen/key
50-
envsubst < ./.github/proxygen-credentials-template.yaml > ${HOME}/.proxygen/credentials.yaml
51-
envsubst < ./.github/proxygen-credentials-template.yaml | cat
52-
envsubst < ./.github/proxygen-settings.yaml > ${HOME}/.proxygen/settings.yaml
53-
envsubst < ./.github/proxygen-settings.yaml | cat
78+
if [ ${{ env.APIM_ENV }} == "internal-dev-sandbox" ] && [ ${{ inputs.buildSandbox }} == true ]
79+
then
80+
echo "Building sandbox OAS spec"
81+
make build-json-oas-spec APIM_ENV=sandbox
82+
else
83+
echo "Building env specific OAS spec"
84+
make build-json-oas-spec APIM_ENV=${{ env.APIM_ENV }}
85+
fi
5486
87+
if [[ $APIM_ENV == *-pr ]]; then
88+
echo "Removing pr suffix from APIM_ENV after building OAS and calling proxygen"
89+
APIM_ENV=$(echo "$APIM_ENV" | sed 's/-pr$//')
90+
fi
91+
echo "APIM_ENV=$APIM_ENV" >> $GITHUB_ENV
5592
56-
- name: Deploy to Internal Dev
57-
shell: bash
58-
run: |
59-
proxygen instance deploy internal-dev $INSTANCE build/notify-supplier.json --no-confirm
93+
- name: Upload OAS Spec
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: ${{ env.APIM_ENV }}-build-output
97+
path: ./build
6098

61-
- name: Deploy to Internal Dev Sandbox
99+
- name: Trigger deploy proxy
100+
env:
101+
APP_CLIENT_ID: ${{ env.APP_CLIENT_ID }}
102+
APP_PEM_FILE: ${{ env.APP_PEM_FILE }}
62103
shell: bash
63104
run: |
64-
proxygen instance deploy internal-dev-sandbox $INSTANCE build/notify-supplier.json --no-confirm
105+
.github/scripts/dispatch_internal_repo_workflow.sh \
106+
--infraRepoName "nhs-notify-supplier-api" \
107+
--releaseVersion "${{ inputs.releaseVersion }}" \
108+
--targetComponent "${{ inputs.targetComponent }}" \
109+
--targetWorkflow "proxy-deploy.yaml" \
110+
--targetEnvironment "${{ inputs.environment }}" \
111+
--runId "${{ inputs.runId }}" \
112+
--buildSandbox ${{ inputs.buildSandbox }} \
113+
--apimEnvironment "${{ env.APIM_ENV }}" \
114+
--boundedContext "notify-supplier" \
115+
--targetDomain "$TARGET_DOMAIN" \
116+
--version "${{ inputs.version }}"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: "Build Sandbox"
2+
description: "Build Sandbox"
3+
inputs:
4+
version:
5+
description: "Version number"
6+
required: true
7+
runs:
8+
using: composite
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 24
16+
17+
- name: Npm install
18+
working-directory: .
19+
run: npm ci
20+
shell: bash
21+
22+
- name: Install Proxygen client
23+
shell: bash
24+
run: |
25+
# Install proxygen cli
26+
pip install pipx
27+
pipx install proxygen-cli
28+
29+
# Setup proxygen auth and settings
30+
mkdir -p ${HOME}/.proxygen
31+
echo -n $PROXYGEN_PRIVATE_KEY | base64 --decode > ${HOME}/.proxygen/key
32+
envsubst < ./.github/proxygen-credentials-template.yaml > ${HOME}/.proxygen/credentials.yaml
33+
envsubst < ./.github/proxygen-credentials-template.yaml | cat
34+
envsubst < ./.github/proxygen-settings.yaml > ${HOME}/.proxygen/settings.yaml
35+
envsubst < ./.github/proxygen-settings.yaml | cat
36+
37+
- name: Setup Sandbox tag
38+
shell: bash
39+
run: |
40+
if [ -z $PR_NUMBER ]
41+
then
42+
echo "SANDBOX_TAG=latest" >> $GITHUB_ENV
43+
else
44+
echo "SANDBOX_TAG=pr$PR_NUMBER" >> $GITHUB_ENV
45+
fi
46+
47+
- name: Build and publish sandbox Docker image
48+
shell: bash
49+
working-directory: ./sandbox
50+
run: |
51+
proxygen docker get-login | bash
52+
docker build -t nhs-notify-supplier:$SANDBOX_TAG .
53+
DOCKER_REGISTRY=$(proxygen docker registry | tail -1)
54+
IMAGE_ID=$(docker images -q nhs-notify-supplier:$SANDBOX_TAG)
55+
docker tag $IMAGE_ID $DOCKER_REGISTRY/nhs-notify-supplier:$SANDBOX_TAG
56+
docker push $DOCKER_REGISTRY/nhs-notify-supplier:$SANDBOX_TAG

.github/actions/build-sdk/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ runs:
5353
- name: Upload API OAS specification artifact
5454
uses: actions/upload-artifact@v4
5555
with:
56-
path: "specification/api"
56+
path: "build"
5757
name: api-oas-specification-${{ inputs.version }}
5858

5959
- name: Upload html artifact

.github/copilot-instructions.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copilot Instructions for NHS Notify Supplier API
2+
3+
## Project Overview
4+
5+
- This repository provides the NHS Notify Supplier API for print suppliers to integrate with NHS Notify message queueing.
6+
- Major components: OpenAPI specification (`specification/api/notify-supplier.yml`), SDKs (`sdk/`), server implementations (`server/`, `src/server/host`), and Lambda handlers (`lambdas/`).
7+
- Data flows: API requests are modeled via OAS, processed by server/Lambda code, and may interact with AWS services (e.g., S3, database).
8+
9+
## Developer Workflows
10+
11+
- **Build SDKs and Docs:**
12+
- Run `make clean && make build` to generate Python/TypeScript SDKs and HTML docs from the OAS spec.
13+
- Serve docs locally with `make serve` [default](http://localhost:3050).
14+
- **CI/CD:**
15+
- PRs trigger CI via GitHub Actions (`.github/workflows/cicd-1-pull-request.yaml`).
16+
- Merging to `main` creates a pre-release; deployments use `.github/workflows/cicd-3-deploy.yaml`.
17+
- **Dev Environment:**
18+
- Use the provided devcontainer for setup and configuration. Avoid manual SDK changes; always rebuild.
19+
20+
## Project-Specific Conventions
21+
22+
- **SDKs:**
23+
- Never manually edit files in `sdk/`; always regenerate from the OAS spec.
24+
- SDK folder is excluded from git and built/released via CI.
25+
- **Servers:**
26+
- Server code is generated at build time from OAS specs. See `server/` and `src/server/host` for custom logic.
27+
- **Test Data:**
28+
- Use `scripts/test-data` to generate and upload test letters to S3. Example command:
29+
30+
```bash
31+
npm run cli -- create-letter --supplier-id ... --environment ... --awsAccountId ... --letter-id ... --group-id ... --specification-id ... --status PENDING
32+
```
33+
34+
## Integration Points
35+
36+
- **External Services:**
37+
- AWS S3 and database for test data and letter storage.
38+
- OpenAPI Generator CLI for SDK/server generation.
39+
- **Documentation:**
40+
- Latest [docs](https://nhsdigital.github.io/nhs-notify-supplier-api/)
41+
- Local docs: `make serve`
42+
43+
## Key Files & Directories
44+
45+
- `specification/api/notify-supplier.yml`: Main API spec
46+
- `sdk/`: Generated SDKs (Python, TypeScript, CSharp)
47+
- `server/`, `src/server/host`: Server implementations
48+
- `lambdas/`: Lambda handlers
49+
- `scripts/test-data/`: Test data generation scripts
50+
- `docs/`: Documentation source
51+
52+
## Patterns & Examples
53+
54+
- Always regenerate SDKs/servers after spec changes.
55+
- Use Makefile targets for all build/test workflows.
56+
- Reference the README for up-to-date workflow and integration details.
57+
58+
---
59+
For unclear or missing conventions, consult `/README.md` or ask maintainers for guidance.

0 commit comments

Comments
 (0)