build: add PublicApiAnalyzers baseline for both src packages (#96)#166
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 23, 2026
This was referenced Jun 26, 2026
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.
Summary
Populates the
PublicAPI.Shipped.txt/PublicAPI.Unshipped.txtbaselines for the two shippablesrc/packages so the PublicApiAnalyzers (RS0016 / RS0017 / RS0025) now guard the public API surface against unintended breaking changes — the goal of #96.The analyzer infrastructure was already present on
main:Directory.Build.propsreferencesMicrosoft.CodeAnalysis.PublicApiAnalyzers3.3.4 and globs the two.txtfiles asAdditionalFiles(opt-in per project viaExists()). What was missing was the actual baseline files in the two library projects. This supersedes the reverted A1 attempt (commits 7d2fe3a / 9e42df7, reverted in 38470e4 during v0.8.1 release prep).What changed
src/Wolfgang.Etl.TestKit/—PublicAPI.Shipped.txt(full current public surface) +PublicAPI.Unshipped.txt(#nullable enableonly).src/Wolfgang.Etl.TestKit.Xunit/—PublicAPI.Shipped.txt(full current public surface) +PublicAPI.Unshipped.txt(#nullable enableonly)..csprojfiles:<WarningsAsErrors>$(WarningsAsErrors);RS0016;RS0017;RS0025</WarningsAsErrors>.Why the csproj
WarningsAsErrorsIn this repo's current analyzer configuration RS0016 ("symbol not in declared API") was not being raised, so a baseline alone would silently fail to catch additions to the surface (only RS0017 removals fired). Promoting the three tracking diagnostics to errors — scoped to the two opted-in src projects only, no protected-file edits — makes the baseline genuinely enforce both additions and removals. Verified by a negative test: deleting a single baseline entry now fails the build with RS0016.
Stale baseline corrected
The recoverable (reverted) baseline was generated without RS0016 active, so it omitted the recently-added contract-test methods (
ExtractAsync_/TransformAsync_CurrentItemCount_tracks_each_yielded_item_Async,LoadAsync_/TransformAsync_stops_reading_source_at_MaximumItemCount_Async) and the implicit public constructors of all 16 contract base classes. Those entries were added so the baseline matches the real surface.Public surface across TFMs
A single shared baseline builds clean against all 5 TFMs (
net462;net481;netstandard2.0;net8.0;net10.0) for both projects — the public surface does not differ per TFM.Build / test results
dotnet build -c Release(all TFMs), both src projects: 0 warnings / 0 errors.dotnet test -c Release -f net8.0:Wolfgang.Etl.TestKit.Tests.Unit: 58 passedWolfgang.Etl.TestKit.Xunit.Tests.Unit: 199 passedCloses #96
🤖 Generated with Claude Code