Skip to content

Commit 80c0ce5

Browse files
committed
Pinned versions of dependent packages for the next major release
This prevents future minor/patch releases from unintendedly requiring higher versions of dependent packages, caused by ongoing package updates in the JADNC solution. How NuGet package dependencies in .NET work: - Package references are transient, which means that projects inherit package references from their dependent projects. Therefore there's no need to repeat dependencies in child project files. For example, when project X references package P, and project Y depends on project X, then project Y implicitly references package P (except when P was referenced using PrivateAssets in X). - To use the latest version of a dependent package, it must be referenced explicitly. For example, when package A v1.0.3 references package B v1.0.0, while the latest version of package B is v1.0.2, package B must be referenced explicitly to use its latest version. The rationale here is as follows: - JsonApiDotNetCore* projects (our NuGets) require a pinned version of dependent packages. Currently, these are Microsoft.EntityFrameworkCore and Humanizer.Core. The rest are dev-only dependencies. - Example and test projects explicitly depend on the latest release of EF Core and Npgsql, so we're always building against the latest versions. This enables us to notice breaking changes in patch releases of dependent packages before we release a new version. - Because Microsoft.EntityFrameworkCore* packages are always published together, there's no need to explicitly reference its core package. For example, by referencing just Microsoft.EntityFrameworkCore.Sqlite v6.0.3, we can trust that it depends on Microsoft.EntityFrameworkCore v6.0.3 and nothing else, so there's no reason to explicitly reference Microsoft.EntityFrameworkCore as well. - Npgsql.EntityFrameworkCore.PostgreSQL is maintained by another team, and there's usually a small window of divergence. Therefore we do reference both Microsoft.EntityFrameworkCore* and Npgsql.EntityFrameworkCore.PostgreSQL explicitly.
1 parent a3a9389 commit 80c0ce5

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<EFCoreVersion>6.0.*</EFCoreVersion>
66
<EFCorePostgresVersion>6.0.*</EFCorePostgresVersion>
77
<MicrosoftCodeAnalysisVersion>4.1.*</MicrosoftCodeAnalysisVersion>
8-
<HumanizerVersion>2.*</HumanizerVersion>
8+
<HumanizerVersion>2.14.1</HumanizerVersion>
99
<JsonApiDotNetCoreVersionPrefix>5.0.0</JsonApiDotNetCoreVersionPrefix>
1010
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
1111
<WarningLevel>9999</WarningLevel>

src/JsonApiDotNetCore/JsonApiDotNetCore.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
<ItemGroup>
4040
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
4141
<PackageReference Include="Humanizer.Core" Version="$(HumanizerVersion)" />
42-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="$(EFCoreVersion)" />
43-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EFCoreVersion)" />
42+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
43+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.0" />
4444
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
4545
<PackageReference Include="SauceControl.InheritDoc" Version="1.3.0" PrivateAssets="All" />
4646
<PackageReference Include="System.ValueTuple" Version="4.5.0" />

test/TestBuildingBlocks/TestBuildingBlocks.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>$(TargetFrameworkName)</TargetFramework>
44
</PropertyGroup>
@@ -12,6 +12,7 @@
1212
<PackageReference Include="coverlet.collector" Version="$(CoverletVersion)" PrivateAssets="All" />
1313
<PackageReference Include="FluentAssertions" Version="6.5.1" />
1414
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="$(AspNetVersion)" />
15+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="$(EFCoreVersion)" />
1516
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="$(AspNetVersion)" />
1617
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
1718
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EFCorePostgresVersion)" />

0 commit comments

Comments
 (0)