From 4f1b667dd9098776c54da49d4a4171f4d2b5cbcb Mon Sep 17 00:00:00 2001 From: binon Date: Wed, 10 Jan 2024 14:12:24 +0000 Subject: [PATCH 01/34] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ed35e5ab..c270dcdbc 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ Create a Local IIS launch profile for the following projects: - LearningHub.Nhs.AdminUI = https://lh-admin.dev.local - LearningHub.Nhs.WebAPI = https://lh-api.dev.local - LearningHub.Nhs.WebUI = https://lh-web.dev.local -7. Tick the checkbox for **Enable Anonymous Authentication**. +7. Tick the checkbox for **Enable Anonymous Authentication**. ## Rebuild and run From f1eb41f944bbc01521e90cdc90564f592c6e2c21 Mon Sep 17 00:00:00 2001 From: binon Date: Wed, 10 Jan 2024 14:15:08 +0000 Subject: [PATCH 02/34] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ed35e5ab..d7454219f 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ Create a Local IIS launch profile for the following projects: - LearningHub.Nhs.WebUI = https://lh-web.dev.local 7. Tick the checkbox for **Enable Anonymous Authentication**. -## Rebuild and run +## Rebuild and run 1. Rebuild the solution 2. Set **LearningHub.Nhs.WebUI** as the startup Project From 1f9521c1fcb9b3baf26590b880e169044af62efc Mon Sep 17 00:00:00 2001 From: binon Date: Wed, 10 Jan 2024 22:13:16 +0000 Subject: [PATCH 03/34] Addding key --- .gitignore | 4 ++++ LearningHub.Nhs.WebUI/Program.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e0af672bf..0afa44753 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,7 @@ obj /AdminUI/LearningHub.Nhs.AdminUI/Properties/launchSettings.json /WebAPI/LearningHub.Nhs.API/Properties/launchSettings.json /WebAPI/LearningHub.Nhs.API/appsettings.Development.json +/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.dbmdl +/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.jfm +/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Staging.Database/LearningHub.Nhs.Migration.Staging.Database.dbmdl +/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Staging.Database/LearningHub.Nhs.Migration.Staging.Database.jfm diff --git a/LearningHub.Nhs.WebUI/Program.cs b/LearningHub.Nhs.WebUI/Program.cs index 2352d0bc3..ec9685f50 100644 --- a/LearningHub.Nhs.WebUI/Program.cs +++ b/LearningHub.Nhs.WebUI/Program.cs @@ -33,7 +33,7 @@ var builder = WebApplication.CreateBuilder(args); - builder.Configuration.AddUserSecrets(string.Empty); + builder.Configuration.AddUserSecrets("a2ecb5d2-cf13-4551-9cb6-3d86dfbcf8ef"); builder.Logging.ClearProviders(); builder.Logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace); From 3e0cfaf4c303192c84fdb802e234e7b6e092294e Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 16:20:24 +0000 Subject: [PATCH 04/34] Set up CI with Azure Pipelines for WebUI [skip ci] --- azure-pipelines-webui-ci.yml | 110 +++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 azure-pipelines-webui-ci.yml diff --git a/azure-pipelines-webui-ci.yml b/azure-pipelines-webui-ci.yml new file mode 100644 index 000000000..220ced972 --- /dev/null +++ b/azure-pipelines-webui-ci.yml @@ -0,0 +1,110 @@ +# Variable Group 'UAT - Variable Group' was defined in the Variables tab +variables: +- name: BuildParameters.RestoreBuildProjects + value: '**/*.csproj' +- name: BuildParameters.TestProjects + value: '**/*[Tt]ests/*.csproj' +name: $(date:yyyyMMdd)$(rev:.r) +resources: + repositories: + - repository: self + type: git + ref: refs/heads/CI +jobs: +- job: Job_1 + displayName: Agent job + pool: + vmImage: windows-latest + steps: + - checkout: self + clean: true + fetchTags: true + - task: NodeTool@0 + displayName: Use Node 12.19 (otherwise node-sass 4.13 will error - Azure build agent defaults to v14.15 which is incompatible) + inputs: + versionSpec: 12.19 + - task: Npm@1 + displayName: npm custom + inputs: + command: custom + workingDir: LearningHub.Nhs.WebUI + verbose: false + customCommand: install -f + - task: Npm@1 + displayName: run webpack build + inputs: + command: custom + workingDir: LearningHub.Nhs.WebUI + verbose: false + customCommand: run build + - task: NuGetToolInstaller@1 + displayName: Use NuGet 5.8 + inputs: + versionSpec: 5.8 + - task: NuGetCommand@2 + displayName: NuGet restore + inputs: + feedRestore: d99eaf2c-ad74-4a35-876e-f7dc1e45a604 + - task: DotNetCoreCLI@2 + displayName: Restore + inputs: + command: restore + projects: $(BuildParameters.RestoreBuildProjects) + - task: DotNetCoreCLI@2 + displayName: Build + inputs: + projects: $(BuildParameters.RestoreBuildProjects) + arguments: --configuration $(BuildConfiguration) + - task: DotNetCoreCLI@2 + displayName: Test + enabled: False + inputs: + command: test + projects: $(BuildParameters.TestProjects) + arguments: --configuration $(BuildConfiguration) + - task: DotNetCoreCLI@2 + displayName: Publish WebUI + inputs: + command: publish + publishWebProjects: false + projects: '**/*LearningHub.Nhs.WebUI.csproj' + arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/WebUI + zipAfterPublish: True + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact WebUI + condition: succeededOrFailed() + inputs: + PathtoPublish: $(Build.ArtifactStagingDirectory)/WebUI + ArtifactName: WebUI + TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' + - task: DotNetCoreCLI@2 + displayName: Publish AdminUI + inputs: + command: publish + publishWebProjects: false + projects: '**/*LearningHub.Nhs.AdminUI.csproj' + arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/AdminUI + zipAfterPublish: True + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact AdminUI + condition: succeededOrFailed() + inputs: + PathtoPublish: $(Build.ArtifactStagingDirectory)/AdminUI + ArtifactName: AdminUI + TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' + - task: DotNetCoreCLI@2 + displayName: Publish WebAPI + inputs: + command: publish + publishWebProjects: false + projects: '**/*LearningHub.Nhs.Api.csproj' + arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/WebAPI + zipAfterPublish: True + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact WebAPI ' + condition: succeededOrFailed() + inputs: + PathtoPublish: $(Build.ArtifactStagingDirectory)/WebAPI + ArtifactName: WebAPI + TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' +... From aed3dec61c1220c83da98a38af956c382aa2e447 Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 16:22:40 +0000 Subject: [PATCH 05/34] Triggering CI in Azure Pipeline --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d7454219f..7ca2fa3c5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Introduction +# Introduction This is the official open-source repository for the [Learning Hub](https://learninghub.nhs.uk/) platform. The Learning Hub is the national digital learning platform providing easy access to a wide range of educational resources and support for the health and care workforce and educators. From df3f683d0c5de9cf75824e46fec560a977bb9b63 Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 16:24:55 +0000 Subject: [PATCH 06/34] Test whether master branch update triggers --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c270dcdbc..57ceab3c1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Introduction +# Introduction This is the official open-source repository for the [Learning Hub](https://learninghub.nhs.uk/) platform. The Learning Hub is the national digital learning platform providing easy access to a wide range of educational resources and support for the health and care workforce and educators. From b846af69e8112b96797d424249490b77ea2bb928 Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 16:34:32 +0000 Subject: [PATCH 07/34] Update azure-pipelines-webui-ci.yml --- azure-pipelines-webui-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/azure-pipelines-webui-ci.yml b/azure-pipelines-webui-ci.yml index 220ced972..0247cf9be 100644 --- a/azure-pipelines-webui-ci.yml +++ b/azure-pipelines-webui-ci.yml @@ -4,6 +4,10 @@ variables: value: '**/*.csproj' - name: BuildParameters.TestProjects value: '**/*[Tt]ests/*.csproj' +trigger: + branches: + include: + - refs/heads/RC name: $(date:yyyyMMdd)$(rev:.r) resources: repositories: From 9851951fe16528f242d4195e1c04137f2d7a875c Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 16:42:22 +0000 Subject: [PATCH 08/34] Test trigger 2 CI --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ca2fa3c5..e30e445d2 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The Learning Hub is provided and supported by the Technology Enhanced Learning P # Getting Started -## Required installs +## Required installs - [Visual Studio Professional 2022](https://visualstudio.microsoft.com/downloads/) or other suitable An IDE that supports the Microsoft Tech Stack - Make sure you have the [NPM Task Runner](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.NPMTaskRunner) extension - SQL Server 2019 From f8118fa9f078555c4cb9025c0ddfc3f707fd3051 Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 16:42:59 +0000 Subject: [PATCH 09/34] Test trigger 2 master --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 57ceab3c1..c270dcdbc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Introduction +# Introduction This is the official open-source repository for the [Learning Hub](https://learninghub.nhs.uk/) platform. The Learning Hub is the national digital learning platform providing easy access to a wide range of educational resources and support for the health and care workforce and educators. From 3699ef32669514a0d6c0b6f2ee1d80e7db2ae05b Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 16:50:03 +0000 Subject: [PATCH 10/34] Create azure-pipelines-webui-ci.yml --- azure-pipelines-webui-ci.yml | 110 +++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 azure-pipelines-webui-ci.yml diff --git a/azure-pipelines-webui-ci.yml b/azure-pipelines-webui-ci.yml new file mode 100644 index 000000000..220ced972 --- /dev/null +++ b/azure-pipelines-webui-ci.yml @@ -0,0 +1,110 @@ +# Variable Group 'UAT - Variable Group' was defined in the Variables tab +variables: +- name: BuildParameters.RestoreBuildProjects + value: '**/*.csproj' +- name: BuildParameters.TestProjects + value: '**/*[Tt]ests/*.csproj' +name: $(date:yyyyMMdd)$(rev:.r) +resources: + repositories: + - repository: self + type: git + ref: refs/heads/CI +jobs: +- job: Job_1 + displayName: Agent job + pool: + vmImage: windows-latest + steps: + - checkout: self + clean: true + fetchTags: true + - task: NodeTool@0 + displayName: Use Node 12.19 (otherwise node-sass 4.13 will error - Azure build agent defaults to v14.15 which is incompatible) + inputs: + versionSpec: 12.19 + - task: Npm@1 + displayName: npm custom + inputs: + command: custom + workingDir: LearningHub.Nhs.WebUI + verbose: false + customCommand: install -f + - task: Npm@1 + displayName: run webpack build + inputs: + command: custom + workingDir: LearningHub.Nhs.WebUI + verbose: false + customCommand: run build + - task: NuGetToolInstaller@1 + displayName: Use NuGet 5.8 + inputs: + versionSpec: 5.8 + - task: NuGetCommand@2 + displayName: NuGet restore + inputs: + feedRestore: d99eaf2c-ad74-4a35-876e-f7dc1e45a604 + - task: DotNetCoreCLI@2 + displayName: Restore + inputs: + command: restore + projects: $(BuildParameters.RestoreBuildProjects) + - task: DotNetCoreCLI@2 + displayName: Build + inputs: + projects: $(BuildParameters.RestoreBuildProjects) + arguments: --configuration $(BuildConfiguration) + - task: DotNetCoreCLI@2 + displayName: Test + enabled: False + inputs: + command: test + projects: $(BuildParameters.TestProjects) + arguments: --configuration $(BuildConfiguration) + - task: DotNetCoreCLI@2 + displayName: Publish WebUI + inputs: + command: publish + publishWebProjects: false + projects: '**/*LearningHub.Nhs.WebUI.csproj' + arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/WebUI + zipAfterPublish: True + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact WebUI + condition: succeededOrFailed() + inputs: + PathtoPublish: $(Build.ArtifactStagingDirectory)/WebUI + ArtifactName: WebUI + TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' + - task: DotNetCoreCLI@2 + displayName: Publish AdminUI + inputs: + command: publish + publishWebProjects: false + projects: '**/*LearningHub.Nhs.AdminUI.csproj' + arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/AdminUI + zipAfterPublish: True + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact AdminUI + condition: succeededOrFailed() + inputs: + PathtoPublish: $(Build.ArtifactStagingDirectory)/AdminUI + ArtifactName: AdminUI + TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' + - task: DotNetCoreCLI@2 + displayName: Publish WebAPI + inputs: + command: publish + publishWebProjects: false + projects: '**/*LearningHub.Nhs.Api.csproj' + arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/WebAPI + zipAfterPublish: True + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact WebAPI ' + condition: succeededOrFailed() + inputs: + PathtoPublish: $(Build.ArtifactStagingDirectory)/WebAPI + ArtifactName: WebAPI + TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' +... From 692df2b99928d646ab03a9c1646ea27596683ca9 Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 17:10:24 +0000 Subject: [PATCH 11/34] Update azure-pipelines-webui-ci.yml for Azure Pipelines --- azure-pipelines-webui-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/azure-pipelines-webui-ci.yml b/azure-pipelines-webui-ci.yml index 220ced972..6e6b1701e 100644 --- a/azure-pipelines-webui-ci.yml +++ b/azure-pipelines-webui-ci.yml @@ -4,6 +4,10 @@ variables: value: '**/*.csproj' - name: BuildParameters.TestProjects value: '**/*[Tt]ests/*.csproj' +trigger: + branches: + include: + - refs/heads/ci name: $(date:yyyyMMdd)$(rev:.r) resources: repositories: From 07ec9afa1ba78bedea262757ebcfd03d95ac99e5 Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 17:11:20 +0000 Subject: [PATCH 12/34] Update master to test trigger --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c270dcdbc..57ceab3c1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Introduction +# Introduction This is the official open-source repository for the [Learning Hub](https://learninghub.nhs.uk/) platform. The Learning Hub is the national digital learning platform providing easy access to a wide range of educational resources and support for the health and care workforce and educators. From ae4a205d6beb1a1e20831fa16c0e38ae9dc8aa45 Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 17:11:41 +0000 Subject: [PATCH 13/34] Update CI to test trigger --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e30e445d2..9e666ee7b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Introduction +# Introduction This is the official open-source repository for the [Learning Hub](https://learninghub.nhs.uk/) platform. The Learning Hub is the national digital learning platform providing easy access to a wide range of educational resources and support for the health and care workforce and educators. From 81c2533ade93609635a4e0e7a6a7992a378bf1f6 Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 17:15:36 +0000 Subject: [PATCH 14/34] Update azure-pipelines-webui-ci.yml for Azure Pipelines --- azure-pipelines-webui-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/azure-pipelines-webui-ci.yml b/azure-pipelines-webui-ci.yml index 6e6b1701e..509faf6a5 100644 --- a/azure-pipelines-webui-ci.yml +++ b/azure-pipelines-webui-ci.yml @@ -5,9 +5,7 @@ variables: - name: BuildParameters.TestProjects value: '**/*[Tt]ests/*.csproj' trigger: - branches: - include: - - refs/heads/ci + - CI name: $(date:yyyyMMdd)$(rev:.r) resources: repositories: From bbd15a6b0192bb1e7275877603e900b687b9eeea Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 17:16:34 +0000 Subject: [PATCH 15/34] trigger commit ci --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e666ee7b..e30e445d2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Introduction +# Introduction This is the official open-source repository for the [Learning Hub](https://learninghub.nhs.uk/) platform. The Learning Hub is the national digital learning platform providing easy access to a wide range of educational resources and support for the health and care workforce and educators. From eb26de6ee49eda63eac11f929e6e5dcbf62d4b6f Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 17:17:32 +0000 Subject: [PATCH 16/34] Update azure-pipelines-webui-ci.yml --- azure-pipelines-webui-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/azure-pipelines-webui-ci.yml b/azure-pipelines-webui-ci.yml index 0247cf9be..509faf6a5 100644 --- a/azure-pipelines-webui-ci.yml +++ b/azure-pipelines-webui-ci.yml @@ -5,9 +5,7 @@ variables: - name: BuildParameters.TestProjects value: '**/*[Tt]ests/*.csproj' trigger: - branches: - include: - - refs/heads/RC + - CI name: $(date:yyyyMMdd)$(rev:.r) resources: repositories: From ec171d22d20db865fc41a8fb1116de57db334441 Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 17:17:56 +0000 Subject: [PATCH 17/34] Commit to master any effect --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 57ceab3c1..c270dcdbc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Introduction +# Introduction This is the official open-source repository for the [Learning Hub](https://learninghub.nhs.uk/) platform. The Learning Hub is the national digital learning platform providing easy access to a wide range of educational resources and support for the health and care workforce and educators. From 279b7cab1b4aba92cac8d27ff9b1f06dd8e0ba4b Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 22:24:27 +0000 Subject: [PATCH 18/34] Create LearningHub OpenAPI-ReportAPI-CI.yml --- .../LearningHub OpenAPI-ReportAPI-CI.yml | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/LearningHub OpenAPI-ReportAPI-CI.yml diff --git a/.github/workflows/LearningHub OpenAPI-ReportAPI-CI.yml b/.github/workflows/LearningHub OpenAPI-ReportAPI-CI.yml new file mode 100644 index 000000000..0446b79c2 --- /dev/null +++ b/.github/workflows/LearningHub OpenAPI-ReportAPI-CI.yml @@ -0,0 +1,85 @@ +# Agent Queue 'Azure Pipelines' was used with unrecognized Agent Specification, vmImage property must be specified to determine image - https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#software +variables: +- name: BuildParameters.RestoreBuildProjects + value: '**/*.csproj' +- name: BuildParameters.projects + value: '**/*.csproj' +trigger: + - CI +name: $(date:yyyyMMdd)$(rev:.r) +resources: + repositories: + - repository: self + type: git + ref: refs/heads/RC +jobs: +- job: Job_1 + displayName: Agent job + pool: + vmImage: windows-latest + steps: + - checkout: self + clean: true + fetchTags: false + - task: NuGetToolInstaller@1 + displayName: Use NuGet 5.8 + inputs: + versionSpec: 5.8 + - task: NuGetCommand@2 + displayName: NuGet restore + inputs: + feedRestore: d99eaf2c-ad74-4a35-876e-f7dc1e45a604 + - task: DotNetCoreCLI@2 + displayName: Restore + inputs: + command: restore + projects: $(BuildParameters.RestoreBuildProjects) + feedRestore: d99eaf2c-ad74-4a35-876e-f7dc1e45a604 + - task: DotNetCoreCLI@2 + displayName: Build + inputs: + projects: $(BuildParameters.projects) + arguments: --configuration $(BuildConfiguration) /p:Platform=x64 + - task: DotNetCoreCLI@2 + displayName: Test OpenAPI + inputs: + command: test + projects: '**/*LearningHub.Nhs.OpenApi.Tests.csproj' + arguments: --configuration Debug + - task: DotNetCoreCLI@2 + displayName: Test ReportAPI + inputs: + command: test + projects: '**/*LearningHub.Nhs.ReportApi.Services.UnitTests.csproj' + arguments: --configuration Debug + - task: DotNetCoreCLI@2 + displayName: Publish OpenAPI + inputs: + command: publish + publishWebProjects: false + projects: '**/*LearningHub.NHS.OpenAPI.csproj' + arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/OpenAPI + zipAfterPublish: True + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact OpenAPI + condition: succeededOrFailed() + inputs: + PathtoPublish: $(build.artifactstagingdirectory)/OpenAPI + ArtifactName: OpenAPI + TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' + - task: DotNetCoreCLI@2 + displayName: Publish ReportAPI + inputs: + command: publish + publishWebProjects: false + projects: '**/*LearningHub.Nhs.ReportApi.csproj' + arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/ReportAPI + zipAfterPublish: True + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact ReportAPI + condition: succeededOrFailed() + inputs: + PathtoPublish: $(build.artifactstagingdirectory)/ReportAPI + ArtifactName: ReportAPI + TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' +... From 26e01994b57570c440398dab8967dcfc390b073c Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 22:46:12 +0000 Subject: [PATCH 19/34] Delete .github/workflows/LearningHub OpenAPI-ReportAPI-CI.yml --- .../LearningHub OpenAPI-ReportAPI-CI.yml | 85 ------------------- 1 file changed, 85 deletions(-) delete mode 100644 .github/workflows/LearningHub OpenAPI-ReportAPI-CI.yml diff --git a/.github/workflows/LearningHub OpenAPI-ReportAPI-CI.yml b/.github/workflows/LearningHub OpenAPI-ReportAPI-CI.yml deleted file mode 100644 index 0446b79c2..000000000 --- a/.github/workflows/LearningHub OpenAPI-ReportAPI-CI.yml +++ /dev/null @@ -1,85 +0,0 @@ -# Agent Queue 'Azure Pipelines' was used with unrecognized Agent Specification, vmImage property must be specified to determine image - https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#software -variables: -- name: BuildParameters.RestoreBuildProjects - value: '**/*.csproj' -- name: BuildParameters.projects - value: '**/*.csproj' -trigger: - - CI -name: $(date:yyyyMMdd)$(rev:.r) -resources: - repositories: - - repository: self - type: git - ref: refs/heads/RC -jobs: -- job: Job_1 - displayName: Agent job - pool: - vmImage: windows-latest - steps: - - checkout: self - clean: true - fetchTags: false - - task: NuGetToolInstaller@1 - displayName: Use NuGet 5.8 - inputs: - versionSpec: 5.8 - - task: NuGetCommand@2 - displayName: NuGet restore - inputs: - feedRestore: d99eaf2c-ad74-4a35-876e-f7dc1e45a604 - - task: DotNetCoreCLI@2 - displayName: Restore - inputs: - command: restore - projects: $(BuildParameters.RestoreBuildProjects) - feedRestore: d99eaf2c-ad74-4a35-876e-f7dc1e45a604 - - task: DotNetCoreCLI@2 - displayName: Build - inputs: - projects: $(BuildParameters.projects) - arguments: --configuration $(BuildConfiguration) /p:Platform=x64 - - task: DotNetCoreCLI@2 - displayName: Test OpenAPI - inputs: - command: test - projects: '**/*LearningHub.Nhs.OpenApi.Tests.csproj' - arguments: --configuration Debug - - task: DotNetCoreCLI@2 - displayName: Test ReportAPI - inputs: - command: test - projects: '**/*LearningHub.Nhs.ReportApi.Services.UnitTests.csproj' - arguments: --configuration Debug - - task: DotNetCoreCLI@2 - displayName: Publish OpenAPI - inputs: - command: publish - publishWebProjects: false - projects: '**/*LearningHub.NHS.OpenAPI.csproj' - arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/OpenAPI - zipAfterPublish: True - - task: PublishBuildArtifacts@1 - displayName: Publish Artifact OpenAPI - condition: succeededOrFailed() - inputs: - PathtoPublish: $(build.artifactstagingdirectory)/OpenAPI - ArtifactName: OpenAPI - TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' - - task: DotNetCoreCLI@2 - displayName: Publish ReportAPI - inputs: - command: publish - publishWebProjects: false - projects: '**/*LearningHub.Nhs.ReportApi.csproj' - arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/ReportAPI - zipAfterPublish: True - - task: PublishBuildArtifacts@1 - displayName: Publish Artifact ReportAPI - condition: succeededOrFailed() - inputs: - PathtoPublish: $(build.artifactstagingdirectory)/ReportAPI - ArtifactName: ReportAPI - TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' -... From ad9beb92be2a575be638ca2e68d2ac187bf3cd45 Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 22:46:31 +0000 Subject: [PATCH 20/34] Create LearningHub OpenAPI-ReportAPI-CI.yml --- .github/LearningHub OpenAPI-ReportAPI-CI.yml | 85 ++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/LearningHub OpenAPI-ReportAPI-CI.yml diff --git a/.github/LearningHub OpenAPI-ReportAPI-CI.yml b/.github/LearningHub OpenAPI-ReportAPI-CI.yml new file mode 100644 index 000000000..0446b79c2 --- /dev/null +++ b/.github/LearningHub OpenAPI-ReportAPI-CI.yml @@ -0,0 +1,85 @@ +# Agent Queue 'Azure Pipelines' was used with unrecognized Agent Specification, vmImage property must be specified to determine image - https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#software +variables: +- name: BuildParameters.RestoreBuildProjects + value: '**/*.csproj' +- name: BuildParameters.projects + value: '**/*.csproj' +trigger: + - CI +name: $(date:yyyyMMdd)$(rev:.r) +resources: + repositories: + - repository: self + type: git + ref: refs/heads/RC +jobs: +- job: Job_1 + displayName: Agent job + pool: + vmImage: windows-latest + steps: + - checkout: self + clean: true + fetchTags: false + - task: NuGetToolInstaller@1 + displayName: Use NuGet 5.8 + inputs: + versionSpec: 5.8 + - task: NuGetCommand@2 + displayName: NuGet restore + inputs: + feedRestore: d99eaf2c-ad74-4a35-876e-f7dc1e45a604 + - task: DotNetCoreCLI@2 + displayName: Restore + inputs: + command: restore + projects: $(BuildParameters.RestoreBuildProjects) + feedRestore: d99eaf2c-ad74-4a35-876e-f7dc1e45a604 + - task: DotNetCoreCLI@2 + displayName: Build + inputs: + projects: $(BuildParameters.projects) + arguments: --configuration $(BuildConfiguration) /p:Platform=x64 + - task: DotNetCoreCLI@2 + displayName: Test OpenAPI + inputs: + command: test + projects: '**/*LearningHub.Nhs.OpenApi.Tests.csproj' + arguments: --configuration Debug + - task: DotNetCoreCLI@2 + displayName: Test ReportAPI + inputs: + command: test + projects: '**/*LearningHub.Nhs.ReportApi.Services.UnitTests.csproj' + arguments: --configuration Debug + - task: DotNetCoreCLI@2 + displayName: Publish OpenAPI + inputs: + command: publish + publishWebProjects: false + projects: '**/*LearningHub.NHS.OpenAPI.csproj' + arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/OpenAPI + zipAfterPublish: True + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact OpenAPI + condition: succeededOrFailed() + inputs: + PathtoPublish: $(build.artifactstagingdirectory)/OpenAPI + ArtifactName: OpenAPI + TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' + - task: DotNetCoreCLI@2 + displayName: Publish ReportAPI + inputs: + command: publish + publishWebProjects: false + projects: '**/*LearningHub.Nhs.ReportApi.csproj' + arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/ReportAPI + zipAfterPublish: True + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact ReportAPI + condition: succeededOrFailed() + inputs: + PathtoPublish: $(build.artifactstagingdirectory)/ReportAPI + ArtifactName: ReportAPI + TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' +... From b0f95ee3e8f1f245d94c27d349319a9564e647d5 Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 22:51:42 +0000 Subject: [PATCH 21/34] Update master README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c270dcdbc..57ceab3c1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Introduction +# Introduction This is the official open-source repository for the [Learning Hub](https://learninghub.nhs.uk/) platform. The Learning Hub is the national digital learning platform providing easy access to a wide range of educational resources and support for the health and care workforce and educators. From 2f656ef416561d193a3d4efe974d74a5902e5851 Mon Sep 17 00:00:00 2001 From: binon Date: Tue, 16 Jan 2024 22:52:06 +0000 Subject: [PATCH 22/34] Update CI README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e30e445d2..9e666ee7b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Introduction +# Introduction This is the official open-source repository for the [Learning Hub](https://learninghub.nhs.uk/) platform. The Learning Hub is the national digital learning platform providing easy access to a wide range of educational resources and support for the health and care workforce and educators. From 4a4d65df49115287d034c923c2c41b6eca7aa4f1 Mon Sep 17 00:00:00 2001 From: binon Date: Wed, 17 Jan 2024 10:43:31 +0000 Subject: [PATCH 23/34] Create LearningHub Database-CI.yml --- .github/LearningHub Database-CI.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/LearningHub Database-CI.yml diff --git a/.github/LearningHub Database-CI.yml b/.github/LearningHub Database-CI.yml new file mode 100644 index 000000000..8415569c7 --- /dev/null +++ b/.github/LearningHub Database-CI.yml @@ -0,0 +1,30 @@ +trigger: + - CI +resources: + repositories: + - repository: self + type: git + ref: refs/heads/CI +jobs: +- job: Job_1 + displayName: Agent job + pool: + vmImage: windows-2019 + steps: + - checkout: self + clean: true + fetchTags: false + - task: MSBuild@1 + displayName: Build solution **/LearningHub.Nhs.Database.sqlproj + inputs: + solution: '**/LearningHub.Nhs.Database.sqlproj' + msbuildArchitecture: x64 + - task: CopyFiles@2 + displayName: Copy SQL Dacpac File + inputs: + SourceFolder: $(agent.builddirectory)\s + Contents: '**\LearningHub.Nhs.Database.dacpac' + TargetFolder: $(build.artifactstagingdirectory) + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: drop' +... From 21db00d48714d2daba81ffa9683bac10beeb1efc Mon Sep 17 00:00:00 2001 From: binon Date: Wed, 17 Jan 2024 11:05:52 +0000 Subject: [PATCH 24/34] Delete azure-pipelines-webui-ci.yml --- azure-pipelines-webui-ci.yml | 112 ----------------------------------- 1 file changed, 112 deletions(-) delete mode 100644 azure-pipelines-webui-ci.yml diff --git a/azure-pipelines-webui-ci.yml b/azure-pipelines-webui-ci.yml deleted file mode 100644 index 509faf6a5..000000000 --- a/azure-pipelines-webui-ci.yml +++ /dev/null @@ -1,112 +0,0 @@ -# Variable Group 'UAT - Variable Group' was defined in the Variables tab -variables: -- name: BuildParameters.RestoreBuildProjects - value: '**/*.csproj' -- name: BuildParameters.TestProjects - value: '**/*[Tt]ests/*.csproj' -trigger: - - CI -name: $(date:yyyyMMdd)$(rev:.r) -resources: - repositories: - - repository: self - type: git - ref: refs/heads/CI -jobs: -- job: Job_1 - displayName: Agent job - pool: - vmImage: windows-latest - steps: - - checkout: self - clean: true - fetchTags: true - - task: NodeTool@0 - displayName: Use Node 12.19 (otherwise node-sass 4.13 will error - Azure build agent defaults to v14.15 which is incompatible) - inputs: - versionSpec: 12.19 - - task: Npm@1 - displayName: npm custom - inputs: - command: custom - workingDir: LearningHub.Nhs.WebUI - verbose: false - customCommand: install -f - - task: Npm@1 - displayName: run webpack build - inputs: - command: custom - workingDir: LearningHub.Nhs.WebUI - verbose: false - customCommand: run build - - task: NuGetToolInstaller@1 - displayName: Use NuGet 5.8 - inputs: - versionSpec: 5.8 - - task: NuGetCommand@2 - displayName: NuGet restore - inputs: - feedRestore: d99eaf2c-ad74-4a35-876e-f7dc1e45a604 - - task: DotNetCoreCLI@2 - displayName: Restore - inputs: - command: restore - projects: $(BuildParameters.RestoreBuildProjects) - - task: DotNetCoreCLI@2 - displayName: Build - inputs: - projects: $(BuildParameters.RestoreBuildProjects) - arguments: --configuration $(BuildConfiguration) - - task: DotNetCoreCLI@2 - displayName: Test - enabled: False - inputs: - command: test - projects: $(BuildParameters.TestProjects) - arguments: --configuration $(BuildConfiguration) - - task: DotNetCoreCLI@2 - displayName: Publish WebUI - inputs: - command: publish - publishWebProjects: false - projects: '**/*LearningHub.Nhs.WebUI.csproj' - arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/WebUI - zipAfterPublish: True - - task: PublishBuildArtifacts@1 - displayName: Publish Artifact WebUI - condition: succeededOrFailed() - inputs: - PathtoPublish: $(Build.ArtifactStagingDirectory)/WebUI - ArtifactName: WebUI - TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' - - task: DotNetCoreCLI@2 - displayName: Publish AdminUI - inputs: - command: publish - publishWebProjects: false - projects: '**/*LearningHub.Nhs.AdminUI.csproj' - arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/AdminUI - zipAfterPublish: True - - task: PublishBuildArtifacts@1 - displayName: Publish Artifact AdminUI - condition: succeededOrFailed() - inputs: - PathtoPublish: $(Build.ArtifactStagingDirectory)/AdminUI - ArtifactName: AdminUI - TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' - - task: DotNetCoreCLI@2 - displayName: Publish WebAPI - inputs: - command: publish - publishWebProjects: false - projects: '**/*LearningHub.Nhs.Api.csproj' - arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/WebAPI - zipAfterPublish: True - - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact WebAPI ' - condition: succeededOrFailed() - inputs: - PathtoPublish: $(Build.ArtifactStagingDirectory)/WebAPI - ArtifactName: WebAPI - TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' -... From 914ed158e790d25aa7761e4c3a016df6178d6e84 Mon Sep 17 00:00:00 2001 From: binon Date: Wed, 17 Jan 2024 11:10:56 +0000 Subject: [PATCH 25/34] Create azure-pipeline-webui-ci.yml --- .github/azure-pipeline-webui-ci.yml | 112 ++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 .github/azure-pipeline-webui-ci.yml diff --git a/.github/azure-pipeline-webui-ci.yml b/.github/azure-pipeline-webui-ci.yml new file mode 100644 index 000000000..509faf6a5 --- /dev/null +++ b/.github/azure-pipeline-webui-ci.yml @@ -0,0 +1,112 @@ +# Variable Group 'UAT - Variable Group' was defined in the Variables tab +variables: +- name: BuildParameters.RestoreBuildProjects + value: '**/*.csproj' +- name: BuildParameters.TestProjects + value: '**/*[Tt]ests/*.csproj' +trigger: + - CI +name: $(date:yyyyMMdd)$(rev:.r) +resources: + repositories: + - repository: self + type: git + ref: refs/heads/CI +jobs: +- job: Job_1 + displayName: Agent job + pool: + vmImage: windows-latest + steps: + - checkout: self + clean: true + fetchTags: true + - task: NodeTool@0 + displayName: Use Node 12.19 (otherwise node-sass 4.13 will error - Azure build agent defaults to v14.15 which is incompatible) + inputs: + versionSpec: 12.19 + - task: Npm@1 + displayName: npm custom + inputs: + command: custom + workingDir: LearningHub.Nhs.WebUI + verbose: false + customCommand: install -f + - task: Npm@1 + displayName: run webpack build + inputs: + command: custom + workingDir: LearningHub.Nhs.WebUI + verbose: false + customCommand: run build + - task: NuGetToolInstaller@1 + displayName: Use NuGet 5.8 + inputs: + versionSpec: 5.8 + - task: NuGetCommand@2 + displayName: NuGet restore + inputs: + feedRestore: d99eaf2c-ad74-4a35-876e-f7dc1e45a604 + - task: DotNetCoreCLI@2 + displayName: Restore + inputs: + command: restore + projects: $(BuildParameters.RestoreBuildProjects) + - task: DotNetCoreCLI@2 + displayName: Build + inputs: + projects: $(BuildParameters.RestoreBuildProjects) + arguments: --configuration $(BuildConfiguration) + - task: DotNetCoreCLI@2 + displayName: Test + enabled: False + inputs: + command: test + projects: $(BuildParameters.TestProjects) + arguments: --configuration $(BuildConfiguration) + - task: DotNetCoreCLI@2 + displayName: Publish WebUI + inputs: + command: publish + publishWebProjects: false + projects: '**/*LearningHub.Nhs.WebUI.csproj' + arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/WebUI + zipAfterPublish: True + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact WebUI + condition: succeededOrFailed() + inputs: + PathtoPublish: $(Build.ArtifactStagingDirectory)/WebUI + ArtifactName: WebUI + TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' + - task: DotNetCoreCLI@2 + displayName: Publish AdminUI + inputs: + command: publish + publishWebProjects: false + projects: '**/*LearningHub.Nhs.AdminUI.csproj' + arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/AdminUI + zipAfterPublish: True + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact AdminUI + condition: succeededOrFailed() + inputs: + PathtoPublish: $(Build.ArtifactStagingDirectory)/AdminUI + ArtifactName: AdminUI + TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' + - task: DotNetCoreCLI@2 + displayName: Publish WebAPI + inputs: + command: publish + publishWebProjects: false + projects: '**/*LearningHub.Nhs.Api.csproj' + arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/WebAPI + zipAfterPublish: True + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact WebAPI ' + condition: succeededOrFailed() + inputs: + PathtoPublish: $(Build.ArtifactStagingDirectory)/WebAPI + ArtifactName: WebAPI + TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' +... From 07081ceacd4a14fdc28ff0f0041a14b70bcd670c Mon Sep 17 00:00:00 2001 From: binon Date: Wed, 17 Jan 2024 11:11:44 +0000 Subject: [PATCH 26/34] Rename LearningHub OpenAPI-ReportAPI-CI.yml to azure-pipeline-openApi-reportApi-CI.yml --- ...I-ReportAPI-CI.yml => azure-pipeline-openApi-reportApi-CI.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{LearningHub OpenAPI-ReportAPI-CI.yml => azure-pipeline-openApi-reportApi-CI.yml} (100%) diff --git a/.github/LearningHub OpenAPI-ReportAPI-CI.yml b/.github/azure-pipeline-openApi-reportApi-CI.yml similarity index 100% rename from .github/LearningHub OpenAPI-ReportAPI-CI.yml rename to .github/azure-pipeline-openApi-reportApi-CI.yml From 6a550912143c3042c8427a4b1a5df80f3eb688e2 Mon Sep 17 00:00:00 2001 From: binon Date: Wed, 17 Jan 2024 11:12:09 +0000 Subject: [PATCH 27/34] Rename LearningHub Database-CI.yml to azure-pipeline-database-ci.yml --- ...LearningHub Database-CI.yml => azure-pipeline-database-ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{LearningHub Database-CI.yml => azure-pipeline-database-ci.yml} (100%) diff --git a/.github/LearningHub Database-CI.yml b/.github/azure-pipeline-database-ci.yml similarity index 100% rename from .github/LearningHub Database-CI.yml rename to .github/azure-pipeline-database-ci.yml From c4bb351a9b43874e2a6aa7c3adc454ee7f43cf93 Mon Sep 17 00:00:00 2001 From: binon Date: Wed, 17 Jan 2024 11:12:34 +0000 Subject: [PATCH 28/34] Rename azure-pipeline-openApi-reportApi-CI.yml to azure-pipeline-openapi-reportapi-ci.yml --- ...i-reportApi-CI.yml => azure-pipeline-openapi-reportapi-ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{azure-pipeline-openApi-reportApi-CI.yml => azure-pipeline-openapi-reportapi-ci.yml} (100%) diff --git a/.github/azure-pipeline-openApi-reportApi-CI.yml b/.github/azure-pipeline-openapi-reportapi-ci.yml similarity index 100% rename from .github/azure-pipeline-openApi-reportApi-CI.yml rename to .github/azure-pipeline-openapi-reportapi-ci.yml From 59d465e71b3be9f428c08f0b8f51f062fc1dc476 Mon Sep 17 00:00:00 2001 From: binon Date: Wed, 17 Jan 2024 11:13:13 +0000 Subject: [PATCH 29/34] Delete azure-pipelines-webui-ci.yml --- azure-pipelines-webui-ci.yml | 112 ----------------------------------- 1 file changed, 112 deletions(-) delete mode 100644 azure-pipelines-webui-ci.yml diff --git a/azure-pipelines-webui-ci.yml b/azure-pipelines-webui-ci.yml deleted file mode 100644 index 509faf6a5..000000000 --- a/azure-pipelines-webui-ci.yml +++ /dev/null @@ -1,112 +0,0 @@ -# Variable Group 'UAT - Variable Group' was defined in the Variables tab -variables: -- name: BuildParameters.RestoreBuildProjects - value: '**/*.csproj' -- name: BuildParameters.TestProjects - value: '**/*[Tt]ests/*.csproj' -trigger: - - CI -name: $(date:yyyyMMdd)$(rev:.r) -resources: - repositories: - - repository: self - type: git - ref: refs/heads/CI -jobs: -- job: Job_1 - displayName: Agent job - pool: - vmImage: windows-latest - steps: - - checkout: self - clean: true - fetchTags: true - - task: NodeTool@0 - displayName: Use Node 12.19 (otherwise node-sass 4.13 will error - Azure build agent defaults to v14.15 which is incompatible) - inputs: - versionSpec: 12.19 - - task: Npm@1 - displayName: npm custom - inputs: - command: custom - workingDir: LearningHub.Nhs.WebUI - verbose: false - customCommand: install -f - - task: Npm@1 - displayName: run webpack build - inputs: - command: custom - workingDir: LearningHub.Nhs.WebUI - verbose: false - customCommand: run build - - task: NuGetToolInstaller@1 - displayName: Use NuGet 5.8 - inputs: - versionSpec: 5.8 - - task: NuGetCommand@2 - displayName: NuGet restore - inputs: - feedRestore: d99eaf2c-ad74-4a35-876e-f7dc1e45a604 - - task: DotNetCoreCLI@2 - displayName: Restore - inputs: - command: restore - projects: $(BuildParameters.RestoreBuildProjects) - - task: DotNetCoreCLI@2 - displayName: Build - inputs: - projects: $(BuildParameters.RestoreBuildProjects) - arguments: --configuration $(BuildConfiguration) - - task: DotNetCoreCLI@2 - displayName: Test - enabled: False - inputs: - command: test - projects: $(BuildParameters.TestProjects) - arguments: --configuration $(BuildConfiguration) - - task: DotNetCoreCLI@2 - displayName: Publish WebUI - inputs: - command: publish - publishWebProjects: false - projects: '**/*LearningHub.Nhs.WebUI.csproj' - arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/WebUI - zipAfterPublish: True - - task: PublishBuildArtifacts@1 - displayName: Publish Artifact WebUI - condition: succeededOrFailed() - inputs: - PathtoPublish: $(Build.ArtifactStagingDirectory)/WebUI - ArtifactName: WebUI - TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' - - task: DotNetCoreCLI@2 - displayName: Publish AdminUI - inputs: - command: publish - publishWebProjects: false - projects: '**/*LearningHub.Nhs.AdminUI.csproj' - arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/AdminUI - zipAfterPublish: True - - task: PublishBuildArtifacts@1 - displayName: Publish Artifact AdminUI - condition: succeededOrFailed() - inputs: - PathtoPublish: $(Build.ArtifactStagingDirectory)/AdminUI - ArtifactName: AdminUI - TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' - - task: DotNetCoreCLI@2 - displayName: Publish WebAPI - inputs: - command: publish - publishWebProjects: false - projects: '**/*LearningHub.Nhs.Api.csproj' - arguments: --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)/WebAPI - zipAfterPublish: True - - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact WebAPI ' - condition: succeededOrFailed() - inputs: - PathtoPublish: $(Build.ArtifactStagingDirectory)/WebAPI - ArtifactName: WebAPI - TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' -... From f62a59fe3e12e22b950d7536b61d3c3bfb27f482 Mon Sep 17 00:00:00 2001 From: binon Date: Wed, 17 Jan 2024 12:07:21 +0000 Subject: [PATCH 30/34] Update master check trigger --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0aae38a73..128876173 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The Learning Hub is provided and supported by the Technology Enhanced Learning P # Getting Started -## Required installs +## Required installs - [Visual Studio Professional 2022](https://visualstudio.microsoft.com/downloads/) or other suitable An IDE that supports the Microsoft Tech Stack - Make sure you have the [NPM Task Runner](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.NPMTaskRunner) extension - SQL Server 2019 From 289e7aae0c57a3370d60ad5a28205dc83c6de061 Mon Sep 17 00:00:00 2001 From: binon Date: Wed, 17 Jan 2024 12:07:57 +0000 Subject: [PATCH 31/34] Update CI check trigger --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e666ee7b..7ca2fa3c5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Introduction +# Introduction This is the official open-source repository for the [Learning Hub](https://learninghub.nhs.uk/) platform. The Learning Hub is the national digital learning platform providing easy access to a wide range of educational resources and support for the health and care workforce and educators. @@ -7,7 +7,7 @@ The Learning Hub is provided and supported by the Technology Enhanced Learning P # Getting Started -## Required installs +## Required installs - [Visual Studio Professional 2022](https://visualstudio.microsoft.com/downloads/) or other suitable An IDE that supports the Microsoft Tech Stack - Make sure you have the [NPM Task Runner](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.NPMTaskRunner) extension - SQL Server 2019 From 12fde4911c3803a2ce4facccbf23d4dfaeeca8cc Mon Sep 17 00:00:00 2001 From: binon Date: Thu, 18 Jan 2024 10:41:14 +0000 Subject: [PATCH 32/34] WebAPI - hot fix changes --- .../Scripts/ExternalSystemData.sql | 38 +++++++++++++++++++ .../GetNodeContentsForCatalogueBrowse.sql | 2 +- ...ntsForCatalogueBrowse_withEmptyFolders.sql | 2 +- .../HierarchyService.cs | 9 ++++- 4 files changed, 48 insertions(+), 3 deletions(-) diff --git a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/ExternalSystemData.sql b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/ExternalSystemData.sql index 8ed6229df..5560158ab 100644 --- a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/ExternalSystemData.sql +++ b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/ExternalSystemData.sql @@ -17,3 +17,41 @@ INSERT INTO [external].[ExternalSystemDeepLink] ,57541 ,SYSDATETIMEOFFSET()) END + +IF NOT EXISTS (SELECT 1 FROM [external].[ExternalSystem] WHERE [Code] = 'DigitalLearningSolutionsSso') +BEGIN +INSERT INTO [external].[ExternalSystem] + ([Name] + ,[Code] + ,[CallbackUrl] + ,[SecretKey] + ,[TermsAndConditions] + ,[DefaultUserGroupId] + ,[DefaultStaffGroupId] + ,[DefaultJobRoleId] + ,[DefaultGradingId] + ,[DefaultSpecialityId] + ,[DefaultLocationId] + ,[Deleted] + ,[CreateUserId] + ,[CreateDate] + ,[AmendUserId] + ,[AmendDate]) + VALUES + ('Digital Learning Solutions' + ,'DigitalLearningSolutionsSso' + ,'https://www.dls.nhs.uk/v2/linkaccount/accountlinked' + ,'74A90C2B-5BC5-4877-8607-43AD08DEA983' + ,'By clicking the button below, you agree to the Learning Hub and Digital Learning Solutions creating a link between your accounts on their systems so that you can log in to the Learning Hub seamlessly from the Digital Learning Solutions site via Single Sign On. Do you agree to the Learning Hub and Digital Learning Solutions linking your accounts?' + ,'1070' + ,null + ,null + ,null + ,227 + ,1 + ,0 + ,57541 + ,SYSDATETIMEOFFSET() + ,57541 + ,SYSDATETIMEOFFSET()) +END diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetNodeContentsForCatalogueBrowse.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetNodeContentsForCatalogueBrowse.sql index 0bd9f3f52..6c2c4fb8d 100644 --- a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetNodeContentsForCatalogueBrowse.sql +++ b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetNodeContentsForCatalogueBrowse.sql @@ -122,6 +122,6 @@ BEGIN AND rv.Deleted = 0 ) AS t1 - ORDER BY DisplayOrder ASC + ORDER BY NodeTypeId DESC,DisplayOrder ASC END GO \ No newline at end of file diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetNodeContentsForCatalogueBrowse_withEmptyFolders.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetNodeContentsForCatalogueBrowse_withEmptyFolders.sql index 9dfa34fe7..1e0000213 100644 --- a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetNodeContentsForCatalogueBrowse_withEmptyFolders.sql +++ b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetNodeContentsForCatalogueBrowse_withEmptyFolders.sql @@ -117,6 +117,6 @@ BEGIN AND rv.Deleted = 0 ) AS t1 - ORDER BY DisplayOrder ASC + ORDER BY NodeTypeId DESC,DisplayOrder ASC END GO \ No newline at end of file diff --git a/WebAPI/LearningHub.Nhs.Services/HierarchyService.cs b/WebAPI/LearningHub.Nhs.Services/HierarchyService.cs index 9b9d97e7d..0f55404f7 100644 --- a/WebAPI/LearningHub.Nhs.Services/HierarchyService.cs +++ b/WebAPI/LearningHub.Nhs.Services/HierarchyService.cs @@ -269,6 +269,10 @@ public async Task> GetNodeContentsForCatalogueB string cacheKey = $"{CacheKeys.PublishedNodeContents}:{nodeId}"; var nodeContents = await this.cachingService.GetAsync>(cacheKey); + if (includeEmptyFolder) + { + nodeContents.ResponseEnum = CacheReadResponseEnum.NotFound; + } if (nodeContents.ResponseEnum == CacheReadResponseEnum.Found) { @@ -285,7 +289,10 @@ public async Task> GetNodeContentsForCatalogueB throw new Exception($"Corrupt data. Duplicate Nodes returned in NodeContent for NodeId={nodeId}"); } - await this.cachingService.SetAsync(cacheKey, retVal); + if (!includeEmptyFolder) + { + await this.cachingService.SetAsync(cacheKey, retVal); + } } var list = retVal.Where(ncm => ncm.ResourceVersionId.HasValue); From abddd2ccdb2cab8ceef394346a91503ce636f77f Mon Sep 17 00:00:00 2001 From: binon Date: Thu, 18 Jan 2024 10:50:46 +0000 Subject: [PATCH 33/34] RC hot fixes WebUI --- .gitguardian.yaml | 5 + .../Controllers/Api/UserController.cs | 12 ++ .../Controllers/ResourceController.cs | 2 +- .../Scripts/vuesrc/data/user.ts | 15 +- .../vuesrc/resource/ResourceContent.vue | 23 +- .../resource/blocks/ImageCarouselViewer.vue | 3 +- .../Services/SearchService.cs | 9 +- .../Views/Catalogue/Catalogues.cshtml | 196 +++++++++--------- .../Views/Home/_CatalogueCard.cshtml | 2 +- .../Views/Home/_ResourceCard.cshtml | 130 ++++++------ .../Search/_CatalogueSearchResult.cshtml | 170 +++++++-------- .../Views/Search/_ResourceSearchResult.cshtml | 148 ++++++------- 12 files changed, 373 insertions(+), 342 deletions(-) create mode 100644 .gitguardian.yaml diff --git a/.gitguardian.yaml b/.gitguardian.yaml new file mode 100644 index 000000000..0685713d8 --- /dev/null +++ b/.gitguardian.yaml @@ -0,0 +1,5 @@ +secret: + ignored-matches: + - match: 26841b2b92a38ec6d2dd87ccc2d4f6d3613486c21f4cf5cb4d98b4527dfc0061 + name: Generic High Entropy Secret - LearningHub.Nhs.WebUI/Program.cs +version: 2 diff --git a/LearningHub.Nhs.WebUI/Controllers/Api/UserController.cs b/LearningHub.Nhs.WebUI/Controllers/Api/UserController.cs index e2b9c09b5..7e5d42864 100644 --- a/LearningHub.Nhs.WebUI/Controllers/Api/UserController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/Api/UserController.cs @@ -90,6 +90,18 @@ public async Task GetUserAccessType() return this.Ok(isGeneralUser); } + /// + /// to get user role. + /// + /// The . + [HttpGet] + [Route("CheckUserRole")] + public async Task CheckUserRole() + { + var isSystemAdmin = this.User.IsInRole("Administrator"); + return this.Ok(isSystemAdmin); + } + /// /// The GetCurrentUserPersonalDetails. /// diff --git a/LearningHub.Nhs.WebUI/Controllers/ResourceController.cs b/LearningHub.Nhs.WebUI/Controllers/ResourceController.cs index 97df3861f..b040c2cf8 100644 --- a/LearningHub.Nhs.WebUI/Controllers/ResourceController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/ResourceController.cs @@ -136,7 +136,7 @@ public async Task Index(int resourceReferenceId, bool? acceptSens var userGroups = await this.userGroupService.GetRoleUserGroupDetailForUserAsync(this.CurrentUserId); hasCatalogueAccess = userGroups.Any(x => x.CatalogueNodeId == resource.Catalogue.NodeId && - (x.RoleEnum == RoleEnum.LocalAdmin || x.RoleEnum == RoleEnum.Editor || x.RoleEnum == RoleEnum.Reader)); + (x.RoleEnum == RoleEnum.LocalAdmin || x.RoleEnum == RoleEnum.Editor || x.RoleEnum == RoleEnum.Reader)) || this.User.IsInRole("Administrator"); } else if (!resource.Catalogue.RestrictedAccess) { diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/data/user.ts b/LearningHub.Nhs.WebUI/Scripts/vuesrc/data/user.ts index 757b948ba..472ca9bac 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/data/user.ts +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/data/user.ts @@ -54,6 +54,18 @@ const isGeneralUser = async function (): Promise { }); }; +const IsSystemAdmin = async function (): Promise { + var IsSystemAdmin = `/api/User/CheckUserRole`; + return await AxiosWrapper.axios.get(IsSystemAdmin) + .then(response => { + return response.data; + }) + .catch(e => { + console.log('IsSystemAdmin:' + e); + throw e; + }); +}; + const getCurrentUserBasicDetails = async function (): Promise { return await AxiosWrapper.axios.get('/api/User/GetCurrentUserBasicDetails') .then(response => { @@ -160,5 +172,6 @@ export const userData = { updateSecurityQuestionAnswers, keepUserSessionAlive, getkeepUserSessionAliveInterval, - isGeneralUser + isGeneralUser, + IsSystemAdmin } diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/resource/ResourceContent.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/resource/ResourceContent.vue index efc9dad7c..fd68981da 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/resource/ResourceContent.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/resource/ResourceContent.vue @@ -8,7 +8,7 @@
- +