Skip to content

Commit 4a2fde6

Browse files
Merge branch 'main' into spike/Snapshot-tests
2 parents 56cdb26 + 5ea03d2 commit 4a2fde6

File tree

223 files changed

+9194
-4785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+9194
-4785
lines changed

.azuredevops/pipelines/post-deployment-tests-dev.yaml

Lines changed: 97 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,20 @@ name: $(Build.SourceBranchName)-$(Date:yyyyMMdd)_$(Rev:r)
33
trigger: none
44
pr: none
55

6+
schedules:
7+
- cron: "15 9 * * 1-5" # Every weekday (Mon-Fri) at 09:15 UTC
8+
displayName: Weekdays 09:15 run
9+
branches:
10+
include:
11+
- main # Change to your default branch if needed
12+
always: true
13+
614
resources:
715
repositories:
816
- repository: dtos-devops-templates
917
type: github
1018
name: NHSDigital/dtos-devops-templates
11-
ref: ac0aaf63e6d27820912918e2ecd23feec518ce51
19+
ref: c5b352eaad08403f0addac347b07ede4fa643556
1220
endpoint: NHSDigital
1321

1422
variables:
@@ -23,23 +31,95 @@ parameters:
2331
default: dev
2432

2533
stages:
26-
- stage: post_deployment_tests_stage
27-
displayName: Post-deployment tests
34+
- stage: smoke_e2e_tests
35+
displayName: Run Smoke E2E Tests
36+
variables:
37+
TARGET_ENVIRONMENT: ${{ parameters.destEnvironmentShortName }}
38+
jobs:
39+
- job: smoke_e2e_tests
40+
pool:
41+
name: private-pool-dev-uks
42+
steps:
43+
- template: .azuredevops/templates/steps/run-post-deployment-pw-tests.yaml@dtos-devops-templates
44+
parameters:
45+
serviceConnection: sc-cohort-manager-dev
46+
testProjectDirectory: 'tests/playwright-tests'
47+
testfileDirectory: 'src/tests/e2e/testFiles'
48+
testProjectName: 'tests'
49+
testType: 'smoke:e2e'
2850

51+
- stage: regression_api_tests
52+
displayName: Run Regression API Tests
53+
dependsOn: smoke_e2e_tests
54+
condition: succeededOrFailed()
2955
variables:
30-
- name: TARGET_ENVIRONMENT
31-
value: ${{ parameters.destEnvironmentShortName }}
56+
TARGET_ENVIRONMENT: ${{ parameters.destEnvironmentShortName }}
57+
jobs:
58+
- job: regression_api_tests
59+
pool:
60+
name: private-pool-dev-uks
61+
steps:
62+
- template: .azuredevops/templates/steps/run-post-deployment-pw-tests.yaml@dtos-devops-templates
63+
parameters:
64+
serviceConnection: sc-cohort-manager-dev
65+
testProjectDirectory: 'tests/playwright-tests'
66+
testfileDirectory: 'src/tests/e2e/testFiles'
67+
testProjectName: 'tests'
68+
testType: 'regression:api'
3269

