Skip to content

build: treat warnings as errors, drop GeneratePackageOnBuild - #7

Merged
CaffeinatedCoder merged 1 commit into
mainfrom
build/warnings-as-errors
Aug 16, 2026
Merged

CaffeinatedCoder merged 1 commit into
mainfrom
build/warnings-as-errors

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Why

Nothing policed warnings: a Release build of the solution carried 34 × EF1001 and 1 × CS0618 without anyone seeing them, and CS1591 on the shipping projects' public surface — the .xml a consumer's IntelliSense reads — could accumulate the same way (EFCore.ComplexIndexes reached 64 before turning this on in 5.0.3). Separately, GeneratePackageOnBuild=true is the trap the sibling repo documented and CLAUDE.md here was carrying the workaround for.

What

  • Directory.Build.props: TreatWarningsAsErrors=true, with NU1901–NU1904 kept as warnings (upstream advisories must not break unrelated runs, and must stay visible). Same carve-out and reasoning as EFCore.ComplexIndexes.
  • EF1001 (34): 32 are EF's analyzer reading this repository's own CodoMetis.ValueRanges.EntityFrameworkCore.PostgreSQL.Internal namespace as EF-internal when the NodaTime satellite consumes it — the analyzer keys on the EntityFrameworkCore.*.Internal namespace shape, not on an attribute. That warning is aimed at consumers; the satellite is the same codebase. The other 2 are Npgsql's PgNewArrayExpression in ValueSetsMethodCallTranslator, which has no public equivalent. All four files acknowledge it with a file-level pragma next to the reason — never repo-wide, so the next accidental one still surfaces.
  • CS0618 (1): Testcontainers' obsolete parameterless PostgreSqlBuilder(); the image now goes through the constructor. Same image, no behaviour change.
  • GeneratePackageOnBuild dropped, with the explanation from the sibling repo in the props file; PackagingConventionTests.SharedBuildProperties_DoNotSetGeneratePackageOnBuild keeps it out. CLAUDE.md's pack command is now plain dotnet pack -c Release.

Verified

  • The new convention test fails against the previous Directory.Build.props and passes now.
  • Full --no-incremental Release build of the solution: warning-free.
  • Plain dotnet pack from a clean bin/ produces the package (the cold-checkout case).
  • Whole suite green, integration included (Docker): 32 + 556 + 140 + 58 + 138 + 47.

🤖 Generated with Claude Code

Nothing policed warnings: a Release build of the solution carried 34 EF1001
and one CS0618 without anyone seeing them, and CS1591 on the shipping
projects' public surface — the .xml a consumer's IntelliSense reads — could
accumulate the same way (the sibling repository reached 64 before turning
this on).

TreatWarningsAsErrors is now set in Directory.Build.props, with NU1901-NU1904
kept as warnings: they report upstream advisories, so as errors they would
break unrelated CI runs at unpredictable moments, and they must stay visible
rather than be suppressed.

The 34 EF1001: 32 are EF's analyzer reading this repository's own
CodoMetis.ValueRanges.EntityFrameworkCore.PostgreSQL.Internal namespace as
EF-internal when the NodaTime satellite consumes it — the analyzer keys on
the `EntityFrameworkCore.*.Internal` shape, not on an attribute. That
warning is aimed at consumers; the satellite is the same codebase. The other
two are Npgsql's PgNewArrayExpression in the value-set translator, which has
no public equivalent. All four files acknowledge it with a file-level
pragma next to the reason, never repo-wide, so the next accidental one still
surfaces.

The CS0618 was Testcontainers' obsolete parameterless PostgreSqlBuilder();
the image now goes through the constructor. Same image, no behaviour change.

GeneratePackageOnBuild is dropped for the reason the sibling repository
documented: the SDK's pack targets prepend Build to GenerateNuspecDependsOn
only when it is not set, so plain `dotnet pack` silently behaved as
--no-build and failed with NU5026 on a clean checkout — CLAUDE.md had been
carrying the workaround. PackagingConventionTests now keeps it out.

Verified: the new convention test fails against the previous
Directory.Build.props and passes now; a full --no-incremental Release build
of the solution is warning-free; plain `dotnet pack` from a clean bin/
produces the package; the whole suite passes, integration included (Docker).

Co-Authored-By: Claude Fable 5 <[email protected]>
@CaffeinatedCoder
CaffeinatedCoder force-pushed the build/warnings-as-errors branch from b89ff04 to 57334b3 Compare August 16, 2026 12:07
@CaffeinatedCoder
CaffeinatedCoder merged commit 997eac5 into main Aug 16, 2026
6 checks passed
@CaffeinatedCoder
CaffeinatedCoder deleted the build/warnings-as-errors branch August 16, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant