Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

staging -> main #133

Merged
merged 10 commits into from
Oct 8, 2024
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/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)

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 . .
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion HerPortal.BusinessLogic/HerPortal.BusinessLogic.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
3 changes: 2 additions & 1 deletion HerPortal.Data/HerPortal.Data.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand Down
3 changes: 2 additions & 1 deletion HerPortal.ManagementShell/HerPortal.ManagementShell.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion HerPortal.UnitTests/HerPortal.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<LangVersion>12</LangVersion>
<RootNamespace>Tests</RootNamespace>
</PropertyGroup>

Expand Down
8 changes: 4 additions & 4 deletions HerPortal/HerPortal.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>10</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<UserSecretsId>b05a1249-b368-4866-addb-a537726db09b</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CabinetOffice.GovUkDesignSystem" Version="1.0.0-456b8e9" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.16" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="6.0.16" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Identity.Web" Version="2.9.0" />
<PackageReference Include="Microsoft.Identity.Web" Version="3.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.8" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.4.0" />
Expand Down
8 changes: 4 additions & 4 deletions HerPortal/Middleware/SecurityHeadersMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -39,15 +39,15 @@ 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';");
}

if (!context.Response.Headers.ContainsKey(ReferrerPolicy))
{
context.Response.Headers.Add(ReferrerPolicy, "no-referrer");
context.Response.Headers.Append(ReferrerPolicy, "no-referrer");
}

return next(context);
Expand Down
3 changes: 2 additions & 1 deletion HerPortal/Services/StaticAssetsVersioningService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -26,7 +27,7 @@ public StaticAssetsVersioningService(IWebHostEnvironment environment)
private const string AppJsRegex = "app-.*.js";
private const string Html5ShivJsRegex = "html5shiv-.*.js";

private Dictionary<string, string> cachedFilenames = new Dictionary<string, string>();
private ConcurrentDictionary<string, string> cachedFilenames = new();

public string GetAppCssFilename() => GetStaticFile(CompiledDirectory, AppCssRegex);
public string GetAppIe8CssFilename() => GetStaticFile(CompiledDirectory, AppIe8CssRegex);
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "5.0",
"version": "8.0",
"rollForward": "latestMajor",
"allowPrerelease": true
}
Expand Down
Loading