Skip to content

Feature/ccm 16073 test fresh state#182

Closed
mjewildnhs wants to merge 67 commits intomainfrom
feature/CCM-16073-test-fresh-state
Closed

Feature/ccm 16073 test fresh state#182
mjewildnhs wants to merge 67 commits intomainfrom
feature/CCM-16073-test-fresh-state

Conversation

@mjewildnhs
Copy link
Copy Markdown
Contributor

Description

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

rhyscoxnhs and others added 30 commits April 29, 2026 16:31
* ALB/webhook uses https for mTLS and non mTLS - remove http endpoint

* Log thrown errors in http-client-lambda

* Update int test debug script

* Update SQS to webhook int tests to use correct queues

* Update debug int script README

* Fix redis script error and better logging for redis errors

* Log status code of perm failures

* fix: load test CA for server trust when mtls is disabled

In test environments, the mock webhook ALB uses a server certificate
signed by a locally-generated test CA. Previously, the CA was only
loaded into the TLS agent when mtls.enabled was true (needed for
client certificate auth). Targets with mtls.enabled: false used
Node's default trust store, which does not include the test CA,
causing every delivery attempt to fail with SELF_SIGNED_CERT_IN_CHAIN.

Fix by loading the CA whenever MTLS_TEST_CA_S3_KEY is set, regardless
of mtls.enabled. The client key and cert are still only applied when
mtls.enabled is true. MTLS_TEST_CA_S3_KEY is not set in production,
so non-mTLS targets in production are unaffected.

* fix: set ERROR_CODE and ERROR_MESSAGE on DLQ messages for permanent delivery failures

AWS API Destinations previously set these SQS message attributes automatically.
After the migration to the https-client lambda, they were no longer being set.

- Read the response body for 4xx responses (previously discarded with res.resume())
  so the error message can be included in the DLQ message attributes
- Set ERROR_CODE=HTTP_CLIENT_ERROR for 4xx webhook rejections, or the TLS error
  code (e.g. CERT_HAS_EXPIRED) for connection-level failures
- Set ERROR_MESSAGE to the message field from the JSON response body, falling
  back to the raw body if not valid JSON
- Extended sendToDlq to accept and forward MessageAttributes to SQS

* Fix redrive IT dlq names

* Fix metric IT dlq names

* Fix alarm test

* Bump test coverage

* Fix redis client IAM / connectivity issues + logging improvements
* CCM-16002 - Revised performance test implementation
* Rename mock-client-1/2 and add mtls test

* Retry window and exhaustion test

* DLQ redrive delivery queue test

* Metric test coverage

* Rate limit tests

* Fix: reset metrics per invocation

* Fix new tests to use UUIDs as message ids rather than timestamps

* Add correlation id to logging

* Batch count logging

* Circuit breaker test

* Integration test tidy up refactor

* Log receive count and sqsMessageId

* Fix batch success count on DLQ

* Log receive count for all messages
* CCM-16073 - Updated rate limiting behaviour

Co-authored-by: Mike Wild <mike.wild5@nhs.net>
Co-authored-by: Tim Marston <tim.marston2@nhs.net>
mjewildnhs and others added 28 commits May 5, 2026 17:15
- Performance test changes and throughput optimisation

---------

Co-authored-by: rhyscoxnhs <rhys.cox6@nhs.net>
* CCM-16073 - Initial work on infra refactor

* CCM-16073 - PR feedback

* CCM-16073 - PR feedback

* CCM-16073 - PR feedback
@mjewildnhs mjewildnhs closed this May 7, 2026
@mjewildnhs mjewildnhs deleted the feature/CCM-16073-test-fresh-state branch May 7, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants