From 906a9879dfd61b54ff196398594f6778a69acc8a Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Tue, 11 Feb 2025 09:27:34 +0000 Subject: [PATCH 01/20] feat: adidng the new ReceiveServiceNowMessage fucnton --- .../CohortManager/src/Functions/Functions.sln | 6 ++++ .../.vscode/extensions.json | 5 +++ .../ServiceNowIntegrationService/Program.cs | 14 ++++++++ .../Properties/launchSettings.json | 9 +++++ .../ReceiveServiceNowMessage.cs | 29 +++++++++++++++ .../ReceiveServiceNowMessage.csproj | 36 +++++++++++++++++++ .../ServiceNowIntegrationService/host.json | 12 +++++++ .../src/Functions/Shared/Common/delme | 0 8 files changed, 111 insertions(+) create mode 100644 application/CohortManager/src/Functions/ServiceNowIntegrationService/.vscode/extensions.json create mode 100644 application/CohortManager/src/Functions/ServiceNowIntegrationService/Program.cs create mode 100644 application/CohortManager/src/Functions/ServiceNowIntegrationService/Properties/launchSettings.json create mode 100644 application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.cs create mode 100644 application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.csproj create mode 100644 application/CohortManager/src/Functions/ServiceNowIntegrationService/host.json delete mode 100644 application/CohortManager/src/Functions/Shared/Common/delme diff --git a/application/CohortManager/src/Functions/Functions.sln b/application/CohortManager/src/Functions/Functions.sln index 2299a11345..66907b688c 100644 --- a/application/CohortManager/src/Functions/Functions.sln +++ b/application/CohortManager/src/Functions/Functions.sln @@ -194,6 +194,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateParticipantFromScreen EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CheckParticipantExistsTests", "..\..\..\..\tests\UnitTests\ParticipantManagementServicesTests\CheckParticipantExistsTests\CheckParticipantExistsTests.csproj", "{A7B76A57-0B18-4234-BAE5-1F9178CB6A08}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReceiveServiceNowMessage", "ServiceNowIntegrationService\ReceiveServiceNowMessage.csproj", "{43A1A7D7-83F5-448E-8ADA-741284819DCB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -528,6 +530,10 @@ Global {A7B76A57-0B18-4234-BAE5-1F9178CB6A08}.Debug|Any CPU.Build.0 = Debug|Any CPU {A7B76A57-0B18-4234-BAE5-1F9178CB6A08}.Release|Any CPU.ActiveCfg = Release|Any CPU {A7B76A57-0B18-4234-BAE5-1F9178CB6A08}.Release|Any CPU.Build.0 = Release|Any CPU + {43A1A7D7-83F5-448E-8ADA-741284819DCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {43A1A7D7-83F5-448E-8ADA-741284819DCB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {43A1A7D7-83F5-448E-8ADA-741284819DCB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {43A1A7D7-83F5-448E-8ADA-741284819DCB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/.vscode/extensions.json b/application/CohortManager/src/Functions/ServiceNowIntegrationService/.vscode/extensions.json new file mode 100644 index 0000000000..dde673dcd0 --- /dev/null +++ b/application/CohortManager/src/Functions/ServiceNowIntegrationService/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "ms-azuretools.vscode-azurefunctions" + ] +} \ No newline at end of file diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/Program.cs b/application/CohortManager/src/Functions/ServiceNowIntegrationService/Program.cs new file mode 100644 index 0000000000..54cf758fc3 --- /dev/null +++ b/application/CohortManager/src/Functions/ServiceNowIntegrationService/Program.cs @@ -0,0 +1,14 @@ +using Common; +using Microsoft.Azure.Functions.Worker.Builder; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +var host = new HostBuilder() + .ConfigureFunctionsWebApplication() + .ConfigureServices(services => + { + services.AddSingleton(); + }) + .Build(); + +await host.RunAsync(); diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/Properties/launchSettings.json b/application/CohortManager/src/Functions/ServiceNowIntegrationService/Properties/launchSettings.json new file mode 100644 index 0000000000..87192e511a --- /dev/null +++ b/application/CohortManager/src/Functions/ServiceNowIntegrationService/Properties/launchSettings.json @@ -0,0 +1,9 @@ +{ + "profiles": { + "ReceiveServiceNowMessage": { + "commandName": "Project", + "commandLineArgs": "--port 7093", + "launchBrowser": false + } + } +} \ No newline at end of file diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.cs b/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.cs new file mode 100644 index 0000000000..d9d0c55015 --- /dev/null +++ b/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.cs @@ -0,0 +1,29 @@ +namespace ServiceNowIntegrationService; + +using Microsoft.Azure.Functions.Worker; +using Microsoft.Extensions.Logging; +using Common; +using Microsoft.Azure.Functions.Worker.Http; +using System.Net; + +public class ReceiveServiceNowMessage +{ + private readonly ILogger _logger; + + private readonly ICreateResponse _createResponse; + + + public ReceiveServiceNowMessage(ILogger logger, ICreateResponse createResponse) + { + _logger = logger; + _createResponse = createResponse; + } + + [Function("ReceiveServiceNowMessage")] + public HttpResponseData Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req) + { + _logger.LogInformation("ReceiveServiceNowMessage function processed a request."); + return _createResponse.CreateHttpResponse(HttpStatusCode.OK, req); + } +} + diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.csproj b/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.csproj new file mode 100644 index 0000000000..8ef0684605 --- /dev/null +++ b/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.csproj @@ -0,0 +1,36 @@ + + + net8.0 + v4 + Exe + enable + enable + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + Never + + + + + + + + + + + \ No newline at end of file diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/host.json b/application/CohortManager/src/Functions/ServiceNowIntegrationService/host.json new file mode 100644 index 0000000000..d4f2d4120c --- /dev/null +++ b/application/CohortManager/src/Functions/ServiceNowIntegrationService/host.json @@ -0,0 +1,12 @@ +{ + "version": "2.0", + "logging": { + "applicationInsights": { + "samplingSettings": { + "isEnabled": true, + "excludedTypes": "Request" + }, + "enableLiveMetricsFilters": true + } + } +} \ No newline at end of file diff --git a/application/CohortManager/src/Functions/Shared/Common/delme b/application/CohortManager/src/Functions/Shared/Common/delme deleted file mode 100644 index e69de29bb2..0000000000 From dd0db24279cf2ac42a5b370f43fc1fe9a56a8b4a Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Tue, 11 Feb 2025 09:44:14 +0000 Subject: [PATCH 02/20] chore: namespace change --- .../ServiceNowIntegrationService/ReceiveServiceNowMessage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.cs b/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.cs index d9d0c55015..ba1d629255 100644 --- a/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.cs +++ b/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.cs @@ -1,4 +1,4 @@ -namespace ServiceNowIntegrationService; +namespace NHS.CohortManager.ServiceNowIntegrationService; using Microsoft.Azure.Functions.Worker; using Microsoft.Extensions.Logging; From 596e4425944a51a497d277c994e0188380ae058f Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Tue, 11 Feb 2025 09:47:40 +0000 Subject: [PATCH 03/20] chore: removing commented out code --- .../ReceiveServiceNowMessage.csproj | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.csproj b/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.csproj index 8ef0684605..97c47fe24d 100644 --- a/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.csproj +++ b/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.csproj @@ -8,9 +8,6 @@ - - - @@ -28,9 +25,9 @@ - - - - + + + + \ No newline at end of file From 00b5ed7d2d50db9ec32fe7d471ee854f369cd352 Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Tue, 11 Feb 2025 15:58:24 +0000 Subject: [PATCH 04/20] chore: trying to get code to build in git pipeline --- .../Properties/launchSettings.json | 9 --------- .../Functions/ServiceNowIntegrationService/host.json | 12 ------------ 2 files changed, 21 deletions(-) delete mode 100644 application/CohortManager/src/Functions/ServiceNowIntegrationService/Properties/launchSettings.json delete mode 100644 application/CohortManager/src/Functions/ServiceNowIntegrationService/host.json diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/Properties/launchSettings.json b/application/CohortManager/src/Functions/ServiceNowIntegrationService/Properties/launchSettings.json deleted file mode 100644 index 87192e511a..0000000000 --- a/application/CohortManager/src/Functions/ServiceNowIntegrationService/Properties/launchSettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "profiles": { - "ReceiveServiceNowMessage": { - "commandName": "Project", - "commandLineArgs": "--port 7093", - "launchBrowser": false - } - } -} \ No newline at end of file diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/host.json b/application/CohortManager/src/Functions/ServiceNowIntegrationService/host.json deleted file mode 100644 index d4f2d4120c..0000000000 --- a/application/CohortManager/src/Functions/ServiceNowIntegrationService/host.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "2.0", - "logging": { - "applicationInsights": { - "samplingSettings": { - "isEnabled": true, - "excludedTypes": "Request" - }, - "enableLiveMetricsFilters": true - } - } -} \ No newline at end of file From 076af173c666ccd646158ca2266544923b0c8975 Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Wed, 12 Feb 2025 07:48:47 +0000 Subject: [PATCH 05/20] chore: removing unneeded .vscode folder --- .../ServiceNowIntegrationService/.vscode/extensions.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 application/CohortManager/src/Functions/ServiceNowIntegrationService/.vscode/extensions.json diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/.vscode/extensions.json b/application/CohortManager/src/Functions/ServiceNowIntegrationService/.vscode/extensions.json deleted file mode 100644 index dde673dcd0..0000000000 --- a/application/CohortManager/src/Functions/ServiceNowIntegrationService/.vscode/extensions.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "recommendations": [ - "ms-azuretools.vscode-azurefunctions" - ] -} \ No newline at end of file From 9ab8e71c22e077b10cd12a692d9dfa96bbcd4ba4 Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Wed, 12 Feb 2025 11:46:33 +0000 Subject: [PATCH 06/20] chore: adding docker details for new function --- application/CohortManager/compose.core.yaml | 9 +++++++++ .../ServiceNowIntegrationService/Dockerfile | 15 +++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile diff --git a/application/CohortManager/compose.core.yaml b/application/CohortManager/compose.core.yaml index 701309900b..fb3a2e026f 100644 --- a/application/CohortManager/compose.core.yaml +++ b/application/CohortManager/compose.core.yaml @@ -408,3 +408,12 @@ services: environment: - ASPNETCORE_URLS=http://*:7911 - DtOsDatabaseConnectionString=Server=localhost,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True + +receive-service-now-message: + container_name: receive-service-now-message + network_mode: host + build: + context: ./src/Functions/ + dockerfile: ServiceNowIntegrationService/Dockerfile + environment: + - ASPNETCORE_URLS=http://*:7912 \ No newline at end of file diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile b/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile new file mode 100644 index 0000000000..c33851bff8 --- /dev/null +++ b/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile @@ -0,0 +1,15 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS installer-env + +COPY ./ServiceNowIntegrationService /src/dotnet-function-app +COPY ./Shared /Shared +RUN cd /src/dotnet-function-app && \ + mkdir -p /home/site/wwwroot && \ + dotnet publish *.csproj --output /home/site/wwwroot + +# To enable ssh & remote debugging on app service change the base image to the one below +# FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0-appservice +FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0 +ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ + AzureFunctionsJobHost__Logging__Console__IsEnabled=true + +COPY --from=installer-env ["/home/site/wwwroot", "/home/site/wwwroot"] From 7c22f9f69502a5a87c383e707d5818403823f6d6 Mon Sep 17 00:00:00 2001 From: Maciej Murawski Date: Wed, 12 Feb 2025 12:03:34 +0000 Subject: [PATCH 07/20] feat: DTOSS-7351 infra setup for ServiceNow function app --- .../tf-core/environments/development.tfvars | 12 ++++++++++++ scripts/deployment/get-docker-names.sh | 1 + 2 files changed, 13 insertions(+) diff --git a/infrastructure/tf-core/environments/development.tfvars b/infrastructure/tf-core/environments/development.tfvars index 5a2b56e59c..91e145c675 100644 --- a/infrastructure/tf-core/environments/development.tfvars +++ b/infrastructure/tf-core/environments/development.tfvars @@ -978,6 +978,18 @@ function_apps = { } ] } + + ReceiveServiceNowMessage = { + name_suffix = "receive-service-now-message" + function_endpoint_name = "ReceiveServiceNowMessage" + app_service_plan_key = "DefaultPlan" + app_urls = [ + { + env_var_name = "ExceptionFunctionURL" + function_app_key = "CreateException" + } + ] + } } } diff --git a/scripts/deployment/get-docker-names.sh b/scripts/deployment/get-docker-names.sh index 8a366bc6b9..457a6eca69 100644 --- a/scripts/deployment/get-docker-names.sh +++ b/scripts/deployment/get-docker-names.sh @@ -24,6 +24,7 @@ declare -A docker_functions_map=( ["ParticipantManagementServices/UpdateParticipantFromScreeningProvider"]="update-participant-from-screening-provider" ["screeningDataServices/BsSelectGpPractice"]="bs-select-gp-practice-data-service" ["ParticipantManagementServices/CheckParticipantExists"]="check-participant-exists" + ["ServiceNowIntegrationService"]="receive-service-now-message" ["screeningDataServices/BsSelectOutCode"]="bs-select-outcode-data-service" ["screeningDataServices/createParticipant"]="create-participant" ["screeningDataServices/CurrentPostingDataService"]="current-posting-data-service" From b0a59f73ae4911e13b7b2badeaddb6c3563022cb Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Thu, 13 Feb 2025 13:51:09 +0000 Subject: [PATCH 08/20] Merge branch 'main' into feat/DTOSS-7351-adding-new-ReceiveServiceNowMessage-function --- application/CohortManager/compose.core.yaml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/application/CohortManager/compose.core.yaml b/application/CohortManager/compose.core.yaml index 551f19a1c6..aae9026fe3 100644 --- a/application/CohortManager/compose.core.yaml +++ b/application/CohortManager/compose.core.yaml @@ -410,16 +410,7 @@ services: environment: - ASPNETCORE_URLS=http://*:7911 - DtOsDatabaseConnectionString=Server=localhost,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True - - receive-service-now-message: - container_name: receive-service-now-message - network_mode: host - build: - context: ./src/Functions/ - dockerfile: ServiceNowIntegrationService/Dockerfile - environment: - - ASPNETCORE_URLS=http://*:7912 - + bs-request-audit-data-service: container_name: bs-request-audit-data-service network_mode: host @@ -440,9 +431,7 @@ services: environment: - ASPNETCORE_URLS=http://*:8996 - DtOsDatabaseConnectionString=Server=localhost,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True - - -receive-service-now-message: + receive-service-now-message: container_name: receive-service-now-message network_mode: host build: From a395f001cd63a3ca93dc1435ce36c7d263567fb1 Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Thu, 13 Feb 2025 14:00:44 +0000 Subject: [PATCH 09/20] chnaging CohortDistributionDataServiceURL port number to be correct --- application/CohortManager/compose.cohort-distribution.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/CohortManager/compose.cohort-distribution.yaml b/application/CohortManager/compose.cohort-distribution.yaml index 1dd72c20e2..632226d2e4 100644 --- a/application/CohortManager/compose.cohort-distribution.yaml +++ b/application/CohortManager/compose.cohort-distribution.yaml @@ -104,7 +104,7 @@ services: - LookupValidationURL=http://localhost:7075/api/LookupValidation - ExceptionFunctionURL=http://localhost:7070/api/CreateException - DtOsDatabaseConnectionString=Server=localhost,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True - - CohortDistributionDataServiceURL=http://localhost:7915/api/CohortDistributionDataService/ + - CohortDistributionDataServiceURL=http://localhost:7992/api/CohortDistributionDataService/ remove-validation-exception-data: container_name: remove-validation-exception-data From 4fe0c8a83769b1d3881c7c51326ef27c588f2d73 Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Thu, 13 Feb 2025 15:11:11 +0000 Subject: [PATCH 10/20] chore: adding line space to line 434 in compose.core.yaml --- application/CohortManager/compose.core.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/application/CohortManager/compose.core.yaml b/application/CohortManager/compose.core.yaml index aae9026fe3..b579484606 100644 --- a/application/CohortManager/compose.core.yaml +++ b/application/CohortManager/compose.core.yaml @@ -431,6 +431,7 @@ services: environment: - ASPNETCORE_URLS=http://*:8996 - DtOsDatabaseConnectionString=Server=localhost,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True + receive-service-now-message: container_name: receive-service-now-message network_mode: host From edefe5c88665e478616d419f49ebb1d3b2241ba9 Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Mon, 17 Feb 2025 09:13:43 +0000 Subject: [PATCH 11/20] chore: linting in the compose core yaml --- application/CohortManager/compose.core.yaml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/application/CohortManager/compose.core.yaml b/application/CohortManager/compose.core.yaml index ad9fefa639..9e0efb5eb1 100644 --- a/application/CohortManager/compose.core.yaml +++ b/application/CohortManager/compose.core.yaml @@ -107,7 +107,7 @@ services: build: context: ./src/Functions/ dockerfile: ParticipantManagementServices/UpdateParticipantFromScreeningProvider/Dockerfile - profiles: [bi-analytics] + profiles: [ bi-analytics ] environment: - ASPNETCORE_URLS=http://*:8001 - ParticipantManagementUrl=http://127.0.0.1:7994/api/ParticipantManagementDataService @@ -123,7 +123,7 @@ services: build: context: ./src/Functions/ dockerfile: ParticipantManagementServices/CheckParticipantExists/Dockerfile - profiles: [bi-analytics] + profiles: [ bi-analytics ] environment: - ASPNETCORE_URLS=http://*:8002 - ParticipantManagementUrl=http://localhost:7994/api/ParticipantManagementDataService @@ -134,7 +134,7 @@ services: build: context: ./src/Functions/ dockerfile: ParticipantManagementServices/GetParticipantReferenceData/Dockerfile - profiles: [bi-analytics] + profiles: [ bi-analytics ] environment: - ASPNETCORE_URLS=http://*:7999 - HigherRiskReferralReasonLkpDataServiceUrl=http://localhost:7992/api/HigherRiskReferralReasonLkpDataService @@ -210,7 +210,6 @@ services: - ExceptionManagementDataServiceURL=http://localhost:7911/api/ExceptionManagementDataService/ - GPPracticeDataServiceURL=http://localhost:7999/api/GPPracticeDataService/ - get-validation-exceptions: container_name: get-validation-exceptions network_mode: host @@ -278,7 +277,7 @@ services: gene-code-lkp-data-service: container_name: gene-code-lkp-data-service network_mode: host - profiles: [bi-analytics] + profiles: [ bi-analytics ] build: context: ./src/Functions/ dockerfile: screeningDataServices/GeneCodeLkpDataService/Dockerfile @@ -292,7 +291,7 @@ services: build: context: ./src/Functions/ dockerfile: screeningDataServices/HigherRiskReferralReasonLkpDataService/Dockerfile - profiles: [bi-analytics] + profiles: [ bi-analytics ] environment: - ASPNETCORE_URLS=http://*:7992 - DtOsDatabaseConnectionString=Server=localhost,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True @@ -420,7 +419,7 @@ services: environment: - ASPNETCORE_URLS=http://*:7911 - DtOsDatabaseConnectionString=Server=localhost,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True - + bs-request-audit-data-service: container_name: bs-request-audit-data-service network_mode: host @@ -431,7 +430,6 @@ services: - ASPNETCORE_URLS=http://*:7989 - DtOsDatabaseConnectionString=Server=localhost,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True - screening-lkp-data-service: container_name: screening-lkp-data-service network_mode: host @@ -441,7 +439,7 @@ services: environment: - ASPNETCORE_URLS=http://*:8996 - DtOsDatabaseConnectionString=Server=localhost,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True - + receive-service-now-message: container_name: receive-service-now-message network_mode: host @@ -449,4 +447,4 @@ services: context: ./src/Functions/ dockerfile: ServiceNowIntegrationService/Dockerfile environment: - - ASPNETCORE_URLS=http://*:7912 \ No newline at end of file + - ASPNETCORE_URLS=http://*:7912 From 70d4846d1a7067195202b24226e15437a350d4c0 Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Mon, 24 Mar 2025 11:29:21 +0000 Subject: [PATCH 12/20] fix: fixng docker file --- .../src/Functions/ServiceNowIntegrationService/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile b/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile index c33851bff8..129c9286cc 100644 --- a/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile +++ b/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile @@ -1,6 +1,6 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS installer-env -COPY ./ServiceNowIntegrationService /src/dotnet-function-app +COPY ./ReceiveServiceNowMessage /src/dotnet-function-app COPY ./Shared /Shared RUN cd /src/dotnet-function-app && \ mkdir -p /home/site/wwwroot && \ From bda4e36758e0c1ec302c44b0d90bc440cd65c7ad Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Mon, 24 Mar 2025 12:01:49 +0000 Subject: [PATCH 13/20] fix: fixng docker file --- .../src/Functions/ServiceNowIntegrationService/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile b/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile index 129c9286cc..c33851bff8 100644 --- a/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile +++ b/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile @@ -1,6 +1,6 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS installer-env -COPY ./ReceiveServiceNowMessage /src/dotnet-function-app +COPY ./ServiceNowIntegrationService /src/dotnet-function-app COPY ./Shared /Shared RUN cd /src/dotnet-function-app && \ mkdir -p /home/site/wwwroot && \ From a69691b2799001c91964ab3352e3b991ab0ccecf Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Mon, 24 Mar 2025 13:22:38 +0000 Subject: [PATCH 14/20] tring to get function to build --- .../ReceiveServiceNowMessage.csproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.csproj b/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.csproj index 97c47fe24d..bef200b65a 100644 --- a/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.csproj +++ b/application/CohortManager/src/Functions/ServiceNowIntegrationService/ReceiveServiceNowMessage.csproj @@ -27,7 +27,5 @@ - - \ No newline at end of file From d52a860e902610963e4a141b83537d665128c217 Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Mon, 24 Mar 2025 13:55:30 +0000 Subject: [PATCH 15/20] fix: trying to fix docker file --- .../src/Functions/ServiceNowIntegrationService/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile b/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile index c33851bff8..4d106a5749 100644 --- a/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile +++ b/application/CohortManager/src/Functions/ServiceNowIntegrationService/Dockerfile @@ -1,8 +1,8 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS installer-env -COPY ./ServiceNowIntegrationService /src/dotnet-function-app +COPY ./ServiceNowIntegrationService /dotnet-function-app COPY ./Shared /Shared -RUN cd /src/dotnet-function-app && \ +RUN cd /dotnet-function-app && \ mkdir -p /home/site/wwwroot && \ dotnet publish *.csproj --output /home/site/wwwroot From 4d3be45035343e2b6c5e8b8db78c6e31cadcefb7 Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Mon, 24 Mar 2025 14:25:47 +0000 Subject: [PATCH 16/20] fix: fixing unit tests after merge --- .../CreateCohortDistributionTests.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tests/UnitTests/CohortDistributionTests/CreateCohortDistributionTests/CreateCohortDistributionTests.cs b/tests/UnitTests/CohortDistributionTests/CreateCohortDistributionTests/CreateCohortDistributionTests.cs index 9b7b9b8ecb..75eff39b27 100644 --- a/tests/UnitTests/CohortDistributionTests/CreateCohortDistributionTests/CreateCohortDistributionTests.cs +++ b/tests/UnitTests/CohortDistributionTests/CreateCohortDistributionTests/CreateCohortDistributionTests.cs @@ -70,20 +70,19 @@ public CreateCohortDistributionTests() _cohortDistributionHelper .Setup(x => x.ValidateCohortDistributionRecordAsync(It.IsAny(), It.IsAny(), It.IsAny())) - .ReturnsAsync(new ValidationExceptionLog {CreatedException = false, IsFatal = false}); + .ReturnsAsync(new ValidationExceptionLog { CreatedException = false, IsFatal = false }); _participantManagementClientMock .Setup(x => x.GetSingle(It.IsAny())) - .ReturnsAsync(new ParticipantManagement {ExceptionFlag = 0}); - + .ReturnsAsync(new ParticipantManagement { ExceptionFlag = 0 }); + _participantManagementClientMock .Setup(x => x.Update(It.IsAny())) .ReturnsAsync(true); _sut = new CreateCohortDistribution(_logger.Object, _callFunction.Object, _cohortDistributionHelper.Object, _exceptionHandler.Object, _azureQueueStorageHelper.Object, - _participantManagementClientMock.Object); - _config.Object); + _participantManagementClientMock.Object, _config.Object); } @@ -158,11 +157,11 @@ public async Task RunAsync_AllocateServiceProviderToParticipantRequestFails_Retu _participantManagementClientMock .Setup(c => c.GetSingleByFilter(It.IsAny>>())) - .ReturnsAsync(new ParticipantManagement {ExceptionFlag = 0}); - + .ReturnsAsync(new ParticipantManagement { ExceptionFlag = 0 }); + _cohortDistributionHelper .Setup(x => x.RetrieveParticipantDataAsync(It.IsAny())) - .ReturnsAsync(new CohortDistributionParticipant() {ScreeningServiceId = "screeningservice", Postcode = "POSTCODE"}); + .ReturnsAsync(new CohortDistributionParticipant() { ScreeningServiceId = "screeningservice", Postcode = "POSTCODE" }); _cohortDistributionHelper .Setup(x => x.AllocateServiceProviderAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) @@ -203,7 +202,7 @@ public async Task RunAsync_TransformDataServiceRequestFails_ReturnEarly() _participantManagementClientMock .Setup(c => c.GetSingleByFilter(It.IsAny>>())) - .ReturnsAsync(new ParticipantManagement {ExceptionFlag = 0}); + .ReturnsAsync(new ParticipantManagement { ExceptionFlag = 0 }); // Act await _sut.RunAsync(_requestBody); @@ -309,7 +308,7 @@ public async Task RunAsync_ParticipantHasException_CreatesSystemExceptionLog() _callFunction.Setup(x => x.SendPost(It.IsAny(), It.IsAny())).ReturnsAsync(response.Object); _participantManagementClientMock .Setup(c => c.GetSingleByFilter(It.IsAny>>())) - .ReturnsAsync(new ParticipantManagement() {ExceptionFlag = 1}); + .ReturnsAsync(new ParticipantManagement() { ExceptionFlag = 1 }); // Act await _sut.RunAsync(_requestBody); From 53b721fbdabf668809a060fc76e256f2fb197ba0 Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Mon, 24 Mar 2025 15:12:25 +0000 Subject: [PATCH 17/20] chore: addresing comments --- application/CohortManager/compose.core.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/application/CohortManager/compose.core.yaml b/application/CohortManager/compose.core.yaml index b6b8df1773..c537c38683 100644 --- a/application/CohortManager/compose.core.yaml +++ b/application/CohortManager/compose.core.yaml @@ -107,7 +107,7 @@ services: build: context: ./src/Functions/ dockerfile: ParticipantManagementServices/UpdateParticipantFromScreeningProvider/Dockerfile - profiles: [ bi-analytics ] + profiles: [bi-analytics] environment: - ASPNETCORE_URLS=http://*:8001 - ParticipantManagementUrl=http://127.0.0.1:7994/api/ParticipantManagementDataService @@ -123,7 +123,7 @@ services: build: context: ./src/Functions/ dockerfile: ParticipantManagementServices/CheckParticipantExists/Dockerfile - profiles: [ bi-analytics ] + profiles: [bi-analytics] environment: - ASPNETCORE_URLS=http://*:8002 - ParticipantManagementUrl=http://localhost:7994/api/ParticipantManagementDataService @@ -134,7 +134,7 @@ services: build: context: ./src/Functions/ dockerfile: ParticipantManagementServices/GetParticipantReferenceData/Dockerfile - profiles: [ bi-analytics ] + profiles: [bi-analytics] environment: - ASPNETCORE_URLS=http://*:7999 - HigherRiskReferralReasonLkpDataServiceUrl=http://localhost:7992/api/HigherRiskReferralReasonLkpDataService @@ -286,7 +286,7 @@ services: gene-code-lkp-data-service: container_name: gene-code-lkp-data-service network_mode: host - profiles: [ bi-analytics ] + profiles: [bi-analytics] build: context: ./src/Functions/ dockerfile: screeningDataServices/GeneCodeLkpDataService/Dockerfile @@ -301,7 +301,7 @@ services: build: context: ./src/Functions/ dockerfile: screeningDataServices/HigherRiskReferralReasonLkpDataService/Dockerfile - profiles: [ bi-analytics ] + profiles: [bi-analytics] environment: - ASPNETCORE_URLS=http://*:7992 - DtOsDatabaseConnectionString=Server=localhost,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True @@ -455,12 +455,14 @@ services: environment: - ASPNETCORE_URLS=http://*:8996 - DtOsDatabaseConnectionString=Server=localhost,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True + - AcceptableLatencyThresholdMs=500 - receive-service-now-message: + receive-service-now-message: container_name: receive-service-now-message network_mode: host build: context: ./src/Functions/ dockerfile: ServiceNowIntegrationService/Dockerfile + profiles: [not-implemented] environment: - ASPNETCORE_URLS=http://*:7912 From 177285ef9e99e746afcee020438942b6f864cd13 Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Mon, 24 Mar 2025 15:14:51 +0000 Subject: [PATCH 18/20] chore: addresing comments --- application/CohortManager/compose.core.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/application/CohortManager/compose.core.yaml b/application/CohortManager/compose.core.yaml index c537c38683..1544926be4 100644 --- a/application/CohortManager/compose.core.yaml +++ b/application/CohortManager/compose.core.yaml @@ -446,6 +446,7 @@ services: - DtOsDatabaseConnectionString=Server=localhost,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True - AcceptableLatencyThresholdMs=500 + screening-lkp-data-service: container_name: screening-lkp-data-service network_mode: host From e26e05b17e1d467d9c6a96d63a014a6d9c55d95b Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Mon, 24 Mar 2025 15:15:17 +0000 Subject: [PATCH 19/20] chore: addresing comments --- application/CohortManager/compose.core.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/application/CohortManager/compose.core.yaml b/application/CohortManager/compose.core.yaml index 1544926be4..8e9adbf6bb 100644 --- a/application/CohortManager/compose.core.yaml +++ b/application/CohortManager/compose.core.yaml @@ -214,6 +214,7 @@ services: - ExceptionManagementDataServiceURL=http://localhost:7911/api/ExceptionManagementDataService/ - GPPracticeDataServiceURL=http://localhost:7999/api/GPPracticeDataService/ + get-validation-exceptions: container_name: get-validation-exceptions network_mode: host From ea781e2e287e7eaae16da8bf4e05e3b56d7df572 Mon Sep 17 00:00:00 2001 From: SamRobinson75684 Date: Mon, 24 Mar 2025 15:35:48 +0000 Subject: [PATCH 20/20] chore: addressing comments --- application/CohortManager/compose.core.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/CohortManager/compose.core.yaml b/application/CohortManager/compose.core.yaml index 8e9adbf6bb..3802c79c84 100644 --- a/application/CohortManager/compose.core.yaml +++ b/application/CohortManager/compose.core.yaml @@ -465,6 +465,6 @@ services: build: context: ./src/Functions/ dockerfile: ServiceNowIntegrationService/Dockerfile - profiles: [not-implemented] + profiles: [not-implemented] environment: - ASPNETCORE_URLS=http://*:7912