From 076875cc647be1a911223c60d1cda0623a9fa28d Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Thu, 4 Jul 2024 09:39:49 +0100 Subject: [PATCH 1/6] PC-NONE: add miro board to mr template --- .github/pull_request_template.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 874b8d6..f468853 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -14,6 +14,7 @@ Add the ticket number below and uncomment - [ ] I have checked there are no unintentional line ending changes - [ ] I have added tests where applicable - [ ] If I have made any changes to the code, I have used the IDE auto-formatter on it +- [ ] If I have made any changes to website flow, I have updated the [Flow Miro Board](https://miro.com/app/board/uXjVK4g4M0Q=/) - [ ] If I have made any changes to website flow, I have checked forward and back behaviour is still consistent - [ ] If I have made any changes to the Local Authority or Consortium data, I have made sure these changes have been reflected in [the main HUG2 repository](https://github.com/UKGovernmentBEIS/desnz-home-energy-retrofit-beta) From a2fa42a5c225495ba3e989bc4ebf2393c2cd96a0 Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Wed, 31 Jul 2024 11:14:41 +0100 Subject: [PATCH 2/6] PC-1049: Update C# and .Net and fix concurrency --- .github/workflows/build-and-run-tests.yml | 4 ++-- Dockerfile | 4 ++-- HerPortal.BusinessLogic/HerPortal.BusinessLogic.csproj | 2 +- HerPortal.Data/HerPortal.Data.csproj | 2 +- HerPortal.ManagementShell/HerPortal.ManagementShell.csproj | 2 +- HerPortal.UnitTests/HerPortal.UnitTests.csproj | 2 +- HerPortal/HerPortal.csproj | 4 ++-- HerPortal/Services/StaticAssetsVersioningService.cs | 3 ++- global.json | 2 +- 9 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-and-run-tests.yml b/.github/workflows/build-and-run-tests.yml index 32f5398..1d0b72f 100644 --- a/.github/workflows/build-and-run-tests.yml +++ b/.github/workflows/build-and-run-tests.yml @@ -17,10 +17,10 @@ jobs: - name: Checkout code onto job runner uses: actions/checkout@v2 - - name: Install .Net (6.0) + - name: Install .Net (8.0) uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x - name: Restore .Net dependencies run: dotnet restore --configfile nuget.config diff --git a/Dockerfile b/Dockerfile index 98c0d41..6db6a3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN npm ci RUN npm run build # C# build step -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /source COPY --from=node_build . . @@ -27,7 +27,7 @@ RUN dotnet build HerPortal.ManagementShell/ --use-current-runtime --self-contain # final stage/image -FROM mcr.microsoft.com/dotnet/aspnet:6.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /app COPY --from=build /app . COPY --from=build /cli ./cli diff --git a/HerPortal.BusinessLogic/HerPortal.BusinessLogic.csproj b/HerPortal.BusinessLogic/HerPortal.BusinessLogic.csproj index ddb1326..49ef2dc 100644 --- a/HerPortal.BusinessLogic/HerPortal.BusinessLogic.csproj +++ b/HerPortal.BusinessLogic/HerPortal.BusinessLogic.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable diff --git a/HerPortal.Data/HerPortal.Data.csproj b/HerPortal.Data/HerPortal.Data.csproj index d53bee8..8c1bb79 100644 --- a/HerPortal.Data/HerPortal.Data.csproj +++ b/HerPortal.Data/HerPortal.Data.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable diff --git a/HerPortal.ManagementShell/HerPortal.ManagementShell.csproj b/HerPortal.ManagementShell/HerPortal.ManagementShell.csproj index 6e70050..9455d11 100644 --- a/HerPortal.ManagementShell/HerPortal.ManagementShell.csproj +++ b/HerPortal.ManagementShell/HerPortal.ManagementShell.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 enable enable diff --git a/HerPortal.UnitTests/HerPortal.UnitTests.csproj b/HerPortal.UnitTests/HerPortal.UnitTests.csproj index a79422c..5f9d460 100644 --- a/HerPortal.UnitTests/HerPortal.UnitTests.csproj +++ b/HerPortal.UnitTests/HerPortal.UnitTests.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 false Tests diff --git a/HerPortal/HerPortal.csproj b/HerPortal/HerPortal.csproj index 695a0ff..c0eaf8c 100644 --- a/HerPortal/HerPortal.csproj +++ b/HerPortal/HerPortal.csproj @@ -1,8 +1,8 @@  - net6.0 - 10 + net8.0 + 12 b05a1249-b368-4866-addb-a537726db09b diff --git a/HerPortal/Services/StaticAssetsVersioningService.cs b/HerPortal/Services/StaticAssetsVersioningService.cs index f12926e..874193e 100644 --- a/HerPortal/Services/StaticAssetsVersioningService.cs +++ b/HerPortal/Services/StaticAssetsVersioningService.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Linq; @@ -26,7 +27,7 @@ public StaticAssetsVersioningService(IWebHostEnvironment environment) private const string AppJsRegex = "app-.*.js"; private const string Html5ShivJsRegex = "html5shiv-.*.js"; - private Dictionary cachedFilenames = new Dictionary(); + private ConcurrentDictionary cachedFilenames = new(); public string GetAppCssFilename() => GetStaticFile(CompiledDirectory, AppCssRegex); public string GetAppIe8CssFilename() => GetStaticFile(CompiledDirectory, AppIe8CssRegex); diff --git a/global.json b/global.json index 1d5e2b1..9a56770 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "5.0", + "version": "8.0", "rollForward": "latestMajor", "allowPrerelease": true } From 1badb330910f0a963a1f9ca34b4ccf0826a066e8 Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Wed, 31 Jul 2024 11:50:59 +0100 Subject: [PATCH 3/6] PC-1024: Fix middleware --- HerPortal/Middleware/SecurityHeadersMiddleware.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/HerPortal/Middleware/SecurityHeadersMiddleware.cs b/HerPortal/Middleware/SecurityHeadersMiddleware.cs index cb50e8e..16fdbb0 100644 --- a/HerPortal/Middleware/SecurityHeadersMiddleware.cs +++ b/HerPortal/Middleware/SecurityHeadersMiddleware.cs @@ -25,12 +25,12 @@ public Task Invoke(HttpContext context) { if (!context.Response.Headers.ContainsKey(XContentTypeOptions)) { - context.Response.Headers.Add(XContentTypeOptions, "nosniff"); + context.Response.Headers.Append(XContentTypeOptions, "nosniff"); } if (!context.Response.Headers.ContainsKey(XFrameOptions)) { - context.Response.Headers.Add(XFrameOptions, "deny"); + context.Response.Headers.Append(XFrameOptions, "deny"); } var nonce = Guid.NewGuid().ToString("N"); @@ -39,7 +39,7 @@ public Task Invoke(HttpContext context) if (!context.Response.Headers.ContainsKey(ContentSecurityPolicy)) { // Based on https://csp.withgoogle.com/docs/strict-csp.html - context.Response.Headers.Add(ContentSecurityPolicy, + context.Response.Headers.Append(ContentSecurityPolicy, "object-src 'none'; " + $"script-src 'nonce-{nonce}' 'unsafe-inline' 'strict-dynamic' https:; " + "base-uri 'none';"); @@ -47,7 +47,7 @@ public Task Invoke(HttpContext context) if (!context.Response.Headers.ContainsKey(ReferrerPolicy)) { - context.Response.Headers.Add(ReferrerPolicy, "no-referrer"); + context.Response.Headers.Append(ReferrerPolicy, "no-referrer"); } return next(context); From a4f6f8d33005b97dd7bc85f69475aefc1b20fbc1 Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Thu, 1 Aug 2024 11:56:11 +0100 Subject: [PATCH 4/6] PC-1024: Update microsoft.identity.web --- HerPortal/HerPortal.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HerPortal/HerPortal.csproj b/HerPortal/HerPortal.csproj index c0eaf8c..90c3bf0 100644 --- a/HerPortal/HerPortal.csproj +++ b/HerPortal/HerPortal.csproj @@ -8,7 +8,7 @@ - + @@ -16,7 +16,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + From c80729aa82209cc8375b63f5871db649c129bd7c Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Mon, 5 Aug 2024 17:18:20 +0100 Subject: [PATCH 5/6] PC-1024: Add langversion to csproj --- HerPortal.BusinessLogic/HerPortal.BusinessLogic.csproj | 1 + HerPortal.Data/HerPortal.Data.csproj | 1 + HerPortal.ManagementShell/HerPortal.ManagementShell.csproj | 1 + HerPortal.UnitTests/HerPortal.UnitTests.csproj | 1 + 4 files changed, 4 insertions(+) diff --git a/HerPortal.BusinessLogic/HerPortal.BusinessLogic.csproj b/HerPortal.BusinessLogic/HerPortal.BusinessLogic.csproj index 49ef2dc..bb785ca 100644 --- a/HerPortal.BusinessLogic/HerPortal.BusinessLogic.csproj +++ b/HerPortal.BusinessLogic/HerPortal.BusinessLogic.csproj @@ -2,6 +2,7 @@ net8.0 + 12 enable diff --git a/HerPortal.Data/HerPortal.Data.csproj b/HerPortal.Data/HerPortal.Data.csproj index 8c1bb79..98a8357 100644 --- a/HerPortal.Data/HerPortal.Data.csproj +++ b/HerPortal.Data/HerPortal.Data.csproj @@ -2,6 +2,7 @@ net8.0 + 12 enable diff --git a/HerPortal.ManagementShell/HerPortal.ManagementShell.csproj b/HerPortal.ManagementShell/HerPortal.ManagementShell.csproj index 9455d11..a189e93 100644 --- a/HerPortal.ManagementShell/HerPortal.ManagementShell.csproj +++ b/HerPortal.ManagementShell/HerPortal.ManagementShell.csproj @@ -3,6 +3,7 @@ Exe net8.0 + 12 enable enable diff --git a/HerPortal.UnitTests/HerPortal.UnitTests.csproj b/HerPortal.UnitTests/HerPortal.UnitTests.csproj index 5f9d460..b838a8c 100644 --- a/HerPortal.UnitTests/HerPortal.UnitTests.csproj +++ b/HerPortal.UnitTests/HerPortal.UnitTests.csproj @@ -3,6 +3,7 @@ net8.0 false + 12 Tests From 07a87ff6d8b3abc50c173679964366f697a1436d Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Tue, 1 Oct 2024 15:46:02 +0100 Subject: [PATCH 6/6] PC-NONE: update miro links in pr template to use the links in the DESNZ organisation --- .github/pull_request_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f468853..dc0ec98 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -14,7 +14,7 @@ Add the ticket number below and uncomment - [ ] I have checked there are no unintentional line ending changes - [ ] I have added tests where applicable - [ ] If I have made any changes to the code, I have used the IDE auto-formatter on it -- [ ] If I have made any changes to website flow, I have updated the [Flow Miro Board](https://miro.com/app/board/uXjVK4g4M0Q=/) +- [ ] If I have made any changes to website flow, I have updated the [Flow Miro Board](https://miro.com/app/board/uXjVK4BNrFU=/) - [ ] If I have made any changes to website flow, I have checked forward and back behaviour is still consistent - [ ] If I have made any changes to the Local Authority or Consortium data, I have made sure these changes have been reflected in [the main HUG2 repository](https://github.com/UKGovernmentBEIS/desnz-home-energy-retrofit-beta)