70+
- stage: regression_e2e_epic1_tests
71+
displayName: Run Regression E2E Epic1 Tests
72+
dependsOn: regression_api_tests
73+
condition: succeededOrFailed()
74+
variables:
75+
TARGET_ENVIRONMENT: ${{ parameters.destEnvironmentShortName }}
76+
jobs:
77+
- job: regression_e2e_epic1_tests
78+
pool:
79+
name: private-pool-dev-uks
80+
steps:
81+
- template: .azuredevops/templates/steps/run-post-deployment-pw-tests.yaml@dtos-devops-templates
82+
parameters:
83+
serviceConnection: sc-cohort-manager-dev
84+
testProjectDirectory: 'tests/playwright-tests'
85+
testfileDirectory: 'src/tests/e2e/testFiles'
86+
testProjectName: 'tests'
87+
testType: 'regression:e2e:epic1'
88+
89+
- stage: regression_e2e_epic2_tests
90+
displayName: Run Regression E2E Epic2 Tests
91+
dependsOn: regression_e2e_epic1_tests
92+
condition: succeededOrFailed()
93+
variables:
94+
TARGET_ENVIRONMENT: ${{ parameters.destEnvironmentShortName }}
95+
jobs:
96+
- job: regression_e2e_epic2_tests
97+
pool:
98+
name: private-pool-dev-uks
99+
steps:
100+
- template: .azuredevops/templates/steps/run-post-deployment-pw-tests.yaml@dtos-devops-templates
101+
parameters:
102+
serviceConnection: sc-cohort-manager-dev
103+
testProjectDirectory: 'tests/playwright-tests'
104+
testfileDirectory: 'src/tests/e2e/testFiles'
105+
testProjectName: 'tests'
106+
testType: 'regression:e2e:epic2'
107+
108+
- stage: regression_e2e_epic3_tests
109+
displayName: Run Regression E2E Epic3 Tests
110+
dependsOn: regression_e2e_epic2_tests
111+
condition: succeededOrFailed()
112+
variables:
113+
TARGET_ENVIRONMENT: ${{ parameters.destEnvironmentShortName }}
33114
jobs:
34-
- job: post_deployment_tests_smoke
35-
displayName: Run post-deployment smoke tests
36-
pool:
37-
name: private-pool-dev-uks
38-
39-
steps:
40-
- template: .azuredevops/templates/steps/run-post-deployment-pw-tests.yaml@dtos-devops-templates
41-
parameters:
42-
serviceConnection: sc-cohort-manager-dev
43-
testProjectDirectory: 'tests/playwright-tests'
44-
testfileDirectory: 'src/tests/e2e/testFiles'
45-
testProjectName: 'tests'
115+
- job: regression_e2e_epic3_tests
116+
pool:
117+
name: private-pool-dev-uks
118+
steps:
119+
- template: .azuredevops/templates/steps/run-post-deployment-pw-tests.yaml@dtos-devops-templates
120+
parameters:
121+
serviceConnection: sc-cohort-manager-dev
122+
testProjectDirectory: 'tests/playwright-tests'
123+
testfileDirectory: 'src/tests/e2e/testFiles'
124+
testProjectName: 'tests'
125+
testType: 'regression:e2e:epic3'

application/CohortManager/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ ENDPOINT_EXCEPTION_MANAGEMENT_DATA_SERVICE="" # "http://localhost:7911/"
2828
ENDPOINT_BS_SELECT_RETRIEVE_COHORT_DISTRIBUTION_DATA="" # "http://localhost:7078/"
2929
ENDPOINT_BS_SELECT_RETRIEVE_COHORT_REQUEST_AUDIT="" # "http://localhost:7086/"
3030
ENDPOINT_BS_SELECT_DELETE_PARTICIPANT="" # "http://localhost:7087/"
31+
ENDPOINT_BS_SELECT_UPDATE_BLOCK_FLAG="" # "http://localhost:7026/"
3132

application/CohortManager/compose.core.yaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ services:
5454
- NemsMessages="nems-messages"
5555
- ExceptionFunctionURL=http://create-exception:7070/api/CreateException
5656
- RetrievePdsDemographicURL=http://retrieve-pds-demographic:8082/api/RetrievePDSDemographic
57+
- UnsubscribeNemsSubscriptionUrl=http://manage-nems-subscription:9081/api/Unsubscribe
58+
- UpdateQueueName=update-participant-queue
5759

5860
receive-caas-file:
5961
container_name: receive-caas-file
@@ -104,7 +106,7 @@ services:
104106
- ParticipantManagementQueueName=participant-management-queue
105107
- ParticipantManagementUrl=http://participant-management-data-service:7994/api/ParticipantManagementDataService
106108
- ExceptionFunctionURL=http://create-exception:7070/api/CreateException
107-
109+
108110
add-participant:
109111
container_name: add-participant
110112
image: cohort-manager-add-participant
@@ -235,8 +237,11 @@ services:
235237
- ExceptionTopic="createExceptionTopic"
236238
- ExceptionSubscription="exceptionSub"
237239
- ServiceBusConnectionString="Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true"
240+
- DemographicDataServiceURL=http://participant-demographic-data-service:7993/api/ParticipantDemographicDataService/
241+
- ExceptionManagementDataServiceURL=http://exception-management-data-service:7911/api/ExceptionManagementDataService/
242+
243+
238244

