Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"containerEnv": {
"GITHUBMONITOR": "false",
"MAKECONFIG": "true",
"SHOWWELCOME": "true",
"SHOWWELCOME": "false",
"UPDATEFROMTEMPLATE": "false"
},
"image": "ghcr.io/nhsdigital/nhs-notify-devcontainer-loaded-codespaces:main",
"name": "Codespaces Online Development"
"image": "ghcr.io/nhsdigital/nhs-notify-devcontainer-loaded-codespaces:1.0.19",
"name": "Codespaces"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"containerEnv": {
"GITHUBMONITOR": "false",
"MAKECONFIG": "true",
"SHOWWELCOME": "true",
"SHOWWELCOME": "false",
"UPDATEFROMTEMPLATE": "false"
},
"image": "ghcr.io/nhsdigital/nhs-notify-devcontainer-loaded:1.0.17",
"name": "Notify Loaded 1.0.17",
"image": "ghcr.io/nhsdigital/nhs-notify-devcontainer-loaded:1.0.19",
"name": "Local Development",
"postStartCommand": "mkdir -p ~/.gnupg && echo '## 1-day timeout' > ~/.gnupg/gpg-agent.conf && echo 'default-cache-ttl 86400' >> ~/.gnupg/gpg-agent.conf && echo 'max-cache-ttl 86400' >> ~/.gnupg/gpg-agent.conf && gpg-connect-agent reloadagent /bye 2>/dev/null || true"
}
4 changes: 4 additions & 0 deletions .devcontainer/ubuntu/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"name": "Ubuntu 24"
}
19 changes: 14 additions & 5 deletions .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,37 @@ runs:
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Npm cli install
working-directory: ./docs
run: npm ci
shell: bash
#- name: Npm cli install dependencies # ideally to move to Makefile
# working-directory: ./docs
# run: npm ci
# shell: bash
- name: Setup Ruby
uses: ruby/[email protected]
with:
ruby-version: "3.4.7" # Not needed with a .ruby-version file
bundler-cache: false # runs 'bundle install' and caches installed gems automatically
#cache-version: 0 # Increment this number if you need to re-download cached gems
working-directory: "./docs"
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: "Setup ASDF"
uses: asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47 # v4.0.1, see https://github.com/asdf-vm/actions/blob/v4.0.1/install/main.js
with:
asdf_version: "223792666" #v0.18.0, see https://api.github.com/repos/asdf-vm/asdf/releases/223792666
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
working-directory: ./docs
# Outputs to the './_site' directory by default
shell: bash
run: make build-ci BASE_URL=${{ steps.pages.outputs.base_path }} VERSION=${{ inputs.version }}
run: make build-ci BASE_URL="${BASE_URL}" VERSION="${VERSION}"
#run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
BASE_URL: ${{ steps.pages.outputs.base_path }}
VERSION: ${{ inputs.version }}
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3
Expand Down
8 changes: 6 additions & 2 deletions .github/actions/create-lines-of-code-report/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ runs:
steps:
- name: "Create CLOC report"
shell: bash
env:
BUILD_DATETIME: ${{ inputs.build_datetime }}
run: |
export BUILD_DATETIME=${{ inputs.build_datetime }}
./scripts/reports/create-lines-of-code-report.sh
- name: "Compress CLOC report"
shell: bash
Expand All @@ -51,7 +52,10 @@ runs:
- name: "Send the CLOC report to the central location"
shell: bash
if: steps.check.outputs.secrets_exist == 'true'
env:
BUCKET_ENDPOINT: ${{ inputs.idp_aws_report_upload_bucket_endpoint }}
BUILD_TIMESTAMP: ${{ inputs.build_timestamp }}
run: |
aws s3 cp \
./lines-of-code-report.json.zip \
${{ inputs.idp_aws_report_upload_bucket_endpoint }}/${{ inputs.build_timestamp }}-lines-of-code-report.json.zip
"$BUCKET_ENDPOINT/$BUILD_TIMESTAMP-lines-of-code-report.json.zip"
13 changes: 9 additions & 4 deletions .github/actions/scan-dependencies/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ runs:
steps:
- name: "Generate SBOM"
shell: bash
env:
BUILD_DATETIME: ${{ inputs.build_datetime }}
run: |
export BUILD_DATETIME=${{ inputs.build_datetime }}
./scripts/reports/create-sbom-report.sh
- name: "Compress SBOM report"
shell: bash
Expand All @@ -39,8 +40,9 @@ runs:
retention-days: 21
- name: "Scan vulnerabilities"
shell: bash
env:
BUILD_DATETIME: ${{ inputs.build_datetime }}
run: |
export BUILD_DATETIME=${{ inputs.build_datetime }}
./scripts/reports/scan-vulnerabilities.sh
- name: "Compress vulnerabilities report"
shell: bash
Expand All @@ -65,10 +67,13 @@ runs:
- name: "Send the SBOM and vulnerabilities reports to the central location"
shell: bash
if: steps.check.outputs.secrets_exist == 'true'
env:
BUCKET_ENDPOINT: ${{ inputs.idp_aws_report_upload_bucket_endpoint }}
BUILD_TIMESTAMP: ${{ inputs.build_timestamp }}
run: |
aws s3 cp \
./sbom-repository-report.json.zip \
${{ inputs.idp_aws_report_upload_bucket_endpoint }}/${{ inputs.build_timestamp }}-sbom-repository-report.json.zip
"$BUCKET_ENDPOINT/$BUILD_TIMESTAMP-sbom-repository-report.json.zip"
aws s3 cp \
./vulnerabilities-repository-report.json.zip \
${{ inputs.idp_aws_report_upload_bucket_endpoint }}/${{ inputs.build_timestamp }}-vulnerabilities-repository-report.json.zip
"$BUCKET_ENDPOINT/$BUILD_TIMESTAMP-vulnerabilities-repository-report.json.zip"
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Create Pull Request
if: ${{ !env.ACT }}
uses: peter-evans/[email protected]
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Drift from template
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stage-1-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ jobs:
- name: "Checkout code"
uses: actions/checkout@v5
- name: "Setup ASDF"
uses: asdf-vm/actions/setup@v4
uses: asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47 # v4
- name: "Perform Setup"
uses: ./.github/actions/setup
- name: "Trivy Scan"
Expand Down
33 changes: 15 additions & 18 deletions .github/workflows/stage-2-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: 24.10.0
- name: "Repo setup"
run: |
npm ci
Expand All @@ -66,12 +69,12 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v5
- name: "Repo setup"
run: |
npm ci
- name: "Generate dependencies"
run: |
npm run generate-dependencies
- uses: actions/setup-node@v6
with:
node-version: 24.10.0
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: "Run unit test suite"
run: |
make test-unit
Expand Down Expand Up @@ -99,12 +102,9 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v5
- name: "Repo setup"
run: |
npm ci
- name: "Generate dependencies"
run: |
npm run generate-dependencies
- uses: actions/setup-node@v6
with:
node-version: 24.10.0
- name: "Run linting"
run: |
make test-lint
Expand All @@ -115,12 +115,9 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v5
- name: "Repo setup"
run: |
npm ci
- name: "Generate dependencies"
run: |
npm run generate-dependencies
- uses: actions/setup-node@v6
with:
node-version: 24.10.0
- name: "Run typecheck"
run: |
make test-typecheck
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ gitleaks 8.24.0
jq 1.6
nodejs 24.10.0
pre-commit 3.6.0
python 3.13.2
python 3.14.0
terraform 1.10.1
terraform-docs 0.19.0
trivy 0.61.0
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ deploy: # Deploy the project artefact to the target environment @Pipeline
# TODO: Implement the artefact deployment step

