Skip to content

Commit e46fdb7

Browse files
committed
Merge branch 'main' into feature/CCM-13610-Expose-key-metrics-to-Cloudwatch
2 parents 9da31ac + cb1488f commit e46fdb7

36 files changed

Lines changed: 597 additions & 45 deletions

.github/actions/acceptance-tests/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ runs:
3737
- name: "Repo setup"
3838
uses: ./.github/actions/node-install
3939
with:
40-
node-version: ${{ steps.nodejs_version.outputs.nodejs_version }}
4140
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
4241

4342
- name: "Set PR NUMBER"

.github/actions/node-install/action.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: 'npm install and setup'
22
description: 'Setup node, authenticate github package repository and perform clean npm install'
33

44
inputs:
5-
node-version:
6-
description: 'Node.js version'
7-
required: true
85
GITHUB_TOKEN:
96
description: "Token for access to github package registry"
107
required: true
@@ -15,7 +12,7 @@ runs:
1512
- name: 'Use Node.js'
1613
uses: actions/setup-node@v6
1714
with:
18-
node-version: '${{ inputs.node-version }}'
15+
node-version-file: '.tool-versions'
1916
registry-url: 'https://npm.pkg.github.com'
2017
scope: '@nhsdigital'
2118

.github/workflows/pr_closed.yaml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
- name: Setup NodeJS
8181
uses: actions/setup-node@v4
8282
with:
83-
node-version: ${{ inputs.nodejs_version }}
83+
node-version-file: '.tool-versions'
8484
registry-url: 'https://npm.pkg.github.com'
8585

8686
- name: check if local version differs from latest published version
@@ -113,19 +113,14 @@ jobs:
113113
steps:
114114
- name: "Checkout code"
115115
uses: actions/checkout@v5.0.0
116-
- name: Setup NodeJS
117-
uses: actions/setup-node@v4
116+
- name: "Repo setup"
117+
uses: ./.github/actions/node-install
118118
with:
119-
node-version: ${{ inputs.nodejs_version }}
120-
registry-url: 'https://npm.pkg.github.com'
121-
- name: "Install dependencies"
122-
env:
123-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124-
run: npm ci
119+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125120
- name: "Run provider contract tests"
126121
run: make test-contract
127122
env:
128-
GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129124

130125
publish-event-schemas:
131126
name: Publish event schemas package to GitHub package registry
@@ -145,7 +140,7 @@ jobs:
145140
- name: Setup NodeJS
146141
uses: actions/setup-node@v4
147142
with:
148-
node-version: ${{ inputs.nodejs_version }}
143+
node-version-file: '.tool-versions'
149144
registry-url: 'https://npm.pkg.github.com'
150145

151146
- name: Install dependencies

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ test-component:
106106
test-performance:
107107
(cd tests && npm install && npm run test:performance)
108108

109+
test-contract: # Run provider contract tests @Testing
110+
npm run test:contracts --workspace tests/contracts/provider
111+
109112
version:
110113
rm -f .version
111114
make version-create-effective-file dir=.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.0-${yyyy}${mm}${dd}.${HH}${MM}${SS}+${hash}
1+
1.1.2-${yyyy}${mm}${dd}.${HH}${MM}${SS}+${hash}