239-
240245
update-exception:
241246
container_name: update-exception
242247
image: cohort-manager-update-exception
@@ -374,6 +379,20 @@ services:
374379
- ExceptionFunctionURL=http://create-exception:7070/api/CreateException
375380
- ParticipantDemographicDataServiceURL=http://participant-demographic-data-service:7993/api/ParticipantDemographicDataService
376381

382+
servicenow-cohort-lookup:
383+
container_name: servicenow-cohort-lookup
384+
image: cohort-manager-servicenow-cohort-lookup
385+
networks: [cohman-network]
386+
build:
387+
context: ./src/Functions/
388+
dockerfile: ServiceNowIntegration/ServiceNowCohortLookup/Dockerfile
389+
profiles: [non-essential]
390+
environment:
391+
- ASPNETCORE_URLS=http://*:7180
392+
- ExceptionFunctionURL=http://create-exception:7070/api/CreateException
393+
- ServiceNowCasesDataServiceURL=http://servicenow-cases-data-service:9996/api/ServiceNowCasesDataService
394+
- CohortDistributionDataServiceURL=http://cohort-distribution-data-service:7992/api/CohortDistributionDataService
395+
377396
# UI
378397
web:
379398
container_name: web

application/CohortManager/compose.data-services.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: cohort-manager
22

3-
services:
3+
services:
44
exception-management-data-service:
55
container_name: exception-management-data-service
66
image: cohort-manager-exception-management-data-service
@@ -192,6 +192,19 @@ services:
192192
- DtOsDatabaseConnectionString=Server=db,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True
193193
- AcceptableLatencyThresholdMs=500
194194

195+
servicenow-cases-data-service:
196+
container_name: servicenow-cases-data-service
197+
image: cohort-manager-servicenow-cases-data-service
198+
networks: [cohman-network]
199+
build:
200+
context: ./src/Functions/
201+
dockerfile: screeningDataServices/ServiceNowCasesDataService/Dockerfile
202+
environment:
203+
- ASPNETCORE_URLS=http://*:9996
204+
- DtOsDatabaseConnectionString=Server=db,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True
205+
- AcceptableLatencyThresholdMs=500
206+
207+
195208

196209
networks:
197210
cohman-network:
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
2-
"version": "2.0",
3-
"logging": {
4-
"applicationInsights": {
5-
"samplingSettings": {
6-
"isEnabled": true,
7-
"excludedTypes": "Request"
8-
},
9-
"enableLiveMetricsFilters": true
10-
}
2+
"version": "2.0",
3+
"logging": {
4+
"applicationInsights": {
5+
"samplingSettings": {
6+
"isEnabled": true,
7+
"excludedTypes": "Request"
8+
},
9+
"enableLiveMetricsFilters": true
10+
},
11+
"logLevel": {
12+
"HealthChecks": "Error",
13+
"HealthChecks.Extensions": "Error"
1114
}
15+
}
1216
}

