Update to dotnet 8 preview 5 (#14492)

* Update to .net 8 preview 1

* Update npoco to 5.7.0

* Update pipeline to use .net 8

* Revert "Update npoco to 5.7.0"

This reverts commit f7795afa77a41ef2719f639405f73d9c21e4b12e.

* Fix tests and updated OpenApi.json

* use dotnet 8 in linux container

* Updated templates and docker image to dotnet 8

* Bugfix

* R
Updated docker images to 8.0 preview 1

* linux docker images updated

* Force use c# 11, in hope of the acceptance tests will pass

* Do not use C# 8 :)

* Update to preview 2

* CompatibilitySuppressions

* updated templates

* Disable package validation

* Update to .net8 preview 4

* change EnableStrictModeForCompatibleFrameworksInPackage to false

* Package validation

* Added CompatibilitySuppressions.xml

* Fix up IP networks

* Updated to preview 5

* Update docker images

* Post merge fixes

* Try to update dotnet version of codeql

* Delete empty suppression files

* Remove dependency

* Cleanup

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
This commit is contained in:
Bjarke Berg
2023-07-05 13:13:52 +02:00
committed by GitHub
parent 5382820e58
commit 0ad0f86e6e
29 changed files with 89 additions and 89 deletions

View File

@@ -15,7 +15,7 @@ permissions:
contents: read
env:
dotnetVersion: 7.x
dotnetVersion: 8.x
dotnetIncludePreviewVersions: true
solution: umbraco.sln
buildConfiguration: SkipTests

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>latest</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>11.0</LangVersion>
<Company>Umbraco HQ</Company>
<Authors>Umbraco</Authors>
<Copyright>Copyright © Umbraco $([System.DateTime]::Today.ToString('yyyy'))</Copyright>
@@ -29,9 +29,9 @@
<!-- Package Validation -->
<PropertyGroup>
<GenerateCompatibilitySuppressionFile>false</GenerateCompatibilitySuppressionFile>
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>11.0.0</PackageValidationBaselineVersion>
<GenerateCompatibilitySuppressionFile>true</GenerateCompatibilitySuppressionFile>
<EnablePackageValidation>false</EnablePackageValidation>
<PackageValidationBaselineVersion>12.0.0-rc1</PackageValidationBaselineVersion>
<EnableStrictModeForCompatibleFrameworksInPackage>true</EnableStrictModeForCompatibleFrameworksInPackage>
<EnableStrictModeForCompatibleTfms>true</EnableStrictModeForCompatibleTfms>
</PropertyGroup>

View File

@@ -24,7 +24,7 @@ parameters:
variables:
nodeVersion: 18.16.0
dotnetVersion: 7.x
dotnetVersion: 8.x
dotnetIncludePreviewVersions: true
solution: umbraco.sln
buildConfiguration: Release

View File

@@ -8,7 +8,6 @@
<RootNamespace>Umbraco.Cms.Api.Common</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="OpenIddict.Abstractions" Version="4.5.0" />
<PackageReference Include="OpenIddict.AspNetCore" Version="4.5.0" />

View File

@@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0-preview.5.*" />
</ItemGroup>
<ItemGroup>

View File

@@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0-preview.5.*" />
</ItemGroup>
<ItemGroup>

View File

@@ -6,8 +6,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0-preview.5.*" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" Version="4.5.0" />
</ItemGroup>

View File

@@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="7.0.7" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.0-preview.5.*" />
</ItemGroup>
<ItemGroup>

View File

@@ -6,10 +6,6 @@
<StaticWebAssetBasePath>/</StaticWebAssetBasePath>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Web.BackOffice\Umbraco.Web.BackOffice.csproj" />
<ProjectReference Include="..\Umbraco.Web.Website\Umbraco.Web.Website.csproj" />

View File

@@ -7,18 +7,18 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="7.0.7" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.7" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0-preview.5.*" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
<PackageReference Include="System.Runtime.Caching" Version="7.0.0" />
<PackageReference Include="System.Runtime.Caching" Version="8.0.0-preview.5.*" />
</ItemGroup>
<ItemGroup>

View File

@@ -13,15 +13,14 @@
<ItemGroup>
<PackageReference Include="Examine.Core" Version="3.1.0" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.48" />
<PackageReference Include="IPNetwork2" Version="2.6.589" />
<PackageReference Include="MailKit" Version="4.1.0" />
<PackageReference Include="Markdown" Version="2.2.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="7.0.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="8.0.0-preview.5.*" />
<PackageReference Include="MiniProfiler.Shared" Version="4.3.8" />
<PackageReference Include="ncrontab" Version="3.3.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
@@ -38,8 +37,8 @@
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Map" Version="1.0.2" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="7.0.2" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="7.0.0" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="8.0.0-preview.5.*" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="8.0.0-preview.5.*" />
</ItemGroup>
<ItemGroup>

View File

@@ -7,10 +7,6 @@
<RootNamespace>Umbraco.Cms.Web.BackOffice</RootNamespace>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Markdown" Version="2.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

View File

@@ -193,18 +193,7 @@ internal class CompilationOptionsProvider
var parseOptions = new CSharpParseOptions(preprocessorSymbols: (IEnumerable<string>)defines);
if (string.IsNullOrEmpty(dependencyContextOptions.LanguageVersion))
{
parseOptions = parseOptions.WithLanguageVersion(LanguageVersion.Latest);
}
else if (LanguageVersionFacts.TryParse(dependencyContextOptions.LanguageVersion, out var languageVersion))
{
parseOptions = parseOptions.WithLanguageVersion(languageVersion);
}
else
{
Debug.Fail($"LanguageVersion {languageVersion} specified in the deps file could not be parsed.");
}
return parseOptions;
}