infrastructure/terraform/components/api/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ No requirements.
1717
| <a name="input_core_environment"></a> [core\_environment](#input\_core\_environment) | Environment of Core | `string` | `"prod"` | no |
1818
| <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 |
1919
| <a name="input_disable_gateway_execute_endpoint"></a> [disable\_gateway\_execute\_endpoint](#input\_disable\_gateway\_execute\_endpoint) | Disable the execution endpoint for the API Gateway | `bool` | `true` | no |
20+
| <a name="input_enable_api_data_trace"></a> [enable\_api\_data\_trace](#input\_enable\_api\_data\_trace) | Enable API Gateway data trace logging | `bool` | `false` | no |
21+
| <a name="input_enable_event_cache"></a> [enable\_event\_cache](#input\_enable\_event\_cache) | Enable caching of events to an S3 bucket | `bool` | `false` | no |
22+
| <a name="input_enable_sns_delivery_logging"></a> [enable\_sns\_delivery\_logging](#input\_enable\_sns\_delivery\_logging) | Enable SNS Delivery Failure Notifications | `bool` | `false` | no |
2023
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the tfscaffold environment | `string` | n/a | yes |
2124
| <a name="input_eventpub_control_plane_bus_arn"></a> [eventpub\_control\_plane\_bus\_arn](#input\_eventpub\_control\_plane\_bus\_arn) | ARN of the EventBridge control plane bus for eventpub | `string` | `""` | no |
2225
| <a name="input_eventpub_data_plane_bus_arn"></a> [eventpub\_data\_plane\_bus\_arn](#input\_eventpub\_data\_plane\_bus\_arn) | ARN of the EventBridge data plane bus for eventpub | `string` | `""` | no |
@@ -34,6 +37,7 @@ No requirements.
3437
| <a name="input_project"></a> [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes |
3538
| <a name="input_region"></a> [region](#input\_region) | The AWS Region | `string` | n/a | yes |
3639
| <a name="input_shared_infra_account_id"></a> [shared\_infra\_account\_id](#input\_shared\_infra\_account\_id) | The AWS Account ID of the shared infrastructure account | `string` | `"000000000000"` | no |
40+
| <a name="input_sns_success_logging_sample_percent"></a> [sns\_success\_logging\_sample\_percent](#input\_sns\_success\_logging\_sample\_percent) | Enable SNS Delivery Successful Sample Percentage | `number` | `0` | no |
3741
## Modules
3842

3943
| Name | Source | Version |

infrastructure/terraform/components/api/api_gateway_method_settings.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ resource "aws_api_gateway_method_settings" "main" {
66
settings {
77
metrics_enabled = true
88
logging_level = "INFO"
9-
data_trace_enabled = true
9+
data_trace_enabled = var.enable_api_data_trace
1010
}
1111
}

infrastructure/terraform/components/api/modules_eventpub.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ module "eventpub" {
1919
force_destroy = var.force_destroy
2020

2121
event_cache_buffer_interval = 500
22-
enable_sns_delivery_logging = true
23-
sns_success_logging_sample_percent = 0
22+
enable_sns_delivery_logging = var.enable_sns_delivery_logging
23+
sns_success_logging_sample_percent = var.sns_success_logging_sample_percent
2424

2525
event_cache_expiry_days = 30
26-
enable_event_cache = true
26+
enable_event_cache = var.enable_event_cache
2727

2828
data_plane_bus_arn = var.eventpub_data_plane_bus_arn
2929
control_plane_bus_arn = var.eventpub_control_plane_bus_arn

infrastructure/terraform/components/api/modules_eventsub.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ module "eventsub" {
1818
force_destroy = var.force_destroy
1919

2020
event_cache_buffer_interval = 500
21-
enable_sns_delivery_logging = true
22-
sns_success_logging_sample_percent = 0
21+
enable_sns_delivery_logging = var.enable_sns_delivery_logging
22+
sns_success_logging_sample_percent = var.sns_success_logging_sample_percent
2323

2424
event_cache_expiry_days = 30
25+
enable_event_cache = var.enable_event_cache
26+
2527
shared_infra_account_id = var.shared_infra_account_id
2628
}

infrastructure/terraform/components/api/variables.tf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,28 @@ variable "core_environment" {
162162
default = "prod"
163163

164164
}
165+
166+
# Event Pub/Sub cache settings
167+
variable "enable_event_cache" {
168+
type = bool
169+
description = "Enable caching of events to an S3 bucket"
170+
default = false
171+
}
172+
173+
variable "enable_sns_delivery_logging" {
174+
type = bool
175+
description = "Enable SNS Delivery Failure Notifications"
176+
default = false
177+
}
178+
179+
variable "sns_success_logging_sample_percent" {
180+
type = number
181+
description = "Enable SNS Delivery Successful Sample Percentage"
182+
default = 0
183+
}
184+
185+
variable "enable_api_data_trace" {
186+
type = bool
187+
description = "Enable API Gateway data trace logging"
188+
default = false
189+
}

0 commit comments

Comments
 (0)