Skip to content

Commit

Permalink
Upgrade to 3.1.0 (#986)
Browse files Browse the repository at this point in the history
* Update branding to 3.1.0-rc1.

* Update versions and dependencies.

* Update infrastructure to 3.1.0.

* Update tests to 3.1.0.

* Fix failing tests.

* Fix compatibility visitor call, that needs to run after the base class call that can alter the expression tree.

* Change dotnet version to 3.1.0 and fix CI.

* Fix test warnings.

* Disable remaining warnings.
  • Loading branch information
lauxjpn authored Dec 6, 2019
1 parent f9fbb17 commit b055d8f
Show file tree
Hide file tree
Showing 41 changed files with 1,239 additions and 1,034 deletions.
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
<RepositoryUrl>git://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql</RepositoryUrl>
</PropertyGroup>

<PropertyGroup>
<DefaultNetCoreTargetFramework>netcoreapp3.1</DefaultNetCoreTargetFramework>
<DefaultNetStandardTargetFramework>netstandard2.0</DefaultNetStandardTargetFramework>
</PropertyGroup>

<PropertyGroup>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Pomelo.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
Expand Down
1 change: 1 addition & 0 deletions Pomelo.EntityFrameworkCore.MySql.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
eng\Development.props.sample = eng\Development.props.sample
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
global.json = global.json
eng\Versions.props = eng\Versions.props
EndProjectSection
EndProject
Expand Down
39 changes: 29 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ variables:
legacy_mysql_mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
dotnet_version: 3.1.x
dotnet_ef_tools_version: 3.1.0

jobs:

Expand Down Expand Up @@ -40,19 +42,25 @@ jobs:
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK'
inputs:
version: $(dotnet_version)
- bash: |
set -e
sudo systemctl stop mysql
docker run --name mysql -e MYSQL_ROOT_PASSWORD=Password12! -p 3306:3306 -d $DOCKER_IMAGE
displayName: Install Database Server
- bash: |
dotnet --info
./dotnet-env.sh dotnet --info
displayName: .NET Core Information
- bash: |
set -e
cp test/EFCore.MySql.FunctionalTests/config.json.example test/EFCore.MySql.FunctionalTests/config.json
cp test/EFCore.MySql.IntegrationTests/appsettings.ci.json test/EFCore.MySql.IntegrationTests/appsettings.json
cp test/EFCore.MySql.IntegrationTests/config.json.example test/EFCore.MySql.IntegrationTests/config.json
./build.sh
displayName: Build Solution
displayName: Setup and Build Solution
- bash: |
started="false"
for i in $(seq 0 300); do
Expand All @@ -69,14 +77,16 @@ jobs:
fi
docker exec mysql mysql -h localhost -P 3306 -u root -pPassword12! -e "SET GLOBAL sql_mode = '$SQL_MODE';"
./dotnet-env.sh dotnet tool install --global dotnet-ef --version 3.0.0
displayName: Setup Database
- bash: |
./dotnet-env.sh dotnet tool install --global dotnet-ef --version $(dotnet_ef_tools_version)
./dotnet-env.sh dotnet ef --version
displayName: Install EF Core Tools
- bash: |
if [ "$(INTEGRATION_TESTS)" = "true" ]; then
./dotnet-env.sh ./test/EFCore.MySql.IntegrationTests/scripts/rebuild.sh
fi
displayName: Setup Database
displayName: Build Integration Tests
- bash: ./dotnet-env.sh dotnet test --logger trx test/EFCore.MySql.Tests
displayName: Tests
continueOnError: true
Expand Down Expand Up @@ -139,6 +149,10 @@ jobs:
variables:
sql_mode: $(current_mysql_mode)
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK'
inputs:
version: $(dotnet_version)
- pwsh: |
docker run `
-d `
Expand All @@ -147,12 +161,15 @@ jobs:
-p "3306:3306" `
pomelofoundation/mysql-windows:8-ltsc2019
displayName: Install Database Server
- pwsh: |
.\dotnet-env.ps1 dotnet --info
displayName: .NET Core Information
- pwsh: |
cp test\EFCore.MySql.FunctionalTests\config.json.example test\EFCore.MySql.FunctionalTests\config.json
cp test\EFCore.MySql.IntegrationTests\appsettings.ci.json test\EFCore.MySql.IntegrationTests\appsettings.json
cp test\EFCore.MySql.IntegrationTests\config.json.example test\EFCore.MySql.IntegrationTests\config.json
.\build.cmd
displayName: Build
displayName: Setup and Build Solution
- pwsh: |
$started=$false
For ($i=0; $i -le 300; $i++) {
Expand All @@ -169,12 +186,14 @@ jobs:
}
docker exec mysql mysql -h localhost -u root -pPassword12! -e "SET GLOBAL sql_mode = '$(sql_mode)';"
errorActionPreference: continue
displayName: Setup Database 1/2
displayName: Setup Database
- pwsh: |
.\dotnet-env.ps1 dotnet tool install --global dotnet-ef --version 3.0.0
.\dotnet-env.ps1 dotnet tool install --global dotnet-ef --version $(dotnet_ef_tools_version)
.\dotnet-env.ps1 dotnet ef --version
displayName: Install EF Core Tools
- pwsh: |
.\dotnet-env.ps1 .\test\EFCore.MySql.IntegrationTests\scripts\rebuild.ps1
displayName: Setup Database 2/2
displayName: Build Integration Tests
- pwsh: .\dotnet-env.ps1 dotnet test --logger trx test\EFCore.MySql.Tests
displayName: Tests
continueOnError: true
Expand Down
10 changes: 5 additions & 5 deletions eng/Development.props.sample
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project>
<PropertyGroup>
<!--
Specify the absolute path to the EntityFrameworkCore and MySqlConnector
base directories, to compile against that version for better development
and local debugging support.
Specify the absolute path to the EntityFrameworkCore base directory,
to compile against that version for better development and local
debugging support.

Rename this file "development.props".

Expand All @@ -14,12 +14,12 @@
it's own version of EFCore, you have to make sure, that your local
EFCore assemblies are compiled with an AssemblyVersion <= the one
referenced by Microsoft.AspNetCore.Identity.EntityFrameworkCore
(e.g. "3.0.0.0").
(e.g. "3.1.0.0").

To achive that, run the following command in your EntityFrameworkCore
base directory:

dotnet build "/p:AssemblyVersion=3.0.0.0"
dotnet build "/p:AssemblyVersion=3.1.0.0"
-->
<LocalEFCoreRepository>C:\Repositories\EntityFrameworkCore</LocalEFCoreRepository>
<LocalMySqlConnectorRepository>C:\Repositories\MySqlConnector</LocalMySqlConnectorRepository>
Expand Down
41 changes: 24 additions & 17 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup Label="Version settings">
<VersionPrefix>3.1.0</VersionPrefix>
<PreReleaseVersionLabel>preview3</PreReleaseVersionLabel>
<PreReleaseVersionLabel>rc1</PreReleaseVersionLabel>
<IncludeSourceRevisionInInformationalVersion>False</IncludeSourceRevisionInInformationalVersion>
<!--
When StabilizePackageVersion is set to 'true', this branch will produce stable outputs for 'Shipping' packages
Expand All @@ -16,37 +16,44 @@
</PropertyGroup>
<PropertyGroup Label="Dependencies">
<!-- Runtime Dependencies -->
<MicrosoftNETCoreAppRuntimewinx64PackageVersion>3.0.0</MicrosoftNETCoreAppRuntimewinx64PackageVersion>
<MicrosoftNETCoreAppRuntimewinx64PackageVersion>3.1.0</MicrosoftNETCoreAppRuntimewinx64PackageVersion>
<!-- EFCore.MySql Dependencies -->
<MicrosoftEntityFrameworkCoreRelationalVersion>3.0.1</MicrosoftEntityFrameworkCoreRelationalVersion>
<MicrosoftEntityFrameworkCoreRelationalVersion>3.1.0</MicrosoftEntityFrameworkCoreRelationalVersion>
<MySqlConnectorVersion>0.61.0</MySqlConnectorVersion>
<PomeloJsonObjectVersion>2.2.1</PomeloJsonObjectVersion>
<MicrosoftExtensionsCachingMemoryVersion>3.0.0</MicrosoftExtensionsCachingMemoryVersion>
<MicrosoftExtensionsDependencyInjection>3.0.0</MicrosoftExtensionsDependencyInjection>
<SystemDiagnosticsDiagnosticSource>4.6.0</SystemDiagnosticsDiagnosticSource>
<MicrosoftExtensionsCachingMemoryVersion>3.1.0</MicrosoftExtensionsCachingMemoryVersion>
<MicrosoftExtensionsDependencyInjection>3.1.0</MicrosoftExtensionsDependencyInjection>
<SystemDiagnosticsDiagnosticSourceVersion>4.7.0</SystemDiagnosticsDiagnosticSourceVersion>
<MicrosoftExtensionsLoggingVersion>3.1.0</MicrosoftExtensionsLoggingVersion>
<MicrosoftBclAsyncInterfacesVersion>1.1.0</MicrosoftBclAsyncInterfacesVersion>
<MicrosoftBclHashCodeVersion>1.1.0</MicrosoftBclHashCodeVersion>
<MicrosoftExtensionsHostFactoryResolverSourcesVersion>3.1.0-rtm.19565.4</MicrosoftExtensionsHostFactoryResolverSourcesVersion>
<MicrosoftExtensionsConfigurationVersion>3.1.0</MicrosoftExtensionsConfigurationVersion>
<SystemCollectionsImmutableVersion>1.7.0</SystemCollectionsImmutableVersion>
<SystemComponentModelAnnotationsVersion>4.7.0</SystemComponentModelAnnotationsVersion>
<!-- Shared Test Dependencies -->
<MicrosoftNETTestSdkPackageVersion>16.3.0</MicrosoftNETTestSdkPackageVersion>
<XunitAssertPackageVersion>2.4.1</XunitAssertPackageVersion>
<XunitCorePackageVersion>2.4.1</XunitCorePackageVersion>
<XunitRunnerVisualStudioPackageVersion>2.4.1</XunitRunnerVisualStudioPackageVersion>
<XunitRunnerConsolePackageVersion>2.4.1</XunitRunnerConsolePackageVersion>
<XunitXmlTestLoggerPackageVersion>2.1.26</XunitXmlTestLoggerPackageVersion>
<MicrosoftEntityFrameworkCoreRelationalSpecificationTestsVersion>3.0.0</MicrosoftEntityFrameworkCoreRelationalSpecificationTestsVersion>
<MicrosoftEntityFrameworkCoreRelationalSpecificationTestsVersion>3.1.0</MicrosoftEntityFrameworkCoreRelationalSpecificationTestsVersion>
<!-- EFCoreMySqlFunctionalTests Dependencies -->
<MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>2.2.4</MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>
<MicrosoftExtensionsConfigurationFileExtensionsVersion>2.2.0</MicrosoftExtensionsConfigurationFileExtensionsVersion>
<MicrosoftExtensionsConfigurationJsonVersion>2.2.0</MicrosoftExtensionsConfigurationJsonVersion>
<MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>3.1.0</MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>
<MicrosoftExtensionsConfigurationFileExtensionsVersion>3.1.0</MicrosoftExtensionsConfigurationFileExtensionsVersion>
<MicrosoftExtensionsConfigurationJsonVersion>3.1.0</MicrosoftExtensionsConfigurationJsonVersion>
<SystemComponentModelTypeConverterVersion>4.3.0</SystemComponentModelTypeConverterVersion>
<CastleCoreVersion>4.0.0</CastleCoreVersion>
<CastleCoreVersion>4.4.0</CastleCoreVersion>
<NetTopologySuiteVersion>2.0.0</NetTopologySuiteVersion>
<!-- EFCoreMySqlIntegrationTests Dependencies -->
<MicrosoftAspNetCoreIdentityEntityFrameworkCoreVersion>3.0.0</MicrosoftAspNetCoreIdentityEntityFrameworkCoreVersion>
<MicrosoftAspNetCoreMvcNewtonsoftJsonVersion>3.0.0</MicrosoftAspNetCoreMvcNewtonsoftJsonVersion>
<MicrosoftAspNetCoreIdentityEntityFrameworkCoreVersion>3.1.0</MicrosoftAspNetCoreIdentityEntityFrameworkCoreVersion>
<MicrosoftAspNetCoreMvcNewtonsoftJsonVersion>3.1.0</MicrosoftAspNetCoreMvcNewtonsoftJsonVersion>
<!-- EFCoreMySqlTests Dependencies -->
<MicrosoftEntityFrameworkCoreDesignVersion>3.0.0</MicrosoftEntityFrameworkCoreDesignVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>3.3.1</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftExtensionsDependencyModelPackageVersion>3.0.0</MicrosoftExtensionsDependencyModelPackageVersion>
<MoqVersion>4.13.0</MoqVersion>
<MicrosoftEntityFrameworkCoreDesignVersion>3.1.0</MicrosoftEntityFrameworkCoreDesignVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>3.4.0</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftExtensionsDependencyModelPackageVersion>3.1.0</MicrosoftExtensionsDependencyModelPackageVersion>
<MoqVersion>4.13.1</MoqVersion>
<NewtonsoftJsonPackageVersion>12.0.2</NewtonsoftJsonPackageVersion>
</PropertyGroup>
<PropertyGroup Label="Dependency version settings">
Expand Down
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "3.0.100",
"dotnet": "3.1.100",
"runtimes": {
"dotnet": [
"2.0.9",
Expand All @@ -9,9 +9,9 @@
}
},
"sdk": {
"version": "3.0.100"
"version": "3.1.100"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19461.7"
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19605.4"
}
}
20 changes: 16 additions & 4 deletions src/EFCore.MySql/EFCore.MySql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>MySQL provider for Entity Framework Core</Description>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>$(DefaultNetStandardTargetFramework)</TargetFramework>
<MinClientVersion>3.6</MinClientVersion>
<AssemblyName>Pomelo.EntityFrameworkCore.MySql</AssemblyName>
<RootNamespace>Pomelo.EntityFrameworkCore.MySql</RootNamespace>
Expand All @@ -11,7 +11,7 @@
</PropertyGroup>

<PropertyGroup>
<NoWarn>$(NoWarn);EF1001</NoWarn>
<MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);$(NoWarn)</MSBuildWarningsAsMessages>
</PropertyGroup>

<ItemGroup Condition="'$(LocalPomeloJsonObjectRepository)' == ''">
Expand Down Expand Up @@ -45,8 +45,20 @@
<Reference Include="Microsoft.EntityFrameworkCore.Relational">
<HintPath>$(LocalEFCoreRepository)\artifacts\bin\EFCore.Relational\Debug\$(TargetFramework)\Microsoft.EntityFrameworkCore.Relational.dll</HintPath>
</Reference>
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.0.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.6.0" />

<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="$(MicrosoftExtensionsConfigurationJsonVersion)" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(MicrosoftExtensionsDependencyInjection)" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="$(MicrosoftExtensionsConfigurationEnvironmentVariablesVersion)" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="$(MicrosoftExtensionsConfigurationVersion)" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="$(MicrosoftExtensionsCachingMemoryVersion)" />
<PackageReference Include="Microsoft.Extensions.HostFactoryResolver.Sources" Version="$(MicrosoftExtensionsHostFactoryResolverSourcesVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsLoggingVersion)" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourceVersion)" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="$(MicrosoftBclAsyncInterfacesVersion)" />
<PackageReference Include="Microsoft.Bcl.HashCode" Version="$(MicrosoftBclHashCodeVersion)" />
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutableVersion)" />
<PackageReference Include="System.ComponentModel.Annotations" Version="$(SystemComponentModelAnnotationsVersion)" />

</ItemGroup>

<ItemGroup Condition="'$(LocalMySqlConnectorRepository)' != ''">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ public MySqlQueryTranslationPostprocessor(

public override Expression Process(Expression query)
{
query = new MySqlCompatibilityExpressionVisitor(_options).Visit(query);

return base.Process(query);
query = base.Process(query);
return new MySqlCompatibilityExpressionVisitor(_options).Visit(query);
}
}
}
2 changes: 2 additions & 0 deletions src/EFCore.MySql/Storage/Internal/MySqlDatabaseCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public override bool HasTables()
new RelationalCommandParameterObject(
connection,
null,
null,
Dependencies.CurrentContext.Context,
Dependencies.CommandLogger))) != 0);

Expand All @@ -130,6 +131,7 @@ public override Task<bool> HasTablesAsync(CancellationToken cancellationToken =
new RelationalCommandParameterObject(
connection,
null,
null,
Dependencies.CurrentContext.Context,
Dependencies.CommandLogger),
cancellationToken: ct)) != 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Linq;

namespace Pomelo.EntityFrameworkCore.MySql.Storage.Internal
namespace Pomelo.EntityFrameworkCore.MySql.Storage
{
public partial class ServerVersionSupport
public class ServerVersionSupport
{
public ServerVersion[] SupportedServerVersions { get; }

Expand Down
2 changes: 1 addition & 1 deletion test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<NoWarn>$(NoWarn);CA1822;xUnit1004;EF1001</NoWarn>
<NoWarn>$(NoWarn);EF1001;MSB3277;xUnit1000</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit b055d8f

Please sign in to comment.