Skip to content

feat: refuse EF Core 11 at registration; open 5.5.0 - #62

Merged
CaffeinatedCoder merged 2 commits into
mainfrom
feat/55-refuse-ef-core-11
Oct 19, 2026
Merged

CaffeinatedCoder merged 2 commits into
mainfrom
feat/55-refuse-ef-core-11

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

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.ComplexIndexes serves EF Core 10; from EF Core 11 on, its successor is CodoMetis.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() throws InvalidOperationException when EF Core's assembly major (typeof(DbContext).Assembly) is not 10. The message names CodoMetis.EFCore.SchemaKit and explains NU1608. It never reads the runtime version: EF Core 10 on .NET 11 is supported. Tests feed a version through UseVersion(...), which is async-local so that parallel tests stay isolated.
  • Called from every registration entry point: UseComplexIndexes() / AddComplexIndexes(), UseNpgsqlComplexIndexes() / AddNpgsqlComplexIndexes(), UseSqlServerComplexIndexes() / AddSqlServerComplexIndexes() (the generic overloads delegate to these), and both design-time paths in ComplexIndexDesignTimeRegistration (AddCoreDiffer, AddSatelliteDiffer). The public methods document the exception.
  • .github/ISSUE_TEMPLATE/bug.yml: a required EF Core version dropdown offering 10.x only, which points EF Core 11 users to SchemaKit.
  • Each package README, and the root one, opens with one sentence pointing EF Core 11 users to SchemaKit. It contains no link, so the packed READMEs stay free of relative links.

chore: open 5.5.0

  • Version 5.5.0. PackageValidationBaselineVersion moves to 5.4.1, the release it supersedes.
  • A ## 5.5.0 section in the root CHANGELOG.md and in all three package changelogs. The headings are undated: release.yml and ChangelogConsistencyTests match ## 5.5.0 literally.
  • 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 throws InvalidOperationException naming 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.
  • Verified by breaking it: emptying the check fails all 12 "EF Core 11 is refused" rows. Removing each of the 8 call sites on its own fails exactly the rows 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.
  • End to end, on the packed 5.5.0: a net11.0 console app with Npgsql.EntityFrameworkCore.PostgreSQL 11.0.0-rc.2 gets refused: EFCore.ComplexIndexes supports EF Core 10 only, but this application loaded EF Core 11.0. … use CodoMetis.EFCore.SchemaKit instead. from UseNpgsqlComplexIndexes(). The same app on Npgsql 10.0.0 (EF Core 10 on the .NET 11 runtime) registers.
  • Locally: the full suite with CI=true (372 passed, including the PostgreSQL 18 integration tests), test/consumer-smoke-test.sh (passed for 5.5.0), and dotnet pack -c Release, which runs package validation against 5.4.1.
  • Not run: dotnet ef migrations add on an EF Core 11 project. The unit tests cover the design-time path at the IDesignTimeServices level.

🤖 Generated with Claude Code

CaffeinatedCoder and others added 2 commits October 19, 2026 19:14
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]>
@CaffeinatedCoder CaffeinatedCoder added this to the 5.5.0 milestone Oct 19, 2026
@CaffeinatedCoder CaffeinatedCoder added enhancement New feature or request package/core Affects EFCore.ComplexIndexes package/postgresql Affects EFCore.ComplexIndexes.PostgreSQL package/sqlserver Affects EFCore.ComplexIndexes.SqlServer area/migrations The differs, snapshot format, EnsureCreated and design-time wiring area/release Versioning, changelogs, release wiring labels Oct 19, 2026
@CaffeinatedCoder
CaffeinatedCoder merged commit fd28ded into main Oct 19, 2026
@CaffeinatedCoder
CaffeinatedCoder deleted the feat/55-refuse-ef-core-11 branch October 19, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/migrations The differs, snapshot format, EnsureCreated and design-time wiring area/release Versioning, changelogs, release wiring enhancement New feature or request package/core Affects EFCore.ComplexIndexes package/postgresql Affects EFCore.ComplexIndexes.PostgreSQL package/sqlserver Affects EFCore.ComplexIndexes.SqlServer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refuse EF Core 11 at registration: EFCore.ComplexIndexes serves EF Core 10 only

1 participant