application/CohortManager/src/Functions/CaasIntegration/receiveCaasFile/ProcessFileClasses/ProcessCaasFile.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ private async Task AddRecordToBatch(Participant participant, Batch currentBatch,
134134
{
135135
var basicParticipantCsvRecord = new BasicParticipantCsvRecord
136136
{
137-
Participant = _createBasicParticipantData.BasicParticipantData(participant),
137+
BasicParticipantData = _createBasicParticipantData.BasicParticipantData(participant),
138138
FileName = fileName,
139-
participant = participant
139+
Participant = participant
140140
};
141141
// take note: we don't need to add DemographicData to the queue for update because we loop through all updates in the UpdateParticipant method
142142
switch (participant.RecordType?.Trim())
@@ -192,7 +192,7 @@ private async Task<bool> UpdateOldDemographicRecord(BasicParticipantCsvRecord ba
192192
try
193193
{
194194
long nhsNumber;
195-
if (!long.TryParse(basicParticipantCsvRecord.participant.NhsNumber, out nhsNumber))
195+
if (!long.TryParse(basicParticipantCsvRecord.Participant.NhsNumber, out nhsNumber))
196196
{
197197
throw new FormatException("Unable to parse NHS Number");
198198
}
@@ -205,7 +205,7 @@ private async Task<bool> UpdateOldDemographicRecord(BasicParticipantCsvRecord ba
205205
return false;
206206
}
207207

208-
var participantForUpdate = basicParticipantCsvRecord.participant.ToParticipantDemographic();
208+
var participantForUpdate = basicParticipantCsvRecord.Participant.ToParticipantDemographic();
209209
participantForUpdate.ParticipantId = participant.ParticipantId;
210210

211211
var updated = await _participantDemographic.Update(participantForUpdate);
@@ -221,7 +221,7 @@ private async Task<bool> UpdateOldDemographicRecord(BasicParticipantCsvRecord ba
221221
catch (Exception ex)
222222
{
223223
_logger.LogError(ex, "Update participant function failed.\nMessage: {Message}\nStack Trace: {StackTrace}", ex.Message, ex.StackTrace);
224-
await CreateError(basicParticipantCsvRecord.participant, name);
224+
await CreateError(basicParticipantCsvRecord.Participant, name);
225225
}
226226
return false;
227227
}
@@ -246,7 +246,7 @@ private async Task RemoveParticipant(BasicParticipantCsvRecord basicParticipantC
246246
catch (Exception ex)
247247
{
248248
_logger.LogError(ex, "Remove participant function failed.\nMessage: {Message}\nStack Trace: {StackTrace}", ex.Message, ex.StackTrace);
249-
await CreateError(basicParticipantCsvRecord.participant, filename);
249+
await CreateError(basicParticipantCsvRecord.Participant, filename);
250250
}
251251
}
252252

application/CohortManager/src/Functions/CaasIntegration/receiveCaasFile/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
services.AddScoped<ICreateBasicParticipantData, CreateBasicParticipantData>();
3636
services.AddScoped<IAddBatchToQueue, AddBatchToQueue>();
3737
services.AddScoped<IRecordsProcessedTracker, RecordsProcessedTracker>(); //Do not change the lifetime of this.
38-
services.AddTransient<IExceptionHandler, ExceptionHandler>();
3938
services.AddTransient<IBlobStorageHelper, BlobStorageHelper>();
4039
services.AddTransient<ICopyFailedBatchToBlob, CopyFailedBatchToBlob>();
4140
services.AddScoped<IValidateDates, ValidateDates>();

application/CohortManager/src/Functions/CaasIntegration/receiveCaasFile/host.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"excludedTypes": "Request"
99
},
1010
"enableLiveMetricsFilters": true
11+
},
12+
"logLevel": {
13+
"HealthChecks": "Error",
14+
"HealthChecks.Extensions": "Error"
1115
}
1216
},
1317
"concurrency": {
Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
{
2-
"functionTimeout": "01:00:00",
3-
"version": "2.0",
4-
"concurrency": {
5-
"dynamicConcurrencyEnabled": true,
6-
"snapshotPersistenceEnabled": true
7-
},
8-
"extensions": {
9-
"queues": {
10-
"batchSize": 8,
11-
"newBatchThreshold": 4,
12-
"visibilityTimeout": "00:04:00",
13-
"maxDequeueCount": 1
14-
}
2+
"functionTimeout": "01:00:00",
3+
"version": "2.0",
4+
"concurrency": {
5+
"dynamicConcurrencyEnabled": true,
6+
"snapshotPersistenceEnabled": true
7+
},
8+
"extensions": {
9+
"queues": {
10+
"batchSize": 8,
11+
"newBatchThreshold": 4,
12+
"visibilityTimeout": "00:04:00",
13+
"maxDequeueCount": 1
14+
}
15+
},
16+
"logging": {
17+
"applicationInsights": {
18+
"samplingSettings": {
19+
"isEnabled": true,
20+
"excludedTypes": "Request"
21+
},
22+
"enableLiveMetricsFilters": true
1523
},
16-
"logging": {
17-
"applicationInsights": {
18-
"samplingSettings": {
19-
"isEnabled": true,
20-
"excludedTypes": "Request"
21-
},
22-
"enableLiveMetricsFilters": true
23-
}
24+
"logLevel": {
25+
"HealthChecks": "Error",
26+
"HealthChecks.Extensions": "Error"
2427
}
28+
}
2529
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "2.0",
3+
"functionTimeout": "01:00:00",
4+
"logging": {
5+
"applicationInsights": {
6+
"samplingSettings": {
7+
"isEnabled": true,
8+
"excludedTypes": "Request"
9+
},
10+
"enableLiveMetricsFilters": true
11+
},
12+
"logLevel": {
13+
"HealthChecks": "Error",
14+
"HealthChecks.Extensions": "Error"
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)