From 4641a377cc6e71d16f1b48190694a963e2e89712 Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Thu, 13 Jan 2022 14:43:07 +0200 Subject: [PATCH 01/16] Bumped to .NET 6 & C# 10 --- .../BaGet.Protocol.Samples.Tests.csproj | 3 +-- samples/BaGetWebApplication/BaGetWebApplication.csproj | 2 +- src/BaGet.Aliyun/BaGet.Aliyun.csproj | 2 +- src/BaGet.Aws/BaGet.Aws.csproj | 3 +-- src/BaGet.Azure/BaGet.Azure.csproj | 3 +-- src/BaGet.Core/BaGet.Core.csproj | 3 +-- src/BaGet.Database.MySql/BaGet.Database.MySql.csproj | 2 +- src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj | 2 +- src/BaGet.Database.SqlServer/BaGet.Database.SqlServer.csproj | 2 +- src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj | 2 +- src/BaGet.Gcp/BaGet.Gcp.csproj | 3 +-- src/BaGet.Protocol/BaGet.Protocol.csproj | 3 +-- src/BaGet.Web/BaGet.Web.csproj | 3 +-- src/BaGet/BaGet.csproj | 2 +- src/Directory.Build.props | 2 +- tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj | 2 +- tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj | 2 +- tests/BaGet.Tests/BaGet.Tests.csproj | 3 +-- tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj | 2 +- tests/Directory.Build.props | 2 +- 20 files changed, 20 insertions(+), 28 deletions(-) diff --git a/samples/BaGet.Protocol.Samples.Tests/BaGet.Protocol.Samples.Tests.csproj b/samples/BaGet.Protocol.Samples.Tests/BaGet.Protocol.Samples.Tests.csproj index 51c3b7967..5e7d8a8e4 100644 --- a/samples/BaGet.Protocol.Samples.Tests/BaGet.Protocol.Samples.Tests.csproj +++ b/samples/BaGet.Protocol.Samples.Tests/BaGet.Protocol.Samples.Tests.csproj @@ -1,8 +1,7 @@ - netcoreapp3.1 - + net6.0 false IDE0007 diff --git a/samples/BaGetWebApplication/BaGetWebApplication.csproj b/samples/BaGetWebApplication/BaGetWebApplication.csproj index 3123a668b..605ea3142 100644 --- a/samples/BaGetWebApplication/BaGetWebApplication.csproj +++ b/samples/BaGetWebApplication/BaGetWebApplication.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net6.0 diff --git a/src/BaGet.Aliyun/BaGet.Aliyun.csproj b/src/BaGet.Aliyun/BaGet.Aliyun.csproj index ad7896fcc..298673cca 100644 --- a/src/BaGet.Aliyun/BaGet.Aliyun.csproj +++ b/src/BaGet.Aliyun/BaGet.Aliyun.csproj @@ -2,7 +2,7 @@ NuGet;Alibaba;Cloud The libraries to host BaGet on Alibaba Cloud (Aliyun). - netstandard2.0 + net6.0 diff --git a/src/BaGet.Aws/BaGet.Aws.csproj b/src/BaGet.Aws/BaGet.Aws.csproj index 5094cd3d6..3c955b286 100644 --- a/src/BaGet.Aws/BaGet.Aws.csproj +++ b/src/BaGet.Aws/BaGet.Aws.csproj @@ -1,8 +1,7 @@  - netstandard2.0 - + net6.0 NuGet;Amazon;Cloud The libraries to host BaGet on AWS. diff --git a/src/BaGet.Azure/BaGet.Azure.csproj b/src/BaGet.Azure/BaGet.Azure.csproj index 7b567f6aa..c8e334b4c 100644 --- a/src/BaGet.Azure/BaGet.Azure.csproj +++ b/src/BaGet.Azure/BaGet.Azure.csproj @@ -1,8 +1,7 @@ - netstandard2.0 - + net6.0 NuGet;Azure;Cloud The libraries to host BaGet on Azure. diff --git a/src/BaGet.Core/BaGet.Core.csproj b/src/BaGet.Core/BaGet.Core.csproj index e88788429..872f9de21 100644 --- a/src/BaGet.Core/BaGet.Core.csproj +++ b/src/BaGet.Core/BaGet.Core.csproj @@ -1,8 +1,7 @@ - netstandard2.0 - + net6.0 NuGet The core libraries that power BaGet. diff --git a/src/BaGet.Database.MySql/BaGet.Database.MySql.csproj b/src/BaGet.Database.MySql/BaGet.Database.MySql.csproj index adb58c0cf..15aea80b1 100644 --- a/src/BaGet.Database.MySql/BaGet.Database.MySql.csproj +++ b/src/BaGet.Database.MySql/BaGet.Database.MySql.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net6.0 NuGet The libraries to host BaGet on MySQL. diff --git a/src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj b/src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj index afc7a1214..16f5779b2 100644 --- a/src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj +++ b/src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net6.0 NuGet The libraries to host BaGet on PostgreSQL. diff --git a/src/BaGet.Database.SqlServer/BaGet.Database.SqlServer.csproj b/src/BaGet.Database.SqlServer/BaGet.Database.SqlServer.csproj index c6720e41b..817204e03 100644 --- a/src/BaGet.Database.SqlServer/BaGet.Database.SqlServer.csproj +++ b/src/BaGet.Database.SqlServer/BaGet.Database.SqlServer.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net6.0 NuGet The libraries to host BaGet on SQL Server. diff --git a/src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj b/src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj index c7515daac..d034d9baf 100644 --- a/src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj +++ b/src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net6.0 NuGet The libraries to host BaGet on SQLite. diff --git a/src/BaGet.Gcp/BaGet.Gcp.csproj b/src/BaGet.Gcp/BaGet.Gcp.csproj index 3dc33ae66..aef8f5295 100644 --- a/src/BaGet.Gcp/BaGet.Gcp.csproj +++ b/src/BaGet.Gcp/BaGet.Gcp.csproj @@ -1,8 +1,7 @@ - netstandard2.0 - + net6.0 NuGet;Google;Cloud The libraries to host BaGet on the Google Cloud Platform. diff --git a/src/BaGet.Protocol/BaGet.Protocol.csproj b/src/BaGet.Protocol/BaGet.Protocol.csproj index 5711a54bb..d036b5c14 100644 --- a/src/BaGet.Protocol/BaGet.Protocol.csproj +++ b/src/BaGet.Protocol/BaGet.Protocol.csproj @@ -1,8 +1,7 @@ - netstandard2.0 - + net6.0 NuGet;Protocol Libraries to interact with NuGet server APIs. diff --git a/src/BaGet.Web/BaGet.Web.csproj b/src/BaGet.Web/BaGet.Web.csproj index 276e6569d..d3ae544c8 100644 --- a/src/BaGet.Web/BaGet.Web.csproj +++ b/src/BaGet.Web/BaGet.Web.csproj @@ -1,8 +1,7 @@  - netcoreapp3.1 - + net6.0 NuGet BaGet's NuGet server implementation BaGet.Web diff --git a/src/BaGet/BaGet.csproj b/src/BaGet/BaGet.csproj index 880268ce1..b5772db5c 100644 --- a/src/BaGet/BaGet.csproj +++ b/src/BaGet/BaGet.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net6.0 diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 919be1428..28cea91c4 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -15,7 +15,7 @@ true - 7.2 + 10 $(NoWarn);1591 diff --git a/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj b/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj index 50ca5e849..c4e7361a0 100644 --- a/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj +++ b/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net6.0 diff --git a/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj b/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj index 83f963a35..c7b9edcbf 100644 --- a/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj +++ b/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net6.0 diff --git a/tests/BaGet.Tests/BaGet.Tests.csproj b/tests/BaGet.Tests/BaGet.Tests.csproj index 4f70442a9..ce122b102 100644 --- a/tests/BaGet.Tests/BaGet.Tests.csproj +++ b/tests/BaGet.Tests/BaGet.Tests.csproj @@ -1,8 +1,7 @@  - netcoreapp3.1 - 8.0 + net6.0 diff --git a/tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj b/tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj index fb144a8fc..b4ad31721 100644 --- a/tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj +++ b/tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net6.0 diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index eca9a9007..0f7f0a63e 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -1,7 +1,7 @@ - 7.2 + 10 false From a8f870fdea7e5f6ccf6f3d9fb3bcf7399aa59936 Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Thu, 13 Jan 2022 14:50:49 +0200 Subject: [PATCH 02/16] Bumped dependencies --- .../BaGet.Protocol.Samples.Tests.csproj | 6 +++--- src/BaGet.Aliyun/BaGet.Aliyun.csproj | 2 +- src/BaGet.Aws/BaGet.Aws.csproj | 6 +++--- src/BaGet.Azure/BaGet.Azure.csproj | 8 ++++---- src/BaGet.Core/BaGet.Core.csproj | 12 ++++++------ src/BaGet.Database.MySql/BaGet.Database.MySql.csproj | 2 +- .../BaGet.Database.PostgreSql.csproj | 2 +- .../BaGet.Database.SqlServer.csproj | 2 +- .../BaGet.Database.Sqlite.csproj | 2 +- src/BaGet.Gcp/BaGet.Gcp.csproj | 2 +- src/BaGet.Protocol/BaGet.Protocol.csproj | 8 ++++---- src/BaGet.Web/BaGet.Web.csproj | 2 +- src/BaGet/BaGet.csproj | 9 ++++++--- tests/BaGet.Tests/BaGet.Tests.csproj | 6 +++--- 14 files changed, 36 insertions(+), 33 deletions(-) diff --git a/samples/BaGet.Protocol.Samples.Tests/BaGet.Protocol.Samples.Tests.csproj b/samples/BaGet.Protocol.Samples.Tests/BaGet.Protocol.Samples.Tests.csproj index 5e7d8a8e4..86fdefb0a 100644 --- a/samples/BaGet.Protocol.Samples.Tests/BaGet.Protocol.Samples.Tests.csproj +++ b/samples/BaGet.Protocol.Samples.Tests/BaGet.Protocol.Samples.Tests.csproj @@ -7,10 +7,10 @@ - - + + - + all runtime; build; native; contentfiles; analyzers diff --git a/src/BaGet.Aliyun/BaGet.Aliyun.csproj b/src/BaGet.Aliyun/BaGet.Aliyun.csproj index 298673cca..302dc9096 100644 --- a/src/BaGet.Aliyun/BaGet.Aliyun.csproj +++ b/src/BaGet.Aliyun/BaGet.Aliyun.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/BaGet.Aws/BaGet.Aws.csproj b/src/BaGet.Aws/BaGet.Aws.csproj index 3c955b286..b2193915f 100644 --- a/src/BaGet.Aws/BaGet.Aws.csproj +++ b/src/BaGet.Aws/BaGet.Aws.csproj @@ -7,9 +7,9 @@ - - - + + + diff --git a/src/BaGet.Azure/BaGet.Azure.csproj b/src/BaGet.Azure/BaGet.Azure.csproj index c8e334b4c..8bc6352b8 100644 --- a/src/BaGet.Azure/BaGet.Azure.csproj +++ b/src/BaGet.Azure/BaGet.Azure.csproj @@ -7,10 +7,10 @@ - - - - + + + + diff --git a/src/BaGet.Core/BaGet.Core.csproj b/src/BaGet.Core/BaGet.Core.csproj index 872f9de21..84dd9b592 100644 --- a/src/BaGet.Core/BaGet.Core.csproj +++ b/src/BaGet.Core/BaGet.Core.csproj @@ -7,12 +7,12 @@ - - - - - - + + + + + + diff --git a/src/BaGet.Database.MySql/BaGet.Database.MySql.csproj b/src/BaGet.Database.MySql/BaGet.Database.MySql.csproj index 15aea80b1..1cb362f5e 100644 --- a/src/BaGet.Database.MySql/BaGet.Database.MySql.csproj +++ b/src/BaGet.Database.MySql/BaGet.Database.MySql.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj b/src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj index 16f5779b2..3f6b5cf50 100644 --- a/src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj +++ b/src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/BaGet.Database.SqlServer/BaGet.Database.SqlServer.csproj b/src/BaGet.Database.SqlServer/BaGet.Database.SqlServer.csproj index 817204e03..d861ea4d3 100644 --- a/src/BaGet.Database.SqlServer/BaGet.Database.SqlServer.csproj +++ b/src/BaGet.Database.SqlServer/BaGet.Database.SqlServer.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj b/src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj index d034d9baf..b024f90ca 100644 --- a/src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj +++ b/src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/BaGet.Gcp/BaGet.Gcp.csproj b/src/BaGet.Gcp/BaGet.Gcp.csproj index aef8f5295..151c35515 100644 --- a/src/BaGet.Gcp/BaGet.Gcp.csproj +++ b/src/BaGet.Gcp/BaGet.Gcp.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/BaGet.Protocol/BaGet.Protocol.csproj b/src/BaGet.Protocol/BaGet.Protocol.csproj index d036b5c14..c8fb82e40 100644 --- a/src/BaGet.Protocol/BaGet.Protocol.csproj +++ b/src/BaGet.Protocol/BaGet.Protocol.csproj @@ -7,10 +7,10 @@ - - - - + + + + diff --git a/src/BaGet.Web/BaGet.Web.csproj b/src/BaGet.Web/BaGet.Web.csproj index d3ae544c8..01cea64c9 100644 --- a/src/BaGet.Web/BaGet.Web.csproj +++ b/src/BaGet.Web/BaGet.Web.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/BaGet/BaGet.csproj b/src/BaGet/BaGet.csproj index b5772db5c..ebd5e415c 100644 --- a/src/BaGet/BaGet.csproj +++ b/src/BaGet/BaGet.csproj @@ -5,9 +5,12 @@ - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/tests/BaGet.Tests/BaGet.Tests.csproj b/tests/BaGet.Tests/BaGet.Tests.csproj index ce122b102..7ceb8bd6d 100644 --- a/tests/BaGet.Tests/BaGet.Tests.csproj +++ b/tests/BaGet.Tests/BaGet.Tests.csproj @@ -9,9 +9,9 @@ - - - + + + From 6e43e32d740174d0628a319878c84754c703fa58 Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Thu, 13 Jan 2022 15:20:51 +0200 Subject: [PATCH 03/16] Fixed MySql package, according to breaking changes --- src/BaGet.Database.MySql/MySqlApplicationExtensions.cs | 2 +- src/BaGet.Database.MySql/MySqlContext.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/BaGet.Database.MySql/MySqlApplicationExtensions.cs b/src/BaGet.Database.MySql/MySqlApplicationExtensions.cs index 2156d90c3..502859a2d 100644 --- a/src/BaGet.Database.MySql/MySqlApplicationExtensions.cs +++ b/src/BaGet.Database.MySql/MySqlApplicationExtensions.cs @@ -15,7 +15,7 @@ public static BaGetApplication AddMySqlDatabase(this BaGetApplication app) { var databaseOptions = provider.GetRequiredService>(); - options.UseMySql(databaseOptions.Value.ConnectionString); + options.UseMySql(databaseOptions.Value.ConnectionString, ServerVersion.AutoDetect(databaseOptions.Value.ConnectionString)); }); return app; diff --git a/src/BaGet.Database.MySql/MySqlContext.cs b/src/BaGet.Database.MySql/MySqlContext.cs index 49bbb65fb..5bd57f477 100644 --- a/src/BaGet.Database.MySql/MySqlContext.cs +++ b/src/BaGet.Database.MySql/MySqlContext.cs @@ -1,6 +1,6 @@ using BaGet.Core; using Microsoft.EntityFrameworkCore; -using MySql.Data.MySqlClient; +using MySqlConnector; namespace BaGet.Database.MySql { @@ -17,8 +17,7 @@ public MySqlContext(DbContextOptions options) : base(options) public override bool IsUniqueConstraintViolationException(DbUpdateException exception) { - return exception.InnerException is MySqlException mysqlException && - mysqlException.Number == UniqueConstraintViolationErrorCode; + return exception.InnerException is MySqlException {Number: UniqueConstraintViolationErrorCode}; } /// From df0671a8bd55c3af78e10d0051ce3a10793213ab Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Thu, 13 Jan 2022 16:05:48 +0200 Subject: [PATCH 04/16] Reverted Azure deps to old one due to breaking changes by MS --- src/BaGet.Azure/BaGet.Azure.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BaGet.Azure/BaGet.Azure.csproj b/src/BaGet.Azure/BaGet.Azure.csproj index 8bc6352b8..da7671a27 100644 --- a/src/BaGet.Azure/BaGet.Azure.csproj +++ b/src/BaGet.Azure/BaGet.Azure.csproj @@ -7,9 +7,9 @@ - - - + + + From 3499b39342e1bfeeac78e695df54ab2a77b141c9 Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Thu, 13 Jan 2022 16:06:13 +0200 Subject: [PATCH 05/16] Deleted unused variables from props and bumped deps --- src/Directory.Build.props | 10 +--------- tests/Directory.Build.props | 18 +++++------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 28cea91c4..c09e35270 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -35,16 +35,8 @@ true - - - 3.1.18 - 3.1.18 - 3.1.18 - 5.10.0 - - - + diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 0f7f0a63e..3c07b6dd5 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -10,23 +10,15 @@ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - - - 3.1.18 - 12.0.2 - 5.10.0 - 2.4.1 - - - + all runtime; build; native; contentfiles; analyzers - - - - + + + + all runtime; build; native; contentfiles; analyzers From 6d752fe00e05e0e4c5dc7638580706d03dfb7bfc Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Thu, 13 Jan 2022 16:09:40 +0200 Subject: [PATCH 06/16] Updated Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee8ba3c5e..0a4d809bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base WORKDIR /app EXPOSE 80 -FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build +FROM mmcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /src COPY /src . RUN dotnet restore BaGet From e497d7ad39a76f2fe79a2031eaa4d8cccd3fb2a7 Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Thu, 13 Jan 2022 16:14:12 +0200 Subject: [PATCH 07/16] Bumped .NET version in pipelines --- .github/workflows/main.yml | 22 +++++++++++----------- .github/workflows/release.yml | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 90c51c63c..9e928f035 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,14 +15,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Setup .NET - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.x - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build --no-restore - - name: Test - run: dotnet test --no-build --verbosity normal + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cfd2806cc..afe09599c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.x + dotnet-version: 6.0.x - name: Test run: dotnet test --verbosity normal @@ -40,7 +40,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.x + dotnet-version: 6.0.x - name: Publish run: dotnet publish src/BaGet --configuration Release --output artifacts - name: Upload @@ -59,7 +59,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.x + dotnet-version: 6.0.x - name: Pack run: dotnet pack --configuration Release --output artifacts - name: Push From c58c40b0e8eed07360198b7afc957170820fb7e0 Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Thu, 13 Jan 2022 16:57:39 +0200 Subject: [PATCH 08/16] Fixed typo in Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0a4d809bf..a6f0cd438 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base WORKDIR /app EXPOSE 80 -FROM mmcr.microsoft.com/dotnet/sdk:6.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /src COPY /src . RUN dotnet restore BaGet From 5e812d1182718b616ee1aab15d4c43f98c5ea5a6 Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Thu, 13 Jan 2022 17:21:15 +0200 Subject: [PATCH 09/16] Fixed failed test --- .../Metadata/RegistrationBuilderTests.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/BaGet.Core.Tests/Metadata/RegistrationBuilderTests.cs b/tests/BaGet.Core.Tests/Metadata/RegistrationBuilderTests.cs index 361257401..5ad31a4da 100644 --- a/tests/BaGet.Core.Tests/Metadata/RegistrationBuilderTests.cs +++ b/tests/BaGet.Core.Tests/Metadata/RegistrationBuilderTests.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using Moq; @@ -20,7 +21,6 @@ public void TheRegistrationIndexResponseIsSortedByVersion() { // Arrange var packageId = "BaGet.Test"; - var authors = new string[] { "test" }; var packages = new List { @@ -52,14 +52,15 @@ public void TheRegistrationIndexResponseIsSortedByVersion() /// Create a fake with the minimum metadata needed by the . /// private Package GetTestPackage(string packageId, string version) - { + { return new Package { Id = packageId, - Authors = new string[] { "test" }, - PackageTypes = new List { new PackageType { Name = "test" } }, - Dependencies = new List { }, + Authors = new[] { "test" }, + PackageTypes = new List { new() { Name = "test" } }, + Dependencies = new List(), Version = new NuGetVersion(version), + Published = new DateTime(2022, 01, 01) }; } } From 45ad64725e3bf46a2585740673517e1cfbb45e14 Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Thu, 13 Jan 2022 17:27:48 +0200 Subject: [PATCH 10/16] Bumped version in .devcontainer Dockerfile --- .devcontainer/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index e7a798b44..04d855201 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,6 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/dotnet/.devcontainer/base.Dockerfile +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/main/containers/dotnet/.devcontainer/base.Dockerfile -# [Choice] .NET version: 5.0, 3.1, 2.1 -ARG VARIANT=3.1 +# [Choice] .NET version: 6.0, 5.0, 3.1, 2.1 +ARG VARIANT=6.0 FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT} From c901143063646afb52ae6d4877a21e42ab84a551 Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Sat, 22 Jan 2022 01:13:56 +0200 Subject: [PATCH 11/16] Added .NET 6 to filtering list --- src/BaGet.Web/Pages/Index.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BaGet.Web/Pages/Index.cshtml b/src/BaGet.Web/Pages/Index.cshtml index 303e1c0c5..4c724e672 100644 --- a/src/BaGet.Web/Pages/Index.cshtml +++ b/src/BaGet.Web/Pages/Index.cshtml @@ -188,7 +188,7 @@ else { "divider1", "-" }, { "header1", ".NET" }, - + { "net6.0", ".NET 6.0" }, { "net5.0", ".NET 5.0" }, { "divider2", "-" }, From d1564be66bb99e5d7285d6af28eec5f7d5e73f5a Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Sun, 23 Jan 2022 02:21:18 +0200 Subject: [PATCH 12/16] Fixed issue with MySql provider --- .../Migrations/20181212113156_Initial.cs | 73 +++-- .../20190303071640_AddSearchDimensions.cs | 35 +-- ...14215810_AddOriginalVersionStringColumn.cs | 17 +- ...00109085155_AddReleaseNotesStringColumn.cs | 17 +- ...20200210004047_AddHasEmbeddedIconColumn.cs | 19 +- ...10919191554_RemoveReleaseNotesMaxLength.cs | 19 +- ...AccordingToLastProviderVersion.Designer.cs | 248 ++++++++++++++++ ...justTypesAccordingToLastProviderVersion.cs | 268 ++++++++++++++++++ .../Migrations/MySqlContextModelSnapshot.cs | 102 ++++--- src/BaGet.Database.MySql/MySqlContext.cs | 42 ++- 10 files changed, 670 insertions(+), 170 deletions(-) create mode 100644 src/BaGet.Database.MySql/Migrations/20220123000903_AdjustTypesAccordingToLastProviderVersion.Designer.cs create mode 100644 src/BaGet.Database.MySql/Migrations/20220123000903_AdjustTypesAccordingToLastProviderVersion.cs diff --git a/src/BaGet.Database.MySql/Migrations/20181212113156_Initial.cs b/src/BaGet.Database.MySql/Migrations/20181212113156_Initial.cs index 90101ee1a..8cccf9232 100644 --- a/src/BaGet.Database.MySql/Migrations/20181212113156_Initial.cs +++ b/src/BaGet.Database.MySql/Migrations/20181212113156_Initial.cs @@ -8,32 +8,50 @@ public partial class Initial : Migration { protected override void Up(MigrationBuilder migrationBuilder) { + migrationBuilder.AlterDatabase() + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "Packages", columns: table => new { - Key = table.Column(nullable: false) + Key = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Id = table.Column(maxLength: 128, nullable: false), - Authors = table.Column(maxLength: 4000, nullable: true), - Description = table.Column(maxLength: 4000, nullable: true), - Downloads = table.Column(nullable: false), - HasReadme = table.Column(nullable: false), - Language = table.Column(maxLength: 20, nullable: true), - Listed = table.Column(nullable: false), - MinClientVersion = table.Column(maxLength: 44, nullable: true), - Published = table.Column(nullable: false), - RequireLicenseAcceptance = table.Column(nullable: false), - Summary = table.Column(maxLength: 4000, nullable: true), - Title = table.Column(maxLength: 256, nullable: true), - IconUrl = table.Column(maxLength: 4000, nullable: true), - LicenseUrl = table.Column(maxLength: 4000, nullable: true), - ProjectUrl = table.Column(maxLength: 4000, nullable: true), - RepositoryUrl = table.Column(maxLength: 4000, nullable: true), - RepositoryType = table.Column(maxLength: 100, nullable: true), - Tags = table.Column(maxLength: 4000, nullable: true), - RowVersion = table.Column(rowVersion: true, nullable: true), - Version = table.Column(maxLength: 64, nullable: false) + Id = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Authors = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Downloads = table.Column(type: "bigint", nullable: false), + HasReadme = table.Column(type: "tinyint(1)", nullable: false), + Language = table.Column(type: "varchar(20)", maxLength: 20, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Listed = table.Column(type: "tinyint(1)", nullable: false), + MinClientVersion = table.Column(type: "varchar(44)", maxLength: 44, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Published = table.Column(type: "datetime(6)", nullable: false), + RequireLicenseAcceptance = table.Column(type: "tinyint(1)", nullable: false), + Summary = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Title = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IconUrl = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + LicenseUrl = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ProjectUrl = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RepositoryUrl = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RepositoryType = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Tags = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + RowVersion = table.Column(type: "timestamp(6)", rowVersion: true, nullable: true) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn), + Version = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), }, constraints: table => { @@ -44,12 +62,15 @@ protected override void Up(MigrationBuilder migrationBuilder) name: "PackageDependencies", columns: table => new { - Key = table.Column(nullable: false) + Key = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Id = table.Column(maxLength: 128, nullable: true), - VersionRange = table.Column(maxLength: 256, nullable: true), - TargetFramework = table.Column(maxLength: 256, nullable: true), - PackageKey = table.Column(nullable: false) + Id = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + VersionRange = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + TargetFramework = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PackageKey = table.Column(type: "int", nullable: true) }, constraints: table => { diff --git a/src/BaGet.Database.MySql/Migrations/20190303071640_AddSearchDimensions.cs b/src/BaGet.Database.MySql/Migrations/20190303071640_AddSearchDimensions.cs index 02fb3c072..18bce5e5c 100644 --- a/src/BaGet.Database.MySql/Migrations/20190303071640_AddSearchDimensions.cs +++ b/src/BaGet.Database.MySql/Migrations/20190303071640_AddSearchDimensions.cs @@ -12,23 +12,17 @@ protected override void Up(MigrationBuilder migrationBuilder) name: "FK_PackageDependencies_Packages_PackageKey", table: "PackageDependencies"); - migrationBuilder.AlterColumn( - name: "RowVersion", - table: "Packages", - rowVersion: true, - nullable: true, - oldClrType: typeof(DateTime), - oldNullable: true); - migrationBuilder.AddColumn( name: "IsPrerelease", table: "Packages", + type: "tinyint(1)", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "SemVerLevel", table: "Packages", + type: "int", nullable: false, defaultValue: 0); @@ -42,11 +36,13 @@ protected override void Up(MigrationBuilder migrationBuilder) name: "PackageTypes", columns: table => new { - Key = table.Column(nullable: false) + Key = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Name = table.Column(maxLength: 512, nullable: true), - Version = table.Column(maxLength: 64, nullable: true), - PackageKey = table.Column(nullable: false) + Name = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Version = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PackageKey = table.Column(type: "int", nullable: false) }, constraints: table => { @@ -63,10 +59,11 @@ protected override void Up(MigrationBuilder migrationBuilder) name: "TargetFrameworks", columns: table => new { - Key = table.Column(nullable: false) + Key = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Moniker = table.Column(maxLength: 256, nullable: true), - PackageKey = table.Column(nullable: false) + Moniker = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PackageKey = table.Column(type: "int", nullable: false) }, constraints: table => { @@ -137,14 +134,6 @@ protected override void Down(MigrationBuilder migrationBuilder) name: "SemVerLevel", table: "Packages"); - migrationBuilder.AlterColumn( - name: "RowVersion", - table: "Packages", - nullable: true, - oldClrType: typeof(DateTime), - oldRowVersion: true, - oldNullable: true); - migrationBuilder.AlterColumn( name: "PackageKey", table: "PackageDependencies", diff --git a/src/BaGet.Database.MySql/Migrations/20190914215810_AddOriginalVersionStringColumn.cs b/src/BaGet.Database.MySql/Migrations/20190914215810_AddOriginalVersionStringColumn.cs index df0217fe2..ea10e5177 100644 --- a/src/BaGet.Database.MySql/Migrations/20190914215810_AddOriginalVersionStringColumn.cs +++ b/src/BaGet.Database.MySql/Migrations/20190914215810_AddOriginalVersionStringColumn.cs @@ -7,17 +7,10 @@ public partial class AddOriginalVersionStringColumn : Migration { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.AlterColumn( - name: "RowVersion", - table: "Packages", - rowVersion: true, - nullable: true, - oldClrType: typeof(DateTime), - oldNullable: true); - migrationBuilder.AddColumn( name: "OriginalVersion", table: "Packages", + type: "varchar(64)", maxLength: 64, nullable: true); } @@ -27,14 +20,6 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropColumn( name: "OriginalVersion", table: "Packages"); - - migrationBuilder.AlterColumn( - name: "RowVersion", - table: "Packages", - nullable: true, - oldClrType: typeof(DateTime), - oldRowVersion: true, - oldNullable: true); } } } diff --git a/src/BaGet.Database.MySql/Migrations/20200109085155_AddReleaseNotesStringColumn.cs b/src/BaGet.Database.MySql/Migrations/20200109085155_AddReleaseNotesStringColumn.cs index e098cdf86..b62e8a6a5 100644 --- a/src/BaGet.Database.MySql/Migrations/20200109085155_AddReleaseNotesStringColumn.cs +++ b/src/BaGet.Database.MySql/Migrations/20200109085155_AddReleaseNotesStringColumn.cs @@ -7,17 +7,10 @@ public partial class AddReleaseNotesStringColumn : Migration { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.AlterColumn( - name: "RowVersion", - table: "Packages", - rowVersion: true, - nullable: true, - oldClrType: typeof(DateTime), - oldNullable: true); - migrationBuilder.AddColumn( name: "ReleaseNotes", table: "Packages", + type: "longtext", maxLength: 4000, nullable: true); } @@ -27,14 +20,6 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropColumn( name: "ReleaseNotes", table: "Packages"); - - migrationBuilder.AlterColumn( - name: "RowVersion", - table: "Packages", - nullable: true, - oldClrType: typeof(DateTime), - oldRowVersion: true, - oldNullable: true); } } } diff --git a/src/BaGet.Database.MySql/Migrations/20200210004047_AddHasEmbeddedIconColumn.cs b/src/BaGet.Database.MySql/Migrations/20200210004047_AddHasEmbeddedIconColumn.cs index d9b12c931..3c2a97ebb 100644 --- a/src/BaGet.Database.MySql/Migrations/20200210004047_AddHasEmbeddedIconColumn.cs +++ b/src/BaGet.Database.MySql/Migrations/20200210004047_AddHasEmbeddedIconColumn.cs @@ -8,18 +8,10 @@ public partial class AddHasEmbeddedIconColumn : Migration { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.AlterColumn( - name: "RowVersion", - table: "Packages", - rowVersion: true, - nullable: true, - oldClrType: typeof(DateTime), - oldNullable: true) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn); - migrationBuilder.AddColumn( name: "HasEmbeddedIcon", table: "Packages", + type: "tinyint(1)", nullable: false, defaultValue: false); } @@ -29,15 +21,6 @@ protected override void Down(MigrationBuilder migrationBuilder) migrationBuilder.DropColumn( name: "HasEmbeddedIcon", table: "Packages"); - - migrationBuilder.AlterColumn( - name: "RowVersion", - table: "Packages", - nullable: true, - oldClrType: typeof(DateTime), - oldRowVersion: true, - oldNullable: true) - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn); } } } diff --git a/src/BaGet.Database.MySql/Migrations/20210919191554_RemoveReleaseNotesMaxLength.cs b/src/BaGet.Database.MySql/Migrations/20210919191554_RemoveReleaseNotesMaxLength.cs index de331311c..e80122616 100644 --- a/src/BaGet.Database.MySql/Migrations/20210919191554_RemoveReleaseNotesMaxLength.cs +++ b/src/BaGet.Database.MySql/Migrations/20210919191554_RemoveReleaseNotesMaxLength.cs @@ -4,32 +4,15 @@ namespace BaGet.Database.MySql.Migrations { + // This was a migration without any sense, but I keep it cause of existing data public partial class RemoveReleaseNotesMaxLength : Migration { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.AlterColumn( - name: "RowVersion", - table: "Packages", - rowVersion: true, - nullable: true, - oldClrType: typeof(DateTime), - oldType: "timestamp(6)", - oldNullable: true) - .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn); } protected override void Down(MigrationBuilder migrationBuilder) { - migrationBuilder.AlterColumn( - name: "RowVersion", - table: "Packages", - type: "timestamp(6)", - nullable: true, - oldClrType: typeof(DateTime), - oldRowVersion: true, - oldNullable: true) - .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn); } } } diff --git a/src/BaGet.Database.MySql/Migrations/20220123000903_AdjustTypesAccordingToLastProviderVersion.Designer.cs b/src/BaGet.Database.MySql/Migrations/20220123000903_AdjustTypesAccordingToLastProviderVersion.Designer.cs new file mode 100644 index 000000000..5f3256fa5 --- /dev/null +++ b/src/BaGet.Database.MySql/Migrations/20220123000903_AdjustTypesAccordingToLastProviderVersion.Designer.cs @@ -0,0 +1,248 @@ +// +using System; +using BaGet.Database.MySql; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BaGet.Database.MySql.Migrations +{ + [DbContext(typeof(MySqlContext))] + [Migration("20220123000903_AdjustTypesAccordingToLastProviderVersion")] + partial class AdjustTypesAccordingToLastProviderVersion + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("BaGet.Core.Package", b => + { + b.Property("Key") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Authors") + .HasColumnType("longtext"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Downloads") + .HasColumnType("bigint"); + + b.Property("HasEmbeddedIcon") + .HasColumnType("tinyint(1)"); + + b.Property("HasReadme") + .HasColumnType("tinyint(1)"); + + b.Property("IconUrl") + .HasColumnType("longtext"); + + b.Property("Id") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsPrerelease") + .HasColumnType("tinyint(1)"); + + b.Property("Language") + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("LicenseUrl") + .HasColumnType("longtext"); + + b.Property("Listed") + .HasColumnType("tinyint(1)"); + + b.Property("MinClientVersion") + .HasMaxLength(44) + .HasColumnType("varchar(44)"); + + b.Property("NormalizedVersionString") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Version"); + + b.Property("OriginalVersionString") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("OriginalVersion"); + + b.Property("ProjectUrl") + .HasColumnType("longtext"); + + b.Property("Published") + .HasColumnType("datetime(6)"); + + b.Property("ReleaseNotes") + .HasColumnType("longtext") + .HasColumnName("ReleaseNotes"); + + b.Property("RepositoryType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("RepositoryUrl") + .HasColumnType("longtext"); + + b.Property("RequireLicenseAcceptance") + .HasColumnType("tinyint(1)"); + + b.Property("RowVersion") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("timestamp(6)"); + + b.Property("SemVerLevel") + .HasColumnType("int"); + + b.Property("Summary") + .HasColumnType("longtext"); + + b.Property("Tags") + .HasColumnType("longtext"); + + b.Property("Title") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Key"); + + b.HasIndex("Id"); + + b.HasIndex("Id", "NormalizedVersionString") + .IsUnique(); + + b.ToTable("Packages"); + }); + + modelBuilder.Entity("BaGet.Core.PackageDependency", b => + { + b.Property("Key") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Id") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("PackageKey") + .HasColumnType("int"); + + b.Property("TargetFramework") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("VersionRange") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Key"); + + b.HasIndex("Id"); + + b.HasIndex("PackageKey"); + + b.ToTable("PackageDependencies"); + }); + + modelBuilder.Entity("BaGet.Core.PackageType", b => + { + b.Property("Key") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("PackageKey") + .HasColumnType("int"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Key"); + + b.HasIndex("Name"); + + b.HasIndex("PackageKey"); + + b.ToTable("PackageTypes"); + }); + + modelBuilder.Entity("BaGet.Core.TargetFramework", b => + { + b.Property("Key") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Moniker") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("PackageKey") + .HasColumnType("int"); + + b.HasKey("Key"); + + b.HasIndex("Moniker"); + + b.HasIndex("PackageKey"); + + b.ToTable("TargetFrameworks"); + }); + + modelBuilder.Entity("BaGet.Core.PackageDependency", b => + { + b.HasOne("BaGet.Core.Package", "Package") + .WithMany("Dependencies") + .HasForeignKey("PackageKey"); + + b.Navigation("Package"); + }); + + modelBuilder.Entity("BaGet.Core.PackageType", b => + { + b.HasOne("BaGet.Core.Package", "Package") + .WithMany("PackageTypes") + .HasForeignKey("PackageKey") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Package"); + }); + + modelBuilder.Entity("BaGet.Core.TargetFramework", b => + { + b.HasOne("BaGet.Core.Package", "Package") + .WithMany("TargetFrameworks") + .HasForeignKey("PackageKey") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Package"); + }); + + modelBuilder.Entity("BaGet.Core.Package", b => + { + b.Navigation("Dependencies"); + + b.Navigation("PackageTypes"); + + b.Navigation("TargetFrameworks"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/BaGet.Database.MySql/Migrations/20220123000903_AdjustTypesAccordingToLastProviderVersion.cs b/src/BaGet.Database.MySql/Migrations/20220123000903_AdjustTypesAccordingToLastProviderVersion.cs new file mode 100644 index 000000000..81b8fc5a7 --- /dev/null +++ b/src/BaGet.Database.MySql/Migrations/20220123000903_AdjustTypesAccordingToLastProviderVersion.cs @@ -0,0 +1,268 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BaGet.Database.MySql.Migrations +{ + public partial class AdjustTypesAccordingToLastProviderVersion : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Name", + table: "PackageTypes", + type: "varchar(255)", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(512)", + oldMaxLength: 512, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "Tags", + table: "Packages", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldMaxLength: 4000, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "Summary", + table: "Packages", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldMaxLength: 4000, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "RowVersion", + table: "Packages", + type: "timestamp(6)", + rowVersion: true, + nullable: true, + oldClrType: typeof(DateTime), + oldType: "timestamp(6)", + oldRowVersion: true, + oldNullable: true) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn); + + migrationBuilder.AlterColumn( + name: "RepositoryUrl", + table: "Packages", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldMaxLength: 4000, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ProjectUrl", + table: "Packages", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldMaxLength: 4000, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "LicenseUrl", + table: "Packages", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldMaxLength: 4000, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "IconUrl", + table: "Packages", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldMaxLength: 4000, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "Description", + table: "Packages", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldMaxLength: 4000, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "Authors", + table: "Packages", + type: "longtext", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldMaxLength: 4000, + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Name", + table: "PackageTypes", + type: "varchar(512)", + maxLength: 512, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255)", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "Tags", + table: "Packages", + type: "longtext CHARACTER SET utf8mb4", + maxLength: 4000, + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "Summary", + table: "Packages", + type: "longtext CHARACTER SET utf8mb4", + maxLength: 4000, + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "RowVersion", + table: "Packages", + type: "timestamp(6)", + rowVersion: true, + nullable: true, + oldClrType: typeof(DateTime), + oldType: "timestamp(6)", + oldRowVersion: true, + oldNullable: true) + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn); + + migrationBuilder.AlterColumn( + name: "RepositoryUrl", + table: "Packages", + type: "longtext CHARACTER SET utf8mb4", + maxLength: 4000, + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ReleaseNotes", + table: "Packages", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ProjectUrl", + table: "Packages", + type: "longtext CHARACTER SET utf8mb4", + maxLength: 4000, + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "LicenseUrl", + table: "Packages", + type: "longtext CHARACTER SET utf8mb4", + maxLength: 4000, + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "IconUrl", + table: "Packages", + type: "longtext CHARACTER SET utf8mb4", + maxLength: 4000, + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "Description", + table: "Packages", + type: "longtext CHARACTER SET utf8mb4", + maxLength: 4000, + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "Authors", + table: "Packages", + type: "longtext CHARACTER SET utf8mb4", + maxLength: 4000, + nullable: true, + oldClrType: typeof(string), + oldType: "longtext", + oldNullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + } + } +} diff --git a/src/BaGet.Database.MySql/Migrations/MySqlContextModelSnapshot.cs b/src/BaGet.Database.MySql/Migrations/MySqlContextModelSnapshot.cs index d9a6e93c8..d5d035270 100644 --- a/src/BaGet.Database.MySql/Migrations/MySqlContextModelSnapshot.cs +++ b/src/BaGet.Database.MySql/Migrations/MySqlContextModelSnapshot.cs @@ -5,6 +5,8 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +#nullable disable + namespace BaGet.Database.MySql.Migrations { [DbContext(typeof(MySqlContext))] @@ -14,7 +16,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.1.18") + .HasAnnotation("ProductVersion", "6.0.1") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("BaGet.Core.Package", b => @@ -24,12 +26,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("int"); b.Property("Authors") - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext"); b.Property("Description") - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext"); b.Property("Downloads") .HasColumnType("bigint"); @@ -41,61 +41,57 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("tinyint(1)"); b.Property("IconUrl") - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext"); b.Property("Id") .IsRequired() - .HasColumnType("varchar(128) CHARACTER SET utf8mb4") - .HasMaxLength(128); + .HasMaxLength(128) + .HasColumnType("varchar(128)"); b.Property("IsPrerelease") .HasColumnType("tinyint(1)"); b.Property("Language") - .HasColumnType("varchar(20) CHARACTER SET utf8mb4") - .HasMaxLength(20); + .HasMaxLength(20) + .HasColumnType("varchar(20)"); b.Property("LicenseUrl") - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext"); b.Property("Listed") .HasColumnType("tinyint(1)"); b.Property("MinClientVersion") - .HasColumnType("varchar(44) CHARACTER SET utf8mb4") - .HasMaxLength(44); + .HasMaxLength(44) + .HasColumnType("varchar(44)"); b.Property("NormalizedVersionString") .IsRequired() - .HasColumnName("Version") - .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Version"); b.Property("OriginalVersionString") - .HasColumnName("OriginalVersion") - .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("OriginalVersion"); b.Property("ProjectUrl") - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext"); b.Property("Published") .HasColumnType("datetime(6)"); b.Property("ReleaseNotes") - .HasColumnName("ReleaseNotes") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext") + .HasColumnName("ReleaseNotes"); b.Property("RepositoryType") - .HasColumnType("varchar(100) CHARACTER SET utf8mb4") - .HasMaxLength(100); + .HasMaxLength(100) + .HasColumnType("varchar(100)"); b.Property("RepositoryUrl") - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext"); b.Property("RequireLicenseAcceptance") .HasColumnType("tinyint(1)"); @@ -109,16 +105,14 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("int"); b.Property("Summary") - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext"); b.Property("Tags") - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("longtext"); b.Property("Title") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("varchar(256)"); b.HasKey("Key"); @@ -137,19 +131,19 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("int"); b.Property("Id") - .HasColumnType("varchar(128) CHARACTER SET utf8mb4") - .HasMaxLength(128); + .HasMaxLength(128) + .HasColumnType("varchar(128)"); b.Property("PackageKey") .HasColumnType("int"); b.Property("TargetFramework") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("varchar(256)"); b.Property("VersionRange") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("varchar(256)"); b.HasKey("Key"); @@ -167,15 +161,14 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("int"); b.Property("Name") - .HasColumnType("varchar(512) CHARACTER SET utf8mb4") - .HasMaxLength(512); + .HasColumnType("varchar(255)"); b.Property("PackageKey") .HasColumnType("int"); b.Property("Version") - .HasColumnType("varchar(64) CHARACTER SET utf8mb4") - .HasMaxLength(64); + .HasMaxLength(64) + .HasColumnType("varchar(64)"); b.HasKey("Key"); @@ -193,8 +186,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("int"); b.Property("Moniker") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("varchar(256)"); b.Property("PackageKey") .HasColumnType("int"); @@ -213,6 +206,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasOne("BaGet.Core.Package", "Package") .WithMany("Dependencies") .HasForeignKey("PackageKey"); + + b.Navigation("Package"); }); modelBuilder.Entity("BaGet.Core.PackageType", b => @@ -222,6 +217,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasForeignKey("PackageKey") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + + b.Navigation("Package"); }); modelBuilder.Entity("BaGet.Core.TargetFramework", b => @@ -231,6 +228,17 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasForeignKey("PackageKey") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + + b.Navigation("Package"); + }); + + modelBuilder.Entity("BaGet.Core.Package", b => + { + b.Navigation("Dependencies"); + + b.Navigation("PackageTypes"); + + b.Navigation("TargetFrameworks"); }); #pragma warning restore 612, 618 } diff --git a/src/BaGet.Database.MySql/MySqlContext.cs b/src/BaGet.Database.MySql/MySqlContext.cs index 5bd57f477..8a0e4197a 100644 --- a/src/BaGet.Database.MySql/MySqlContext.cs +++ b/src/BaGet.Database.MySql/MySqlContext.cs @@ -1,3 +1,5 @@ +using System; +using System.Linq; using BaGet.Core; using Microsoft.EntityFrameworkCore; using MySqlConnector; @@ -6,24 +8,52 @@ namespace BaGet.Database.MySql { public class MySqlContext : AbstractContext { + /// + /// Max string length for mapping to varchar(N) + /// It string length will be greater than that value, it would be mapped to a longtext + /// + private const int MaxAllowedVarcharLength = 256; + /// /// The MySQL Server error code for when a unique constraint is violated. /// private const int UniqueConstraintViolationErrorCode = 1062; - public MySqlContext(DbContextOptions options) : base(options) + public MySqlContext(DbContextOptions options) + : base(options) { } - public override bool IsUniqueConstraintViolationException(DbUpdateException exception) - { - return exception.InnerException is MySqlException {Number: UniqueConstraintViolationErrorCode}; - } - /// /// MySQL does not support LIMIT clauses in subqueries for certain subquery operators. /// See: https://dev.mysql.com/doc/refman/8.0/en/subquery-restrictions.html /// public override bool SupportsLimitInSubqueries => false; + + public override bool IsUniqueConstraintViolationException(DbUpdateException exception) => + exception.InnerException is MySqlException { Number: UniqueConstraintViolationErrorCode }; + + /// + /// MySQL has a limit of row size - 65535 bytes + /// So we map strings, strings array & uris, which are longer than 256 symbols to longtext MySQL type + /// See: https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/1606 + /// + /// EF Core model builder + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + var longtextProperties = builder.Model + .GetEntityTypes() + .SelectMany(e => e.GetProperties()) + .Where(e => + (e.ClrType == typeof(string) || e.ClrType == typeof(string[]) || e.ClrType == typeof(Uri)) && + e.GetMaxLength() > MaxAllowedVarcharLength); + + foreach (var property in longtextProperties) + { + property.SetMaxLength(null); + } + } } } From 69e8c70880d26b8ad2de4955983aa5fb3974306f Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Sun, 23 Jan 2022 02:24:47 +0200 Subject: [PATCH 13/16] Fixed warning on build --- src/BaGet.Database.MySql/MySqlContext.cs | 2 +- src/BaGet.Web/Extensions/IServiceCollectionExtensions.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BaGet.Database.MySql/MySqlContext.cs b/src/BaGet.Database.MySql/MySqlContext.cs index 8a0e4197a..70961d4f5 100644 --- a/src/BaGet.Database.MySql/MySqlContext.cs +++ b/src/BaGet.Database.MySql/MySqlContext.cs @@ -35,7 +35,7 @@ public override bool IsUniqueConstraintViolationException(DbUpdateException exce /// /// MySQL has a limit of row size - 65535 bytes - /// So we map strings, strings array & uris, which are longer than 256 symbols to longtext MySQL type + /// So we map string, string[] and URI, which are longer than 256 symbols to longtext MySQL type /// See: https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/1606 /// /// EF Core model builder diff --git a/src/BaGet.Web/Extensions/IServiceCollectionExtensions.cs b/src/BaGet.Web/Extensions/IServiceCollectionExtensions.cs index 39964850d..42125fb15 100644 --- a/src/BaGet.Web/Extensions/IServiceCollectionExtensions.cs +++ b/src/BaGet.Web/Extensions/IServiceCollectionExtensions.cs @@ -1,4 +1,5 @@ using System; +using System.Text.Json.Serialization; using BaGet.Core; using BaGet.Web; using Microsoft.AspNetCore.Mvc; @@ -16,10 +17,9 @@ public static IServiceCollection AddBaGetWebApplication( .AddRouting(options => options.LowercaseUrls = true) .AddControllers() .AddApplicationPart(typeof(PackageContentController).Assembly) - .SetCompatibilityVersion(CompatibilityVersion.Version_3_0) .AddJsonOptions(options => { - options.JsonSerializerOptions.IgnoreNullValues = true; + options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; }); services.AddRazorPages(); From 3f750f0e99ada56fe0adbd2f25317e10c88f8982 Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Mon, 21 Feb 2022 02:12:49 +0200 Subject: [PATCH 14/16] Reverted MSBuild variables --- src/BaGet.Aws/BaGet.Aws.csproj | 2 +- src/BaGet.Azure/BaGet.Azure.csproj | 2 +- src/BaGet.Core/BaGet.Core.csproj | 10 +++++----- .../BaGet.Database.SqlServer.csproj | 2 +- src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj | 2 +- src/BaGet.Protocol/BaGet.Protocol.csproj | 6 +++--- src/BaGet/BaGet.csproj | 4 ++-- src/Directory.Build.props | 10 +++++++++- tests/BaGet.Tests/BaGet.Tests.csproj | 4 ++-- tests/Directory.Build.props | 7 +++++++ 10 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/BaGet.Aws/BaGet.Aws.csproj b/src/BaGet.Aws/BaGet.Aws.csproj index b2193915f..76fcc5752 100644 --- a/src/BaGet.Aws/BaGet.Aws.csproj +++ b/src/BaGet.Aws/BaGet.Aws.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/BaGet.Azure/BaGet.Azure.csproj b/src/BaGet.Azure/BaGet.Azure.csproj index da7671a27..c8e334b4c 100644 --- a/src/BaGet.Azure/BaGet.Azure.csproj +++ b/src/BaGet.Azure/BaGet.Azure.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/BaGet.Core/BaGet.Core.csproj b/src/BaGet.Core/BaGet.Core.csproj index 84dd9b592..335b0faf4 100644 --- a/src/BaGet.Core/BaGet.Core.csproj +++ b/src/BaGet.Core/BaGet.Core.csproj @@ -7,11 +7,11 @@ - - - - - + + + + + diff --git a/src/BaGet.Database.SqlServer/BaGet.Database.SqlServer.csproj b/src/BaGet.Database.SqlServer/BaGet.Database.SqlServer.csproj index d861ea4d3..817204e03 100644 --- a/src/BaGet.Database.SqlServer/BaGet.Database.SqlServer.csproj +++ b/src/BaGet.Database.SqlServer/BaGet.Database.SqlServer.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj b/src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj index b024f90ca..d034d9baf 100644 --- a/src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj +++ b/src/BaGet.Database.Sqlite/BaGet.Database.Sqlite.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/BaGet.Protocol/BaGet.Protocol.csproj b/src/BaGet.Protocol/BaGet.Protocol.csproj index c8fb82e40..8ddca74bd 100644 --- a/src/BaGet.Protocol/BaGet.Protocol.csproj +++ b/src/BaGet.Protocol/BaGet.Protocol.csproj @@ -7,9 +7,9 @@ - - - + + + diff --git a/src/BaGet/BaGet.csproj b/src/BaGet/BaGet.csproj index ebd5e415c..e06cfd731 100644 --- a/src/BaGet/BaGet.csproj +++ b/src/BaGet/BaGet.csproj @@ -6,8 +6,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Directory.Build.props b/src/Directory.Build.props index c09e35270..dd834f3a0 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -31,12 +31,20 @@ snupkg + + + 6.0.1 + 6.0.1 + 6.0.0 + 6.1.0 + + true - + diff --git a/tests/BaGet.Tests/BaGet.Tests.csproj b/tests/BaGet.Tests/BaGet.Tests.csproj index 7ceb8bd6d..195a64d47 100644 --- a/tests/BaGet.Tests/BaGet.Tests.csproj +++ b/tests/BaGet.Tests/BaGet.Tests.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 3c07b6dd5..e8b7983ea 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -10,6 +10,13 @@ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + + + 6.0.1 + 6.0.0 + 6.1.0 + + all From 8f3ee248e8db7174b28a327524f9aa52f6dcdc96 Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Mon, 21 Feb 2022 02:14:48 +0200 Subject: [PATCH 15/16] Bumped some new deps --- src/BaGet.Aws/BaGet.Aws.csproj | 4 ++-- src/BaGet.Gcp/BaGet.Gcp.csproj | 2 +- src/BaGet.Web/BaGet.Web.csproj | 4 ++-- src/BaGet/BaGet.csproj | 2 +- tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj | 7 +++++++ tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj | 7 +++++++ tests/BaGet.Tests/BaGet.Tests.csproj | 4 ++++ tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj | 7 +++++++ 8 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/BaGet.Aws/BaGet.Aws.csproj b/src/BaGet.Aws/BaGet.Aws.csproj index 76fcc5752..824f3f6af 100644 --- a/src/BaGet.Aws/BaGet.Aws.csproj +++ b/src/BaGet.Aws/BaGet.Aws.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/src/BaGet.Gcp/BaGet.Gcp.csproj b/src/BaGet.Gcp/BaGet.Gcp.csproj index 151c35515..d1b814896 100644 --- a/src/BaGet.Gcp/BaGet.Gcp.csproj +++ b/src/BaGet.Gcp/BaGet.Gcp.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/BaGet.Web/BaGet.Web.csproj b/src/BaGet.Web/BaGet.Web.csproj index 01cea64c9..74bb958dd 100644 --- a/src/BaGet.Web/BaGet.Web.csproj +++ b/src/BaGet.Web/BaGet.Web.csproj @@ -14,8 +14,8 @@ - - + + diff --git a/src/BaGet/BaGet.csproj b/src/BaGet/BaGet.csproj index e06cfd731..59da0f4d2 100644 --- a/src/BaGet/BaGet.csproj +++ b/src/BaGet/BaGet.csproj @@ -5,7 +5,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj b/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj index c4e7361a0..987430292 100644 --- a/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj +++ b/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj @@ -8,4 +8,11 @@ + + + all + runtime; build; native; contentfiles; analyzers + + + diff --git a/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj b/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj index c7b9edcbf..2ac84730a 100644 --- a/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj +++ b/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj @@ -23,4 +23,11 @@ + + + all + runtime; build; native; contentfiles; analyzers + + + diff --git a/tests/BaGet.Tests/BaGet.Tests.csproj b/tests/BaGet.Tests/BaGet.Tests.csproj index 195a64d47..154beb7b3 100644 --- a/tests/BaGet.Tests/BaGet.Tests.csproj +++ b/tests/BaGet.Tests/BaGet.Tests.csproj @@ -12,6 +12,10 @@ + + all + runtime; build; native; contentfiles; analyzers + diff --git a/tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj b/tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj index b4ad31721..a9eb99c4b 100644 --- a/tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj +++ b/tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj @@ -8,4 +8,11 @@ + + + all + runtime; build; native; contentfiles; analyzers + + + From 70ec9dc6fb75b945aaa5773eac32268c46a5472f Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk Date: Mon, 21 Feb 2022 23:15:02 +0200 Subject: [PATCH 16/16] Review fixes --- .../BaGet.Protocol.Samples.Tests.csproj | 2 +- src/BaGet.Database.MySql/BaGet.Database.MySql.csproj | 2 +- .../BaGet.Database.PostgreSql.csproj | 2 +- src/BaGet.Protocol/BaGet.Protocol.csproj | 1 - tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj | 7 ------- tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj | 7 ------- tests/BaGet.Tests/BaGet.Tests.csproj | 4 ---- tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj | 7 ------- tests/Directory.Build.props | 4 ++-- 9 files changed, 5 insertions(+), 31 deletions(-) diff --git a/samples/BaGet.Protocol.Samples.Tests/BaGet.Protocol.Samples.Tests.csproj b/samples/BaGet.Protocol.Samples.Tests/BaGet.Protocol.Samples.Tests.csproj index 86fdefb0a..1ad49fc9e 100644 --- a/samples/BaGet.Protocol.Samples.Tests/BaGet.Protocol.Samples.Tests.csproj +++ b/samples/BaGet.Protocol.Samples.Tests/BaGet.Protocol.Samples.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/BaGet.Database.MySql/BaGet.Database.MySql.csproj b/src/BaGet.Database.MySql/BaGet.Database.MySql.csproj index 1cb362f5e..0ca9c0cb2 100644 --- a/src/BaGet.Database.MySql/BaGet.Database.MySql.csproj +++ b/src/BaGet.Database.MySql/BaGet.Database.MySql.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj b/src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj index 3f6b5cf50..f82f36c9b 100644 --- a/src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj +++ b/src/BaGet.Database.PostgreSql/BaGet.Database.PostgreSql.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/BaGet.Protocol/BaGet.Protocol.csproj b/src/BaGet.Protocol/BaGet.Protocol.csproj index 8ddca74bd..bdc31f8a6 100644 --- a/src/BaGet.Protocol/BaGet.Protocol.csproj +++ b/src/BaGet.Protocol/BaGet.Protocol.csproj @@ -10,7 +10,6 @@ - diff --git a/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj b/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj index 987430292..c4e7361a0 100644 --- a/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj +++ b/tests/BaGet.Core.Tests/BaGet.Core.Tests.csproj @@ -8,11 +8,4 @@ - - - all - runtime; build; native; contentfiles; analyzers - - - diff --git a/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj b/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj index 2ac84730a..c7b9edcbf 100644 --- a/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj +++ b/tests/BaGet.Protocol.Tests/BaGet.Protocol.Tests.csproj @@ -23,11 +23,4 @@ - - - all - runtime; build; native; contentfiles; analyzers - - - diff --git a/tests/BaGet.Tests/BaGet.Tests.csproj b/tests/BaGet.Tests/BaGet.Tests.csproj index 154beb7b3..195a64d47 100644 --- a/tests/BaGet.Tests/BaGet.Tests.csproj +++ b/tests/BaGet.Tests/BaGet.Tests.csproj @@ -12,10 +12,6 @@ - - all - runtime; build; native; contentfiles; analyzers - diff --git a/tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj b/tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj index a9eb99c4b..b4ad31721 100644 --- a/tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj +++ b/tests/BaGet.Web.Tests/BaGet.Web.Tests.csproj @@ -8,11 +8,4 @@ - - - all - runtime; build; native; contentfiles; analyzers - - - diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index e8b7983ea..b2c002ada 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -18,11 +18,11 @@ - + all runtime; build; native; contentfiles; analyzers - +