Repository navigation
feat: refuse EF Core 11 at registration; open 5.5.0 - #62
Merged
Merged
Conversation
EFCore.ComplexIndexes serves EF Core 10; from EF Core 11 its successor is CodoMetis.EFCore.SchemaKit. The [10.0.0, 11.0.0) ranges don't keep an EF Core 11 application out: a direct reference to Npgsql or EF Core 11 overrides the transitive ceiling with NU1608, a warning, and the differ then runs against an EF Core it was never tested on. Every registration entry point now calls EfCoreVersionGuard, which throws InvalidOperationException naming SchemaKit when EF Core's assembly major is not 10: UseComplexIndexes / AddComplexIndexes, the Npgsql and SQL Server counterparts, and both design-time registrations in ComplexIndexDesignTimeRegistration. The check reads typeof(DbContext).Assembly, never the runtime, since EF Core 10 on .NET 11 is supported. Tests feed a version through an async-local override, so parallel tests don't see each other's. The bug form gets a required "EF Core version" field offering 10.x only, and each README opens with one sentence pointing EF Core 11 users to SchemaKit. Verified by breaking it: emptying the check fails all 12 "EF Core 11 is refused" rows; removing each of the 8 call sites alone fails exactly the rows of the entry points that reach it (2 for each Use* method and its generic overload, 1 for each Add*, 1 for the core design-time registration, 2 for the satellite one). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Version 5.5.0, with the ApiCompat baseline moved to 5.4.1, the release it supersedes. The root changelog and the three package changelogs document the EF Core major guard (#55); the headings carry no date, because release.yml and ChangelogConsistencyTests match `## 5.5.0` literally. SECURITY.md states the decision of 2026-10-19 (#36): 5.x is the EF Core 10 line, supported until EF Core 10 leaves support in November 2028, and its EF Core 11 successor is CodoMetis.EFCore.SchemaKit 11.x. The supported-versions table keeps naming 5.4.x, the release on NuGet, until 5.5.0 ships. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #55
Part of the 5.5.0 epic (#36). Two commits, following the repository's "fix…; open x.y.z" convention: the guard, then opening 5.5.0.
Problem
EFCore.ComplexIndexesserves EF Core 10; from EF Core 11 on, its successor isCodoMetis.EFCore.SchemaKit(#37). The[10.0.0, 11.0.0)dependency ranges don't keep an EF Core 11 application out. A direct reference to Npgsql 11 or EF Core 11 overrides the transitive ceiling with NU1608, which is only a warning. The package then runs its differ against an EF Core it was never tested on, and nothing tells the consumer.Change
feat: refuse EF Core 11 at registration (#55)src/EFCore.ComplexIndexes/EfCoreVersionGuard.cs(new, internal):ThrowIfUnsupported()throwsInvalidOperationExceptionwhen EF Core's assembly major (typeof(DbContext).Assembly) is not 10. The message namesCodoMetis.EFCore.SchemaKitand explains NU1608. It never reads the runtime version: EF Core 10 on .NET 11 is supported. Tests feed a version throughUseVersion(...), which is async-local so that parallel tests stay isolated.UseComplexIndexes()/AddComplexIndexes(),UseNpgsqlComplexIndexes()/AddNpgsqlComplexIndexes(),UseSqlServerComplexIndexes()/AddSqlServerComplexIndexes()(the generic overloads delegate to these), and both design-time paths inComplexIndexDesignTimeRegistration(AddCoreDiffer,AddSatelliteDiffer). The public methods document the exception..github/ISSUE_TEMPLATE/bug.yml: a required EF Core version dropdown offering10.xonly, which points EF Core 11 users to SchemaKit.chore: open 5.5.0Version5.5.0.PackageValidationBaselineVersionmoves to 5.4.1, the release it supersedes.## 5.5.0section in the rootCHANGELOG.mdand in all three package changelogs. The headings are undated:release.ymlandChangelogConsistencyTestsmatch## 5.5.0literally.SECURITY.md: 5.x is the EF Core 10 line, fixes only from 5.5.0, maintained until EF Core 10 leaves support (November 2028). SchemaKit 11.x is the EF Core 11 line. The ids get deprecated only when EF Core 10 leaves support. The table still names 5.4.x, the release on NuGet, until 5.5.0 ships.Tests
EfCoreVersionGuardTests: one row per entry point (12, counting the generic overloads). Fed 11, each throwsInvalidOperationExceptionnaming SchemaKit; fed 10, each registers. One more test pins that, with no version fed, the guard reads the EF Core this suite runs on (10). Both EF Core's assembly and the runtime report 10.0.0.0 here, so that test can't tell them apart. That the guard reads EF Core's assembly rests on the code.Use*method and its generic overload, 1 for eachAdd*, 1 for the core design-time registration, 2 for the satellite one.net11.0console app withNpgsql.EntityFrameworkCore.PostgreSQL11.0.0-rc.2 getsrefused: EFCore.ComplexIndexes supports EF Core 10 only, but this application loaded EF Core 11.0. … use CodoMetis.EFCore.SchemaKit instead.fromUseNpgsqlComplexIndexes(). The same app on Npgsql 10.0.0 (EF Core 10 on the .NET 11 runtime) registers.CI=true(372 passed, including the PostgreSQL 18 integration tests),test/consumer-smoke-test.sh(passed for 5.5.0), anddotnet pack -c Release, which runs package validation against 5.4.1.dotnet ef migrations addon an EF Core 11 project. The unit tests cover the design-time path at theIDesignTimeServiceslevel.🤖 Generated with Claude Code