Skip to content

Commit c88debb

Browse files
committed
Merge branch 'main' into fix/CCM-14248_letter-map-source-to-match-core
2 parents e5c3a95 + cb1488f commit c88debb

31 files changed

Lines changed: 558 additions & 79 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=.

infrastructure/terraform/components/api/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ 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 |
2021
| <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 |
2122
| <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 |
2223
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the tfscaffold environment | `string` | n/a | yes |

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/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,9 @@ variable "letter_event_source" {
187187
description = "Source value to use for the letter status event updates"
188188
default = "/data-plane/supplier-api/nhs-supplier-api-prod/main/update-status"
189189
}
190+
191+
variable "enable_api_data_trace" {
192+
type = bool
193+
description = "Enable API Gateway data trace logging"
194+
default = false
195+
}

internal/events/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@
5050
"typecheck": "tsc --noEmit"
5151
},
5252
"types": "dist/index.d.ts",
53-
"version": "1.0.9"
53+
"version": "1.0.10"
5454
}

internal/events/schemas/examples/letter.ACCEPTED.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
{
22
"data": {
33
"billingRef": "1y3q9v1zzzz",
4-
"domainId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
4+
"domainId": "e9dc9ee9-b2f8-4ef2-8351-73a9a29f8e96_38U220Ghb1WXF8hCK6hL0LGya3Y_38U23YjtnKSZypvaCSb07adMOlq",
55
"groupId": "client_template",
66
"origin": {
77
"domain": "letter-rendering",
88
"event": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
9-
"source": "/data-plane/letter-rendering/prod/render-pdf",
10-
"subject": "client/00f3b388-bbe9-41c9-9e76-052d37ee8988/letter-request/0o5Fs0EELR0fUjHjbCnEtdUwQe4_0o5Fs0EELR0fUjHjbCnEtdUwQe5"
9+
"source": "/data-plane/letter-rendering/comms-mgr-prod/prod",
10+
"subject": "client/e9dc9ee9-b2f8-4ef2-8351-73a9a29f8e96/letter-request/38U220Ghb1WXF8hCK6hL0LGya3Y_38U23YjtnKSZypvaCSb07adMOlq"
1111
},
1212
"specificationId": "1y3q9v1zzzz",
13-
"status": "ACCEPTED"
13+
"status": "ACCEPTED",
14+
"supplierId": "supplier-12345"
1415
},
1516
"datacontenttype": "application/json",
1617
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.ACCEPTED.1.0.0.schema.json",
18+
"dataschemaversion": "1.0.0",
1719
"id": "23f1f09c-a555-4d9b-8405-0b33490bc920",
20+
"plane": "data",
1821
"recordedtime": "2025-08-28T08:45:00.000Z",
1922
"severitynumber": 2,
2023
"severitytext": "INFO",
2124
"source": "/data-plane/supplier-api/nhs-supplier-api-prod/main/update-status",
2225
"specversion": "1.0",
23-
"subject": "letter-origin/letter-rendering/letter/f47ac10b-58cc-4372-a567-0e02b2c3d479",
26+
"subject": "letter-origin/letter-rendering/letter/e9dc9ee9-b2f8-4ef2-8351-73a9a29f8e96_38U220Ghb1WXF8hCK6hL0LGya3Y_38U23YjtnKSZypvaCSb07adMOlq",
2427
"time": "2025-08-28T08:45:00.000Z",
2528
"traceparent": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
2629
"type": "uk.nhs.notify.supplier-api.letter.ACCEPTED.v1"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"data": {
3+
"billingRef": "1y3q9v1zzzz",
4+
"domainId": "e9dc9ee9-b2f8-4ef2-8351-73a9a29f8e96_38U220Ghb1WXF8hCK6hL0LGya3Y_38U23YjtnKSZypvaCSb07adMOlq",
5+
"groupId": "client_template",
6+
"origin": {
7+
"domain": "letter-rendering",
8+
"event": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
9+
"source": "/data-plane/letter-rendering/comms-mgr-prod/prod",
10+
"subject": "client/e9dc9ee9-b2f8-4ef2-8351-73a9a29f8e96/letter-request/38U220Ghb1WXF8hCK6hL0LGya3Y_38U23YjtnKSZypvaCSb07adMOlq"
11+
},
12+
"reasonCode": "CANCELLATION_CODE",
13+
"reasonText": "Cancellation reason",
14+
"specificationId": "1y3q9v1zzzz",
15+
"status": "CANCELLED",
16+
"supplierId": "supplier-12345"
17+
},
18+
"datacontenttype": "application/json",
19+
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.CANCELLED.1.0.0.schema.json",
20+
"dataschemaversion": "1.0.0",
21+
"id": "23f1f09c-a555-4d9b-8405-0b33490bc920",
22+
"plane": "data",
23+
"recordedtime": "2025-08-28T08:45:00.000Z",
24+
"severitynumber": 2,
25+
"severitytext": "INFO",
26+
"source": "/data-plane/supplier-api/nhs-supplier-api-prod/main/update-status",
27+
"specversion": "1.0",
28+
"subject": "letter-origin/letter-rendering/letter/e9dc9ee9-b2f8-4ef2-8351-73a9a29f8e96_38U220Ghb1WXF8hCK6hL0LGya3Y_38U23YjtnKSZypvaCSb07adMOlq",
29+
"time": "2025-08-28T08:45:00.000Z",
30+
"traceparent": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
31+
"type": "uk.nhs.notify.supplier-api.letter.CANCELLED.v1"
32+
}

0 commit comments

Comments
 (0)