View File

@@ -6,6 +6,9 @@ namespace Umbraco.Cms.Web.Common.Mvc;
public class IpAddressUtilities : IIpAddressUtilities
{
public bool IsAllowListed(IPAddress clientIpAddress, string allowedIpString)
{
var subnetmaskIndex = allowedIpString.LastIndexOf('/');
if (subnetmaskIndex >= 0) // It's a network
{
if (IPNetwork.TryParse(allowedIpString, out IPNetwork allowedIp) && allowedIp.Contains(clientIpAddress))
{
@@ -14,4 +17,15 @@ public class IpAddressUtilities : IIpAddressUtilities
return false;
}
// Assume ip address
if (IPAddress.TryParse(allowedIpString, out IPAddress? allowedIpAddress) && allowedIpAddress.Equals(clientIpAddress))
{
return true;
}
return false;
}
}

View File

@@ -6,16 +6,12 @@
<RootNamespace>Umbraco.Cms.Web.Common</RootNamespace>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Asp.Versioning.Mvc" Version="7.0.0" />
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="7.0.0" />
<PackageReference Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.0-preview.5.*" />
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
<PackageReference Include="Smidge.InMemory" Version="4.3.0" />
<PackageReference Include="Smidge.Nuglify" Version="4.3.0" />

View File

@@ -17,7 +17,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.7">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0-preview.5.*">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

View File

@@ -7,10 +7,6 @@
<RootNamespace>Umbraco.Cms.Web.Website</RootNamespace>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />
</ItemGroup>

View File

@@ -28,13 +28,13 @@
"datatype": "choice",
"choices": [
{
"displayName": ".NET 7.0",
"description": "Target net7.0",
"choice": "net7.0"
"displayName": ".NET 8.0",
"description": "Target net8.0",
"choice": "net8.0"
}
],
"defaultValue": "net7.0",
"replaces": "net7.0"
"defaultValue": "net8.0",
"replaces": "net8.0"
},
"UmbracoVersion": {
"displayName": "Umbraco version",

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ContentTargetFolders>.</ContentTargetFolders>
<Product>UmbracoPackage</Product>
<PackageId>UmbracoPackage</PackageId>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AddRazorSupportForMvc Condition="'$(SupportPagesAndViews)' == 'True'">true</AddRazorSupportForMvc>

View File

@@ -38,13 +38,13 @@
"datatype": "choice",
"choices": [
{
"displayName": ".NET 7.0",
"description": "Target net7.0",
"choice": "net7.0"
"displayName": ".NET 8.0",
"description": "Target net8.0",
"choice": "net8.0"
}
],
"defaultValue": "net7.0",
"replaces": "net7.0"
"defaultValue": "net8.0",
"replaces": "net8.0"
},
"UmbracoVersion": {
"displayName": "Umbraco version",

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Umbraco.Cms.Web.UI</RootNamespace>

View File

@@ -2,7 +2,7 @@
## Build
############################################
FROM mcr.microsoft.com/dotnet/nightly/sdk:7.0 AS build
FROM mcr.microsoft.com/dotnet/nightly/sdk:8.0.100-preview.6-jammy AS build
COPY nuget.config .
@@ -22,7 +22,7 @@ RUN dotnet publish --configuration Release --no-build --output /dist
## Run
############################################
FROM mcr.microsoft.com/dotnet/nightly/aspnet:7.0 AS run
FROM mcr.microsoft.com/dotnet/nightly/aspnet:8.0.0-preview.6-jammy AS run
WORKDIR /app
COPY --from=build dist .

View File

@@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0-preview.5.*" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />

View File

@@ -11,8 +11,8 @@
<ItemGroup>
<PackageReference Include="Bogus" Version="34.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0-preview.5.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" PrivateAssets="all" />
</ItemGroup>

View File

@@ -158,6 +158,15 @@ public class ComponentTests
return Mock.Of<ILogger<ComponentCollection>>();
}
if (type == typeof(ILogger<ComponentCollection>))
{
return Mock.Of<ILogger<ComponentCollection>>();
}
if (type == typeof(IServiceProviderIsService))
{
return Mock.Of<IServiceProviderIsService>();
}
throw new NotSupportedException(type.FullName);
});
});
@@ -316,6 +325,11 @@ public class ComponentTests
return Mock.Of<ILogger<ComponentCollection>>();
}
if (type == typeof(IServiceProviderIsService))
{
return Mock.Of<IServiceProviderIsService>();
}
throw new NotSupportedException(type.FullName);
});
});

