Skip to content

New: [AEA-6269] - Switched to new zero downtime deployment system#1864

Open
MatthewPopat-NHS wants to merge 28 commits intomainfrom
AEA-6269
Open

New: [AEA-6269] - Switched to new zero downtime deployment system#1864
MatthewPopat-NHS wants to merge 28 commits intomainfrom
AEA-6269

Conversation

@MatthewPopat-NHS
Copy link
Contributor

Summary

  • ✨ New Feature
  • ⚠️ Potential issues that might be caused by this change

Details

  • Switched to new dev container
  • Simplified pipelines
  • Switched from jest to ViTest

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket:

AEA-6269

Copilot AI review requested due to automatic review settings March 18, 2026 11:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the build/deploy toolchain to support the new zero-downtime deployment approach by shifting CDK execution to a new “MainDeploymentApp” model, simplifying CloudFront routing/functions, and updating CI/CD and devcontainer workflows accordingly.

Changes:

  • Reworked CDK apps/stacks/constructs to use @nhsdigital/eps-cdk-constructs + a new MainDeploymentApp entrypoint.
  • Simplified CloudFront routing (new /api/* and /oauth2/* paths) and refactored CloudFront Functions/log delivery.
  • Updated CI workflows/devcontainer tooling and removed legacy guard/license-check scripts and some CDK tests/config.

Reviewed changes

Copilot reviewed 88 out of 95 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
scripts/run_sync.sh Uses new npm run cdk-watch flow for local sync
scripts/run_cfn_guard.sh Removed CFN Guard script
scripts/check_python_licenses.sh Removed python license check script
packages/trackerUserInfoLambda/package.json Removed check-licenses script
packages/testingSupport/clearActiveSessions/package.json Removed check-licenses script
packages/sessionManagementLambda/package.json Removed check-licenses script
packages/selectedRoleLambda/package.json Removed check-licenses script
packages/prescriptionListLambda/src/handler.ts Removes roleId env var usage
packages/prescriptionListLambda/package.json Removed check-licenses script
packages/prescriptionDetailsLambda/package.json Removed check-licenses script
packages/patientSearchLambda/package.json Removed check-licenses script
packages/cpt-ui/vite-env.d.ts Updates Vite env typings
packages/cpt-ui/src/helpers/awsRum.tsx RUM config behavior changed/hardcoded
packages/cpt-ui/src/constants/environment.ts Redirects now derived from CloudFront domain
packages/cpt-ui/package.json Keeps Jest test script
packages/cpt-ui/jest.setup.ts Updates mocked env config
packages/cpt-ui/tests/awsRumHelper.test.tsx Updates expectations for RUM config
packages/cpt-ui/tests/LoginPage.test.tsx Updates mocked env config
packages/cpt-ui/tests/EpsPrescriptionList.test.tsx Updates mocked env/RUM config
packages/common/testing/package.json Removed check-licenses script
packages/common/pdsClient/package.json Removed check-licenses script
packages/common/middyErrorHandler/package.json Removed check-licenses script
packages/common/lambdaUtils/package.json Removed check-licenses script
packages/common/dynamoFunctions/package.json Removed check-licenses script
packages/common/doHSClient/package.json Removed check-licenses script
packages/common/commonTypes/package.json Removed check-licenses script
packages/common/authFunctions/package.json Removed check-licenses script
packages/cognito/package.json Removed check-licenses script
packages/cloudfrontFunctions/tests/testS3StaticContentUriRewrite.test.ts Simplified rewrite test cases
packages/cloudfrontFunctions/tests/testS3404ModifyStatusCode.test.ts Removed test file
packages/cloudfrontFunctions/tests/testGenericStripPathUriRewrite.test.ts Removed test file
packages/cloudfrontFunctions/tests/testGenericS3FixedObjectUriRewrite.test.ts Removed test file
packages/cloudfrontFunctions/src/s3StaticContentUriRewrite.js Simplified static content URI rewrite
packages/cloudfrontFunctions/src/s3404ModifyStatusCode.js Removed CloudFront function
packages/cloudfrontFunctions/src/genericStripPathUriRewrite.js Removed CloudFront function
packages/cloudfrontFunctions/src/genericS3FixedObjectUriRewrite.js Removed CloudFront function
packages/cloudfrontFunctions/src/cloudfront/package.json Removed test mock module
packages/cloudfrontFunctions/src/cloudfront/index.js Removed test mock module
packages/cloudfrontFunctions/package.json Removes local mock dependency; license script removed
packages/cdk/tests/src/dummyLambda.ts Removed CDK test helper
packages/cdk/tests/functionConstruct.test.ts Removed CDK construct tests
packages/cdk/tests/cdk-nag.test.ts Removed CDK nag test
packages/cdk/stacks/UsCertsStack.ts Stack props/resources refactor (new props model)
packages/cdk/stacks/StatefulResourcesStack.ts Stack props/resources refactor; exports reduced
packages/cdk/resources/usRegionLogGroups.ts Optional CSOC destination logic
packages/cdk/resources/ukRegionLogGroups.ts Optional CSOC destination logic
packages/cdk/resources/api/oauth2Functions.ts Migrate to TypescriptLambdaFunction and new props
packages/cdk/resources/api/apiFunctions.ts Migrate to TypescriptLambdaFunction and new props
packages/cdk/resources/WebApplicationFirewall.ts New allow-list model + rule wiring changes
packages/cdk/resources/StaticContentBucket.ts New KMS + bucket policies; auto-delete enabled
packages/cdk/resources/SharedSecrets.ts Secrets now injected from config (incl. JWT key)
packages/cdk/resources/Rum.ts RUM resource refactor; config changes
packages/cdk/resources/RestApiGateway/RestApiGatewayMethods.ts API routes now under /api/*
packages/cdk/resources/RestApiGateway/OAuth2ApiGatewayMethods.ts OAuth2 routes now under /oauth2/*
packages/cdk/resources/LambdaFunction/helpers.ts Removed legacy lambda helpers
packages/cdk/resources/LambdaFunction.ts Removed legacy lambda construct
packages/cdk/resources/Dynamodb.ts Removes state/session-state tables; refactors policies
packages/cdk/resources/Cognito.ts Consolidates OIDC config into OidcConfig
packages/cdk/resources/CloudfrontLogDelivery.ts Destination-only; source/delivery moved elsewhere
packages/cdk/resources/CloudfrontDistribution.ts Rebuilds distribution behaviors/functions/logging
packages/cdk/resources/CloudfrontBehaviors.ts Removed legacy behaviors construct
packages/cdk/resources/Cloudfront/CloudfrontFunction.ts Removed legacy CF function wrapper
packages/cdk/policies/s3/AllowStaticContentPolicyStatements.ts Removed policy helper
packages/cdk/policies/kms/AllowStaticBucketKmsKeyAccessPolicy.ts Removed policy helper
packages/cdk/package.json Adds new CDK scripts/deps; removes tests/license script
packages/cdk/nagSuppressions.ts Switches to safe suppression helpers; refactors paths
packages/cdk/jest.debug.config.ts Removed Jest config
packages/cdk/jest.config.ts Removed Jest config
packages/cdk/cdk.json Adds acknowledged issue numbers to config
packages/cdk/bin/utils/appUtils.ts Removed legacy CFN Guard metadata helper
packages/cdk/bin/StatelessResourcesApp.ts Removed legacy CDK app
packages/cdk/bin/StatefulResourcesApp.ts Removed legacy CDK app
packages/cdk/bin/MainDeploymentApp.ts New CDK entrypoint using eps constructs/utilities
packages/cdk/.gitignore Removed cdk.out ignore (package-level)
packages/CIS2SignOutLambda/package.json Removed check-licenses script
package.json Removes root license-check script and deps adjustments
cdk.context.json Removed context file
README.md Removes license-check documentation; updates workflows doc
Makefile Replaces many custom targets with common.mk + new CDK vars
.tool-versions.asdf Removed
.tool-versions Removed
.pre-commit-config.yaml Updates actionlint hook invocation
.gitignore Removes cfn_guard_output/ ignore
.github/workflows/run_regression_tests.yml Moves to pinned devcontainer-based execution
.github/workflows/release.yml Migrates to common devcontainer workflows
.github/workflows/pull_request.yml Migrates to common devcontainer workflows
.github/workflows/link_dev_website.yml Simplifies PR URL linking logic
.github/workflows/ci.yml Migrates to common devcontainer workflows
.github/workflows/cdk_package_code.yml Migrates packaging to pinned devcontainer
.devcontainer/devcontainer.json New devcontainer definition (pinned EPS image)
.devcontainer/Dockerfile Uses prebuilt EPS devcontainer image
.cfnlintrc Removed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 9 to 13
"build": "tsc --build && vite build",
"lint": "eslint --max-warnings 0 --fix --config ../../eslint.config.mjs .",
"start": "vite preview",
"test": "NODE_NO_WARNINGS=1 jest --no-cache --coverage",
"check-licenses": "license-checker --failOn GPL --failOn LGPL --start ../.."
"test": "NODE_NO_WARNINGS=1 jest --no-cache --coverage"
},
@sonarqubecloud
Copy link

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.

2 participants