Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
8d46f46
CCM-16073 - Enhanced callbacks
rhyscoxnhs Apr 14, 2026
cba6b10
CCM-16073 - Fixed lints
rhyscoxnhs Apr 17, 2026
11319b1
CCM-16073 - Fixed terraform
rhyscoxnhs Apr 17, 2026
d4b4f70
CCM-16073 - Fixed terraform
rhyscoxnhs Apr 17, 2026
dba2894
CCM-16073 - Attempt to trigger a fresh build
rhyscoxnhs Apr 17, 2026
3cd6e4d
CCM-16073 - Fixed terraform
rhyscoxnhs Apr 17, 2026
6810e97
updated gitignore
cgitim Apr 17, 2026
e46720c
updated vale acceptable words
cgitim Apr 17, 2026
0765ef1
updated docs for npm->pnpm changeover
cgitim Apr 17, 2026
5b76a87
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
f6c0532
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
a53ed73
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
4e59c1c
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
af98725
Lua unit tests
mjewildnhs Apr 17, 2026
0bbcd79
Add luacheck to pre-commit and fix issue
mjewildnhs Apr 17, 2026
b7297d7
luacheck in CI workflow
mjewildnhs Apr 17, 2026
e4cd754
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
c55139d
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
3cf99aa
CCM-16073 - PR feedback
rhyscoxnhs Apr 20, 2026
6262f2f
CCM-16073 - PR feedback
rhyscoxnhs Apr 21, 2026
7297c18
CCM-16073 - PR feedback
rhyscoxnhs Apr 21, 2026
0ab926d
CCM-16073 - PR feedback
rhyscoxnhs Apr 22, 2026
dc4343a
CCM-16073 - PR feedback
rhyscoxnhs Apr 22, 2026
b25a822
CCM-16073 - Integration test fixes (#152)
mjewildnhs Apr 22, 2026
91d993f
Set the SPKI hash for test client config
mjewildnhs Apr 21, 2026
d4d304c
CCM-16002 - Revised performance test implementation (#123)
rhyscoxnhs Apr 23, 2026
ebf9e81
CCM-16073 - ITs, metrics fix, log correlationId (#156)
mjewildnhs Apr 24, 2026
39d70f3
Fix DLQ on delivery
mjewildnhs Apr 27, 2026
4093022
CCM-16073 - Updated rate limiting behaviour (#158)
rhyscoxnhs Apr 29, 2026
7bcb460
Fix flakey retry policy tests
mjewildnhs Apr 29, 2026
0b5cdda
CCM-16073 - Addressed PR feedback
rhyscoxnhs Apr 30, 2026
8de4274
consistency and naming changes
cgitim Apr 30, 2026
e78cda1
CCM-16073 - Addressed PR feedback
rhyscoxnhs May 1, 2026
1455012
Update IT test assertion following observability changes
mjewildnhs May 1, 2026
070b3d7
Fix initial state when circuit breaker enabled
mjewildnhs May 1, 2026
c8207c0
Fix debug int test script
mjewildnhs May 1, 2026
624f706
Fix circuit breaker IT test assertion following observability changes
mjewildnhs May 1, 2026
5a7a5a7
remove shim for migrated logger
cgitim May 5, 2026
812d50e
removed dead src/config-cache
cgitim May 5, 2026
a8fcc47
CCM-16073 - Performance test changes and concurrency optimisation (#173)
mjewildnhs May 5, 2026
dfe1ed5
intent: generate idempotencyKey from attributes
cgitim May 6, 2026
768d110
CCM-16073 - Initial work on infra refactor (#177)
rhyscoxnhs May 6, 2026
9555f12
Merge branch 'main' into feature/CCM-16073
rhyscoxnhs May 6, 2026
75f1c81
Set appropriate resolutions for all metrics
mjewildnhs May 6, 2026
38595d1
Fix tf example comment
mjewildnhs May 6, 2026
425ce1c
linting fix
cgitim May 6, 2026
fa98f6e
CCM-16073 - Fixed build
rhyscoxnhs May 6, 2026
76384e1
CCM-16073 - PR feedback
rhyscoxnhs May 6, 2026
f524631
CCM-16073 - PR feedback
rhyscoxnhs May 6, 2026
6500c5d
CCM-16073 - PR feedback
rhyscoxnhs May 7, 2026
04c301f
CCM-16073 - PR feedback
rhyscoxnhs May 7, 2026
e08a5d2
Refactor/bolster rate limit unit tests
mjewildnhs May 7, 2026
fda5541
Fix unit test resolves deployment context with defaults' when AWS_PRO…
mjewildnhs May 7, 2026
508a1a6
Refactor metrics test to avoid repetition
mjewildnhs May 7, 2026
b1b0d88
Refactor consistency in http lambda env var test overrides
mjewildnhs May 7, 2026
ec872a6
Refactor http lambda handler admission denied duplication and added D…
mjewildnhs May 7, 2026
e996fbe
Refactor http lambda handler - improved readability of processTargetB…
mjewildnhs May 7, 2026
1a2a922
Merge branch 'main' into feature/CCM-16073
cgitim May 7, 2026
740f513
Improve http lambda error resilience
mjewildnhs May 7, 2026
cbf01fc
Fix flawed http lambda tests
mjewildnhs May 7, 2026
0011275
Better grouping on handler tests
mjewildnhs May 7, 2026
200875c
Fix tls agent test assertions
mjewildnhs May 7, 2026
cc35c24
Update subscription tool README
mjewildnhs May 7, 2026
b8ccd6f
Ensure all sub tool CLI options output when doing dry run
mjewildnhs May 7, 2026
1e9510a
Remove nosiy redis client logging
mjewildnhs May 7, 2026
95bb5ea
Flakey circuit breaker test fix
mjewildnhs May 7, 2026
95bdb23
Log if IT purge fails due do 1 being in progress
mjewildnhs May 7, 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
3 changes: 2 additions & 1 deletion .github/actions/acceptance-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ runs:
shell: bash
env:
PROJECT: nhs
COMPONENT: ${{ inputs.targetComponent }}
COMPONENT: cb
CLIENT_COMPONENT: cbc
run: |
make test-${{ inputs.testType }}
10 changes: 10 additions & 0 deletions .github/workflows/stage-2-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,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
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ h help:
@egrep '^\S|^$$' Makefile

install:
pnpm install
npm install
bundle config set --local path vendor/bundle
bundle install

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
19 changes: 14 additions & 5 deletions infrastructure/terraform/components/callbacks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,23 @@
|------|---------|
| <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 |
|------|-------------|------|---------|:--------:|
| <a name="input_applications_map_parameter_name"></a> [applications\_map\_parameter\_name](#input\_applications\_map\_parameter\_name) | SSM Parameter Store path for the clientId-to-applicationData map, where applicationData is currently only the applicationId | `string` | `null` | no |
| <a name="input_aws_account_id"></a> [aws\_account\_id](#input\_aws\_account\_id) | The AWS Account ID (numeric) | `string` | n/a | yes |
| <a name="input_cb_cooldown_period_ms"></a> [cb\_cooldown\_period\_ms](#input\_cb\_cooldown\_period\_ms) | Full block duration after circuit opens, before half-open probes begin (ms) | `number` | `120000` | no |
| <a name="input_cb_recovery_period_ms"></a> [cb\_recovery\_period\_ms](#input\_cb\_recovery\_period\_ms) | Linear ramp-up duration after circuit closes (ms) | `number` | `600000` | no |
| <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_delivery_lambda_batch_size"></a> [delivery\_lambda\_batch\_size](#input\_delivery\_lambda\_batch\_size) | Number of SQS messages per delivery Lambda invocation | `number` | `100` | no |
| <a name="input_delivery_lambda_batching_window_sec"></a> [delivery\_lambda\_batching\_window\_sec](#input\_delivery\_lambda\_batching\_window\_sec) | Maximum time in seconds to wait for a full batch before invoking the delivery Lambda | `number` | `1` | 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,25 +37,27 @@
| <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_ca_s3_key"></a> [mtls\_ca\_s3\_key](#input\_mtls\_ca\_s3\_key) | S3 key for the CA certificate PEM bundle used for server verification | `string` | `""` | no |
| <a name="input_mtls_cert_s3_key"></a> [mtls\_cert\_s3\_key](#input\_mtls\_cert\_s3\_key) | S3 key for the mTLS client certificate PEM bundle | `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 |
| <a name="input_pipe_sqs_input_batch_size"></a> [pipe\_sqs\_input\_batch\_size](#input\_pipe\_sqs\_input\_batch\_size) | n/a | `number` | `1` | no |
| <a name="input_pipe_sqs_input_batch_size"></a> [pipe\_sqs\_input\_batch\_size](#input\_pipe\_sqs\_input\_batch\_size) | n/a | `number` | `10` | no |
| <a name="input_pipe_sqs_max_batch_window"></a> [pipe\_sqs\_max\_batch\_window](#input\_pipe\_sqs\_max\_batch\_window) | n/a | `number` | `2` | no |
| <a name="input_project"></a> [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | The AWS Region | `string` | n/a | yes |
| <a name="input_s3_enable_force_destroy"></a> [s3\_enable\_force\_destroy](#input\_s3\_enable\_force\_destroy) | Whether to enable force destroy for the S3 buckets created in this module | `bool` | `false` | no |
| <a name="input_sqs_inbound_event_max_receive_count"></a> [sqs\_inbound\_event\_max\_receive\_count](#input\_sqs\_inbound\_event\_max\_receive\_count) | n/a | `number` | `3` | no |
| <a name="input_sqs_inbound_event_visibility_timeout_seconds"></a> [sqs\_inbound\_event\_visibility\_timeout\_seconds](#input\_sqs\_inbound\_event\_visibility\_timeout\_seconds) | n/a | `number` | `60` | no |
| <a name="input_token_bucket_burst_capacity"></a> [token\_bucket\_burst\_capacity](#input\_token\_bucket\_burst\_capacity) | Token bucket burst capacity used by the rate limiter | `number` | `2250` | no |
## Modules

| 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_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