View File

@@ -1,7 +1,7 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System.Collections.Generic;
using System.Collections;
using NUnit.Framework;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Tests.Common.Published;
@@ -45,7 +45,7 @@ public class ModelTypeTests
// Note the inner assembly qualified name
Assert.AreEqual(
"System.Collections.Generic.IEnumerable`1[[System.Int32[], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]",
$"System.Collections.Generic.IEnumerable`1[[System.Int32[], System.Private.CoreLib, Version={typeof(IEnumerable).Assembly.GetName().Version}, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]",
typeof(IEnumerable<>).MakeGenericType(type.MakeArrayType()).FullName);
}

View File

@@ -64,8 +64,8 @@ public class BackOfficeClaimsPrincipalFactoryTests
new BackOfficeClaimsPrincipalFactory(GetMockedUserManager().Object, null));
[Test]
public void Ctor_When_Options_Value_Is_Null_Expect_ArgumentNullException()
=> Assert.Throws<ArgumentNullException>(() => new BackOfficeClaimsPrincipalFactory(
public void Ctor_When_Options_Value_Is_Null_Expect_ArgumentException()
=> Assert.Throws<ArgumentException>(() => new BackOfficeClaimsPrincipalFactory(
GetMockedUserManager().Object,
new OptionsWrapper<BackOfficeIdentityOptions>(null)));

View File

@@ -7,8 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="AngleSharp" Version="1.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="System.Data.Odbc" Version="7.0.0" />
<PackageReference Include="System.Data.OleDb" Version="7.0.0" />