Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
816b60f
CCM-16073 - Enhanced callbacks
rhyscoxnhs Apr 14, 2026
093116f
CCM-16073 - Fixed lints
rhyscoxnhs Apr 17, 2026
2a69889
CCM-16073 - Fixed terraform
rhyscoxnhs Apr 17, 2026
ff91280
CCM-16073 - Fixed terraform
rhyscoxnhs Apr 17, 2026
dd07009
CCM-16073 - Attempt to trigger a fresh build
rhyscoxnhs Apr 17, 2026
b63f1c2
CCM-16073 - Fixed terraform
rhyscoxnhs Apr 17, 2026
fdb370b
updated gitignore
cgitim Apr 17, 2026
c10bbc4
updated vale acceptable words
cgitim Apr 17, 2026
5fcb9c4
updated docs for npm->pnpm changeover
cgitim Apr 17, 2026
7fff93b
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
a5e7557
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
e072fa4
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
809fb0c
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
1e62b96
Lua unit tests
mjewildnhs Apr 17, 2026
83b81c2
Add luacheck to pre-commit and fix issue
mjewildnhs Apr 17, 2026
ef9f599
luacheck in CI workflow
mjewildnhs Apr 17, 2026
ac4edda
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
854c196
Merge branch 'main' into feature/CCM-16073
rhyscoxnhs Apr 20, 2026
79fa949
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
5786a46
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
6fd8bb0
CCM-16073 - PR feedback
rhyscoxnhs Apr 21, 2026
db9dc4d
CCM-16073 - PR feedback
rhyscoxnhs Apr 21, 2026
6d8c9b1
CCM-16073 - PR feedback
rhyscoxnhs Apr 22, 2026
1b3eaf8
CCM-16073 - PR feedback
rhyscoxnhs Apr 22, 2026
d61f693
CCM-16073 - Integration test fixes (#152)
mjewildnhs Apr 22, 2026
cb0b020
Set the SPKI hash for test client config
mjewildnhs Apr 21, 2026
a17dca4
CCM-16002 - Revised performance test implementation (#123)
rhyscoxnhs Apr 23, 2026
4a68a0f
CCM-16073 - ITs, metrics fix, log correlationId (#156)
mjewildnhs Apr 24, 2026
6f230ba
Fix DLQ on delivery
mjewildnhs Apr 27, 2026
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
10 changes: 10 additions & 0 deletions .github/workflows/stage-2-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ jobs:
- name: "Run linting"
run: |
make test-lint
test-lua-lint:
name: "Lua linting"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: "Run luacheck"
run: |
make test-lua-lint
test-typecheck:
name: "Typecheck"
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ version.json

# Please, add your custom content below!

# dependencies
# Dependencies
node_modules
.node-version
*/node_modules
Expand All @@ -22,3 +22,4 @@ node_modules
dist
.DS_Store
.reports
*~
12 changes: 12 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"diagnostics": {
"globals": [
"KEYS",
"ARGV",
"redis",
"cjson",
"cmsgpack",
"bit"
]
}
}
18 changes: 9 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ Agents should look for a nested `AGENTS.md` in or near these areas before making

## Root package.json – role and usage

The root `package.json` is the orchestration manifestgit co for this repo. It does not ship application code; it wires up shared dev tooling and delegates to workspace-level projects.
The root `package.json` is the orchestration manifest for this repo. It does not ship application code; it wires up shared dev tooling and delegates to workspace-level projects.

- Workspaces: Declares the set of npm workspaces (e.g. under `lambdas/`, `utils/`, `tests/`, `scripts/`). Agents should add a new workspace path here when introducing a new npm project.
- Scripts: Provides top-level commands that fan out across workspaces using `--workspaces` (lint, typecheck, unit tests) and project-specific runners (e.g. `lambda-build`).
- Workspaces: Declares the set of pnpm workspaces (e.g. under `lambdas/`, `utils/`, `tests/`, `scripts/`). Agents should add a new workspace path here when introducing a new pnpm project.
- Scripts: Provides top-level commands that fan out across workspaces using `pnpm -r` (lint, typecheck, unit tests) and project-specific runners (e.g. `lambda-build`).
- Dev tool dependencies: Centralises Jest, TypeScript, ESLint configurations and plugins to keep versions consistent across workspaces. Workspace projects should rely on these unless a local override is strictly needed.
- Overrides/resolutions: Pins transitive dependencies (e.g. Jest/react-is) to avoid ecosystem conflicts. Agents must not remove overrides without verifying tests across all workspaces.

Agent guidance:

- Before adding or removing a workspace, update the root `workspaces` array and ensure CI scripts still succeed with `npm run lint`, `npm run typecheck`, and `npm run test:unit` at the repo root.
- When adding repo-wide scripts, keep names consistent with existing patterns (e.g. `lint`, `lint:fix`, `typecheck`, `test:unit`, `lambda-build`) and prefer `--workspaces` fan-out.
- Before adding or removing a workspace, update the root `workspaces` array and ensure CI scripts still succeed with `pnpm run lint`, `pnpm run typecheck`, and `pnpm run test:unit` at the repo root.
- When adding repo-wide scripts, keep names consistent with existing patterns (e.g. `lint`, `lint:fix`, `typecheck`, `test:unit`, `lambda-build`) and prefer `pnpm -r` fan-out.
- Do not publish from the root. If adding a new workspace intended for publication, mark that workspace package as `private: false` and keep the root as private.
- Validate changes by running the repo pre-commit hooks: `make githooks-run`.

Success criteria for changes affecting the root `package.json`:

- `npm run lint`, `npm run typecheck`, and `npm run test:unit` pass at the repo root.
- Workspace discovery is correct (new projects appear under `npm run typecheck --workspaces`).
- No regression in lambda build tooling (`npm run lambda-build`).
- `pnpm run lint`, `pnpm run typecheck`, and `pnpm run test:unit` pass at the repo root.
- Workspace discovery is correct (new projects appear under `pnpm run typecheck -r`).
- No regression in lambda build tooling (`pnpm run lambda-build`).

## What Agents Can / Can’t Do

Expand Down Expand Up @@ -81,7 +81,7 @@ When proposing a change, agents should:

to catch formatting and basic lint issues. Domain specific checks will be defined in appropriate nested AGENTS.md files.

- Suggest at least one extra validation step (for example `npm test:unit` in a lambda, or triggering a specific workflow).
- Suggest at least one extra validation step (for example `pnpm run test:unit` in a lambda, or triggering a specific workflow).
- Any required follow up activites which fall outside of the current task's scope should be clearly marked with a 'TODO: CCM-12345' comment. The human user should be prompted to create and provide a JIRA ticket ID to be added to the comment.

## Security & Safety
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ make config
Run unit tests for Lambda functions:

```shell
npm test
pnpm test:unit
```

## Infrastructure
Expand Down
4 changes: 2 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ $(if $(BASE_URL),-- --baseurl $(BASE_URL),-- --baseurl "")
endef

build: version
npm run build $(baseurlparam)
pnpm run build $(baseurlparam)

debug: version
npm run debug
pnpm run debug

version:
touch _config.version.yml
Expand Down
4 changes: 2 additions & 2 deletions docs/test-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ AI must:
- Verify mock return types match the actual function return types.

7. **The "Test Execution" Mandate**:
- After creating or modifying a test, you MUST run it using the repo's test command - e.g. npm run test:unit
- After creating or modifying a test, you MUST run it using the repo's test command - e.g. pnpm run test:unit
- If the test fails due to incorrect imports, paths, or signatures, fix and re-run.
- Only report completion when the test passes (exit code 0) and test coverage checks also pass.
- See section 6.2 for the full self-correction loop requirements.
Expand Down Expand Up @@ -192,7 +192,7 @@ AI must:

When AI changes tests, it must:

- run all the tests in the npm workspace.
- run all the tests in the pnpm workspace.
- report exactly what it ran and whether it passed.

### 6.2 AI Self-Correction Loop
Expand Down
3 changes: 2 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default defineConfig([
"**/test-results",
"**/playwright-report*",
"eslint.config.mjs",
"**/lua-transform.js",
]),

//imports
Expand Down Expand Up @@ -200,7 +201,7 @@ export default defineConfig([
},
},
{
files: ["**/utils/**", "tests/test-team/**", "tests/performance/helpers/**", "lambdas/**/src/**"],
files: ["**/utils/**", "tests/test-team/**", "tests/performance/helpers/**", "lambdas/**/src/**", "src/**/src/**"],
rules: {
"import-x/prefer-default-export": 0,
},
Expand Down
9 changes: 8 additions & 1 deletion infrastructure/terraform/components/callbacks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.10.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | 6.13 |
| <a name="requirement_external"></a> [external](#requirement\_external) | ~> 2.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | ~> 3.0 |
| <a name="requirement_tls"></a> [tls](#requirement\_tls) | ~> 4.0 |
## Inputs

| Name | Description | Type | Default | Required |
Expand All @@ -18,6 +20,8 @@
| <a name="input_component"></a> [component](#input\_component) | The variable encapsulating the name of this component | `string` | `"callbacks"` | no |
| <a name="input_default_tags"></a> [default\_tags](#input\_default\_tags) | A map of default tags to apply to all taggable resources within the component | `map(string)` | `{}` | no |
| <a name="input_deploy_mock_clients"></a> [deploy\_mock\_clients](#input\_deploy\_mock\_clients) | Flag to deploy mock webhook lambda for integration testing (test/dev environments only) | `bool` | `false` | no |
| <a name="input_deploy_perf_runner"></a> [deploy\_perf\_runner](#input\_deploy\_perf\_runner) | Flag to deploy the perf-runner lambda for performance testing (test/dev environments only) | `bool` | `false` | no |
| <a name="input_elasticache_data_storage_maximum_gb"></a> [elasticache\_data\_storage\_maximum\_gb](#input\_elasticache\_data\_storage\_maximum\_gb) | Maximum data storage in GB for the ElastiCache Serverless delivery state cache | `number` | `1` | no |
| <a name="input_enable_event_anomaly_detection"></a> [enable\_event\_anomaly\_detection](#input\_enable\_event\_anomaly\_detection) | Enable CloudWatch anomaly detection alarm for inbound event queue message reception | `bool` | `true` | no |
| <a name="input_enable_xray_tracing"></a> [enable\_xray\_tracing](#input\_enable\_xray\_tracing) | Enable AWS X-Ray active tracing for Lambda functions | `bool` | `false` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the tfscaffold environment | `string` | n/a | yes |
Expand All @@ -30,6 +34,7 @@
| <a name="input_log_level"></a> [log\_level](#input\_log\_level) | The log level to be used in lambda functions within the component. Any log with a lower severity than the configured value will not be logged: https://docs.python.org/3/library/logging.html#levels | `string` | `"INFO"` | no |
| <a name="input_log_retention_in_days"></a> [log\_retention\_in\_days](#input\_log\_retention\_in\_days) | The retention period in days for the Cloudwatch Logs events to be retained, default of 0 is indefinite | `number` | `0` | no |
| <a name="input_message_root_uri"></a> [message\_root\_uri](#input\_message\_root\_uri) | The root URI used for constructing message links in callback payloads | `string` | n/a | yes |
| <a name="input_mtls_cert_secret_arn"></a> [mtls\_cert\_secret\_arn](#input\_mtls\_cert\_secret\_arn) | Secrets Manager ARN for the shared mTLS client certificate (production) | `string` | `""` | no |
| <a name="input_parent_acct_environment"></a> [parent\_acct\_environment](#input\_parent\_acct\_environment) | Name of the environment responsible for the acct resources used, affects things like DNS zone. Useful for named dev environments | `string` | `"main"` | no |
| <a name="input_pipe_event_patterns"></a> [pipe\_event\_patterns](#input\_pipe\_event\_patterns) | value | `list(string)` | `[]` | no |
| <a name="input_pipe_log_level"></a> [pipe\_log\_level](#input\_pipe\_log\_level) | Log level for the EventBridge Pipe. | `string` | `"ERROR"` | no |
Expand All @@ -45,10 +50,12 @@
| Name | Source | Version |
|------|--------|---------|
| <a name="module_client_config_bucket"></a> [client\_config\_bucket](#module\_client\_config\_bucket) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-s3bucket.zip | n/a |
| <a name="module_client_destination"></a> [client\_destination](#module\_client\_destination) | ../../modules/client-destination | n/a |
| <a name="module_client_delivery"></a> [client\_delivery](#module\_client\_delivery) | ../../modules/client-delivery | n/a |
| <a name="module_client_transform_filter_lambda"></a> [client\_transform\_filter\_lambda](#module\_client\_transform\_filter\_lambda) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-lambda.zip | n/a |
| <a name="module_kms"></a> [kms](#module\_kms) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-kms.zip | n/a |
| <a name="module_mock_webhook_lambda"></a> [mock\_webhook\_lambda](#module\_mock\_webhook\_lambda) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-lambda.zip | n/a |
| <a name="module_mtls_test_certs_bucket"></a> [mtls\_test\_certs\_bucket](#module\_mtls\_test\_certs\_bucket) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-s3bucket.zip | n/a |
| <a name="module_perf_runner_lambda"></a> [perf\_runner\_lambda](#module\_perf\_runner\_lambda) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-lambda.zip | n/a |
| <a name="module_sqs_inbound_event"></a> [sqs\_inbound\_event](#module\_sqs\_inbound\_event) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.7/terraform-sqs.zip | n/a |
## Outputs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ resource "aws_cloudwatch_event_bus" "main" {
name = local.csi
kms_key_identifier = module.kms.key_arn
}

resource "aws_cloudwatch_event_archive" "main" {
name = "${local.csi}-archive"
event_source_arn = aws_cloudwatch_event_bus.main.arn
retention_days = 7
}

This file was deleted.

Loading
Loading