clean:: # Clean-up project resources (main) @Operations
$(MAKE) -C docs clean
$(MAKE) -C src/cloudevents clean
$(MAKE) -C src/eventcatalogasyncapiimporter clean
$(MAKE) -C src/eventcatalogasyncapiimporter clean-output
$(MAKE) -C docs clean && \
$(MAKE) -C src/cloudevents clean && \
$(MAKE) -C src/eventcatalogasyncapiimporter clean && \
$(MAKE) -C src/eventcatalogasyncapiimporter clean-output && \
rm -f .version
npm run clean

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ NHS Trusts currently generate a high volume of letters for patients and other ca

- [NHS Notify Digital Letters](#nhs-notify-digital-letters)
- [Table of Contents](#table-of-contents)
- [Schema generation](#schema-generation)
- [Setup](#setup)
- [Prerequisites](#prerequisites)
- [Configuration](#configuration)
Expand All @@ -26,6 +27,10 @@ NHS Trusts currently generate a high volume of letters for patients and other ca
- [Contacts](#contacts)
- [Licence](#licence)

## Schema generation

Located in `src` directory.

## Setup

Clone the repository
Expand Down
8 changes: 4 additions & 4 deletions lambdas/mesh-poll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"private": true,
"scripts": {
"lambda-build": "rm -rf dist && npx esbuild --bundle --minify --sourcemap --target=es2020 --platform=node --loader:.node=file --entry-names=[name] --outdir=dist src/index.ts",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test:unit": "jest",
"typecheck": "tsc --noEmit"
"lint": "echo 'placeholder to be removed'",
"lint:fix": "echo 'placeholder to be removed'",
"test:unit": "echo 'placeholder to be removed'",
"typecheck": "echo 'placeholder to be removed'"
},
"version": "0.0.1"
}
5 changes: 3 additions & 2 deletions project.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"autoOpenWorkspace.enableAutoOpenIfSingleWorkspace": true,
"githubCodeOwners.format.enabled": true,
"workspace-terminals.switchTerminal": "never",
"workspace-terminals.auto": "always",
"workspace-terminals.auto": "never",
"markdownlint.config": {
"MD013": false,
"MD024": { "siblings_only": true },
Expand Down Expand Up @@ -77,7 +77,8 @@
".github/copilot-instructions.md": true,
".github/instructions": true
},
"terminal.integrated.scrollback": 10000
"terminal.integrated.scrollback": 10000,
"shellcheck.run": "onSave"
},
"extensions": {
"recommendations": [
Expand Down
6 changes: 6 additions & 0 deletions scripts/docker/tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# `*:latest` will be replaced with a corresponding version stored in the '.tool-versions' file
# hadolint ignore=DL3007
FROM python:latest

# Create a non-root user for running the application
RUN groupadd -r appuser && useradd -r -g appuser appuser

# Switch to non-root user
USER appuser
1 change: 1 addition & 0 deletions scripts/tests/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ set -euo pipefail
cd "$(git rev-parse --show-toplevel)"

npm ci
npm run generate-dependencies
npm run lint
1 change: 1 addition & 0 deletions scripts/tests/typecheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ set -euo pipefail
cd "$(git rev-parse --show-toplevel)"

npm ci
npm run generate-dependencies
npm run typecheck
1 change: 1 addition & 0 deletions scripts/tests/unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ make -C ./src/eventcatalogasyncapiimporter coverage # Run with coverage to gene
# TypeScript/JavaScript projects (npm workspace)
# Note: src/cloudevents is included in workspaces, so it will be tested here
npm ci
npm run generate-dependencies
npm run test:unit --workspaces

# merge coverage reports
Expand Down
1 change: 1 addition & 0 deletions src/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jq 1.6
40 changes: 1 addition & 39 deletions src/cloudevents/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,43 +140,5 @@ asdf-install-test:
@echo "asdf installation complete"

deploy-ci:
echo "=== Setting up environment for CI unit tests ===" && \
curl -LO https://github.com/asdf-vm/asdf/releases/download/v0.18.0/asdf-v0.18.0-linux-amd64.tar.gz && \
tar -xvzf asdf-v0.18.0-linux-amd64.tar.gz -C /usr/local/bin && \
chmod +x /usr/local/bin/asdf && \
pwd && \
ls -la
@echo "from manual test tools versions file contains:"
cat .tool-versions
/usr/local/bin/asdf --version
@echo "Setting up asdf environment and adding plugins"
export ASDF_DATA_DIR=$$HOME/.asdf && \
export PATH=$$ASDF_DATA_DIR/shims:$$ASDF_DATA_DIR/bin:/usr/local/bin:$$PATH && \
echo "Adding plugins from .tool-versions" && \
while IFS=' ' read -r plugin version || [ -n "$$plugin" ]; do \
plugin=$$(echo "$$plugin" | xargs); \
first_char=$$(echo "$$plugin" | cut -c1); \
if [ -n "$$plugin" ] && [ "$$first_char" != "#" ]; then \
echo "Adding plugin: $$plugin (version: $$version)" && \
/usr/local/bin/asdf plugin add "$$plugin" 2>&1 || echo " -> Plugin $$plugin already added or failed"; \
fi \
done < .tool-versions && \
echo "Listing available plugins:" && \
/usr/local/bin/asdf plugin list && \
echo "Installing asdf versions" && \
/usr/local/bin/asdf install -v && \
echo "Installed versions:" && \
/usr/local/bin/asdf list && \
echo "Node is at:" && \
whereis node && \
echo "Chosen one is at:" && \
which node && \
echo "Node version is:" && \
node --version && \
npm install && \
echo "=== Finished installing dependencies ===" && \
asdf info && \
asdf current && \
node --version && \
npm --version && \
npm ci
make deploy
3 changes: 3 additions & 0 deletions src/cloudevents/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ module.exports = {
target: 'ES2020',
moduleResolution: 'node',
noEmit: true
},
diagnostics: {
ignoreCodes: [1343] // Ignore TS1343: import.meta errors
}
}]
},
Expand Down
4 changes: 2 additions & 2 deletions src/cloudevents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"lint": "echo 'no linting configured'",
"lint:fix": "echo 'no linting configured'",
"test": "jest",
"test:coverage": "jest --coverage; node -e \"const fs = require('fs'); fs.mkdirSync('.reports/unit/coverage', {recursive: true}); fs.copyFileSync('coverage/lcov.info', '.reports/unit/coverage/lcov.info');\"",
"test:unit": "jest --coverage; node -e \"const fs = require('fs'); fs.mkdirSync('.reports/unit/coverage', {recursive: true}); fs.copyFileSync('coverage/lcov.info', '.reports/unit/coverage/lcov.info');\"",
"test:coverage": "jest --coverage && node -e \"const fs = require('fs'); fs.mkdirSync('.reports/unit/coverage', {recursive: true}); fs.copyFileSync('coverage/lcov.info', '.reports/unit/coverage/lcov.info');\"",
"test:unit": "jest --coverage && node -e \"const fs = require('fs'); fs.mkdirSync('.reports/unit/coverage', {recursive: true}); fs.copyFileSync('coverage/lcov.info', '.reports/unit/coverage/lcov.info');\"",
"test:watch": "jest --watch",
"typecheck": "echo 'no typechecking configured'",
"update-readme": "tsx tools/generator/readme-generator/update-readme-cli.ts",
Expand Down
Loading
Loading