Skip to content

Commit

Permalink
Upgrade to EF Core 8.0.0-rc.2 (PomeloFoundation#1800)
Browse files Browse the repository at this point in the history
* Update dependencies.

* Update nuget sources.

* Upgrade provider to EF Core 8.0.0-rc.2.

* Upgrade tests to EF Core 8.0.0-rc.2.

* Workaround `dotnet tool restore` bug in .NET `8.0.100-rc.2.23502.2`.
  • Loading branch information
lauxjpn authored Oct 14, 2023
1 parent 25ba058 commit 60ea450
Show file tree
Hide file tree
Showing 19 changed files with 90 additions and 205 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,14 @@ jobs:
- name: Install EF Core Tools
shell: pwsh
run: |
dotnet tool restore
# dotnet tool restore is broken in .NET 8.0.0-rc.2
# https://github.com/dotnet/sdk/issues/35989
# https://github.com/dotnet/sdk/pull/35884
#
# dotnet tool restore
dotnet tool uninstall dotnet-ef
dotnet tool install dotnet-ef --prerelease --verbosity diag
dotnet ef --version
- name: Restore dependencies
shell: pwsh
Expand Down
32 changes: 16 additions & 16 deletions Dependencies.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup Label="Common Versions">
<EFCoreVersion>8.0.0-rc.1.23419.6</EFCoreVersion>
<EFCoreVersion>8.0.0-rc.2.23480.1</EFCoreVersion>
</PropertyGroup>

<ItemGroup Label="Dependencies">
Expand All @@ -12,29 +12,29 @@
<PackageReference Update="MySqlConnector" Version="2.3.0-beta.3" />

<PackageReference Update="NetTopologySuite" Version="2.5.0" />
<PackageReference Update="System.Text.Json" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="System.Text.Json" Version="8.0.0-rc.2.23479.6" />
<PackageReference Update="Newtonsoft.Json" Version="13.0.3" />

<PackageReference Update="Castle.Core" Version="5.1.1" />
<PackageReference Update="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0-rc.1.23421.29" />
<PackageReference Update="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0-rc.1.23421.29" />
<PackageReference Update="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0-rc.2.23480.2" />
<PackageReference Update="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0-rc.2.23480.2" />
<PackageReference Update="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0-rc.2.23479.6" />
<PackageReference Update="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="Microsoft.Extensions.Configuration.Binder" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="Microsoft.Extensions.Configuration.Json" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="Microsoft.Extensions.Configuration" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="Microsoft.Extensions.DependencyModel" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="8.0.0-rc.2.23479.6" />
<PackageReference Update="Microsoft.Extensions.Configuration.Binder" Version="8.0.0-rc.2.23479.6" />
<PackageReference Update="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0-rc.2.23479.6" />
<PackageReference Update="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0-rc.2.23479.6" />
<PackageReference Update="Microsoft.Extensions.Configuration.Json" Version="8.0.0-rc.2.23479.6" />
<PackageReference Update="Microsoft.Extensions.Configuration" Version="8.0.0-rc.2.23479.6" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="8.0.0-rc.2.23479.6" />
<PackageReference Update="Microsoft.Extensions.DependencyModel" Version="8.0.0-rc.2.23479.6" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="8.0.0-rc.2.23479.6" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageReference Update="Moq" Version="4.20.69" />
<PackageReference Update="System.Collections.Immutable" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="System.Collections.Immutable" Version="8.0.0-rc.2.23479.6" />
<PackageReference Update="System.ComponentModel.TypeConverter" Version="4.3.0" />
<PackageReference Update="System.Diagnostics.DiagnosticSource" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="System.Diagnostics.DiagnosticSource" Version="8.0.0-rc.2.23479.6" />
<PackageReference Update="GitHubActionsTestLogger" Version="2.3.3" />

<!-- Keep at the same level that the EF Core projects use. -->
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<PomeloTestTargetFramework>net8.0</PomeloTestTargetFramework>
<EfCoreTargetFramework>net8.0</EfCoreTargetFramework>
<EfCoreTestTargetFramework>net8.0</EfCoreTestTargetFramework>
<MySqlConnectorTargetFramework>net7.0</MySqlConnectorTargetFramework>
<MySqlConnectorTargetFramework>net8.0</MySqlConnectorTargetFramework>
</PropertyGroup>

<PropertyGroup>
Expand Down
14 changes: 6 additions & 8 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Pomelo" value="https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.json" />
<!--<add key="myget.org" value="https://www.myget.org/F/pomelo/api/v3/index.json" />-->
<!-- Package sources used by EF Core: -->
<add key="pomelo-nightly-public-azdo" value="https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.json" />
<add key="pomelo-nightly-debug-azdo" value="https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-debug/nuget/v3/index.json" />
<add key="pomelo-nightly-public-myget" value="https://www.myget.org/F/pomelo/api/v3/index.json" />
<add key="pomelo-nightly-debug-myget" value="https://www.myget.org/F/pomelo-debug/api/v3/index.json" />

<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
<add key="dotnet6-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json" />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="richnav" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />

<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
Expand Down
2 changes: 1 addition & 1 deletion dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.0-rc.1.23419.6",
"version": "8.0.0-rc.2.23480.1",
"commands": [
"dotnet-ef"
]
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": "8.0.100-rc.1.23455.8",
"version": "8.0.100-rc.2.23502.2",
"allowPrerelease": true,
"rollForward": "latestFeature"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<!-- TODO: Can be removed because it is already contained in EFCore.MySql. -->
<ItemGroup Condition="'$(LocalMySqlConnectorRepository)' != ''">
<Reference Include="MySqlConnector">
<HintPath>$(LocalMySqlConnectorRepository)\src\MySqlConnector\bin\Debug\$(MySqlConnectorTargetFramework)\MySqlConnector.dll</HintPath>
<HintPath>$(LocalMySqlConnectorRepository)\artifacts\bin\MySqlConnector\debug_$(MySqlConnectorTargetFramework)\MySqlConnector.dll</HintPath>
</Reference>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<!-- TODO: Can be removed because it is already contained in EFCore.MySql. -->
<ItemGroup Condition="'$(LocalMySqlConnectorRepository)' != ''">
<Reference Include="MySqlConnector">
<HintPath>$(LocalMySqlConnectorRepository)\src\MySqlConnector\bin\Debug\$(MySqlConnectorTargetFramework)\MySqlConnector.dll</HintPath>
<HintPath>$(LocalMySqlConnectorRepository)\artifacts\bin\MySqlConnector\debug_$(MySqlConnectorTargetFramework)\MySqlConnector.dll</HintPath>
</Reference>
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.MySql.NTS/EFCore.MySql.NTS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<!-- TODO: Can be removed because it is already contained in EFCore.MySql. -->
<ItemGroup Condition="'$(LocalMySqlConnectorRepository)' != ''">
<Reference Include="MySqlConnector">
<HintPath>$(LocalMySqlConnectorRepository)\src\MySqlConnector\bin\Debug\$(MySqlConnectorTargetFramework)\MySqlConnector.dll</HintPath>
<HintPath>$(LocalMySqlConnectorRepository)\artifacts\bin\MySqlConnector\debug_$(MySqlConnectorTargetFramework)\MySqlConnector.dll</HintPath>
</Reference>
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.MySql/EFCore.MySql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

<ItemGroup Condition="'$(LocalMySqlConnectorRepository)' != ''">
<Reference Include="MySqlConnector">
<HintPath>$(LocalMySqlConnectorRepository)\src\MySqlConnector\bin\Debug\$(MySqlConnectorTargetFramework)\MySqlConnector.dll</HintPath>
<HintPath>$(LocalMySqlConnectorRepository)\artifacts\bin\MySqlConnector\debug_$(MySqlConnectorTargetFramework)\MySqlConnector.dll</HintPath>
</Reference>
</ItemGroup>

Expand Down
22 changes: 11 additions & 11 deletions src/EFCore.MySql/Storage/Internal/MySqlTypeMappingSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,24 +225,24 @@ private void Initialize()

// datetimes
{ typeof(DateOnly), _dateDateOnly },
{ typeof(TimeOnly), _timeTimeOnly.Clone(_options.DefaultDataTypeMappings.ClrTimeOnlyPrecision, null) },
{ typeof(TimeOnly), _timeTimeOnly.WithPrecisionAndScale(_options.DefaultDataTypeMappings.ClrTimeOnlyPrecision, null) },
{ typeof(TimeSpan), _options.DefaultDataTypeMappings.ClrTimeSpan switch
{
MySqlTimeSpanType.Time6 => _timeTimeSpan.Clone(6, null),
MySqlTimeSpanType.Time6 => _timeTimeSpan.WithPrecisionAndScale(6, null),
MySqlTimeSpanType.Time => _timeTimeSpan,
_ => _timeTimeSpan
}},
{ typeof(DateTime), _options.DefaultDataTypeMappings.ClrDateTime switch
{
MySqlDateTimeType.DateTime6 =>_dateTime.Clone(6, null),
MySqlDateTimeType.Timestamp6 => _timeStamp.Clone(6, null),
MySqlDateTimeType.DateTime6 =>_dateTime.WithPrecisionAndScale(6, null),
MySqlDateTimeType.Timestamp6 => _timeStamp.WithPrecisionAndScale(6, null),
MySqlDateTimeType.Timestamp => _timeStamp,
_ => _dateTime,
}},
{ typeof(DateTimeOffset), _options.DefaultDataTypeMappings.ClrDateTimeOffset switch
{
MySqlDateTimeType.DateTime6 =>_dateTimeOffset.Clone(6, null),
MySqlDateTimeType.Timestamp6 => _timeStampOffset.Clone(6, null),
MySqlDateTimeType.DateTime6 =>_dateTimeOffset.WithPrecisionAndScale(6, null),
MySqlDateTimeType.Timestamp6 => _timeStampOffset.WithPrecisionAndScale(6, null),
MySqlDateTimeType.Timestamp => _timeStampOffset,
_ => _dateTimeOffset,
}},
Expand Down Expand Up @@ -325,9 +325,9 @@ private RelationalTypeMapping FindRawMapping(RelationalTypeMappingInfo mappingIn
{
return clrType == null
? mappings[0]
.Clone(in mappingInfo)
.WithTypeMappingInfo(in mappingInfo)
: mappings.FirstOrDefault(m => m.ClrType == clrType)
?.Clone(in mappingInfo);
?.WithTypeMappingInfo(in mappingInfo);
}

if (storeTypeName.Equals("json", StringComparison.OrdinalIgnoreCase) &&
Expand All @@ -349,14 +349,14 @@ private RelationalTypeMapping FindRawMapping(RelationalTypeMappingInfo mappingIn
{
if (clrType == typeof(decimal))
{
return mapping.Clone(mappingInfo.Precision.Value, mappingInfo.Scale);
return mapping.WithPrecisionAndScale(mappingInfo.Precision.Value, mappingInfo.Scale);
}

if (clrType == typeof(DateTime) ||
clrType == typeof(DateTimeOffset) ||
clrType == typeof(TimeSpan))
{
return mapping.Clone(mappingInfo.Precision.Value, null);
return mapping.WithPrecisionAndScale(mappingInfo.Precision.Value, null);
}
}

Expand Down Expand Up @@ -400,7 +400,7 @@ private RelationalTypeMapping FindRawMapping(RelationalTypeMappingInfo mappingIn

return size == null
? mapping
: mapping.Clone($"{mapping.StoreTypeNameBase}({size})", size);
: mapping.WithStoreTypeAndSize($"{mapping.StoreTypeNameBase}({size})", size);
}

if (clrType == typeof(byte[]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

<ItemGroup Condition="'$(LocalMySqlConnectorRepository)' != ''">
<Reference Include="MySqlConnector">
<HintPath>$(LocalMySqlConnectorRepository)\src\MySqlConnector\bin\Debug\$(MySqlConnectorTargetFramework)\MySqlConnector.dll</HintPath>
<HintPath>$(LocalMySqlConnectorRepository)\artifacts\bin\MySqlConnector\debug_$(MySqlConnectorTargetFramework)\MySqlConnector.dll</HintPath>
</Reference>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,13 @@ public override async Task Union_two_different_complex_type(bool async)
AssertSql();
}

public override async Task Complex_type_equals_null(bool async)
{
await base.Complex_type_equals_null(async);

AssertSql();
}

[ConditionalFact]
public virtual void Check_all_tests_overridden()
=> TestHelpers.AssertAllMethodsOverridden(GetType());
Expand All @@ -391,17 +398,3 @@ protected override ITestStoreFactory TestStoreFactory
=> MySqlTestStoreFactory.Instance;
}
}














Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ public override async Task Contains_with_local_tuple_array_closure(bool async)
await Assert.ThrowsAsync<InvalidOperationException>(() => base.Contains_with_local_tuple_array_closure(async));
}

public override async Task Contains_with_local_enumerable_inline(bool async)
{
// Issue #31776
await Assert.ThrowsAsync<InvalidOperationException>(
async () =>
await base.Contains_with_local_enumerable_inline(async));

AssertSql();
}

protected override bool CanExecuteQueryString
=> true;

Expand Down

This file was deleted.

Loading

0 comments on commit 60ea450

Please sign in to comment.