ci: add Microsoft.DotNet.ApiCompat ABI-diff gate (#174) - #266
Merged
Conversation
Closes #174. New api-compat.yaml workflow that builds the HEAD commit for net8.0 + net10.0, downloads the latest published Wolfgang.TryPattern .nupkg from nuget.org, and runs `apicompat --left prev.dll --right head.dll` per TFM. Any incompatibility (default-value change, nullability annotation flip, binary-layout shift, method-removal — anything PublicApiAnalyzers does not catch) fails the run unless it is explicitly recorded in .github/api-compat/suppressions.xml. Suppressions file (initially empty) is where intentional MAJOR-bump breaks land as part of the release PR — that's how the "recorded set of intentional breaks" AC is satisfied. Runs on PR (main + vNext), push-to-main, manual dispatch. Uses the Microsoft.DotNet.ApiCompat.Tool 10.0.302 global tool pinned to the current SDK 10 line. Local dry-run: apicompat --left <v0.3.4 .dll> --right <HEAD .dll> → "APICompat ran successfully without finding any breaking changes." Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced Jul 28, 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.
Closes #174.
Summary
api-compat.yaml: matrix overnet8.0+net10.0, builds HEAD, downloads latest publishedWolfgang.TryPattern.nupkgfrom nuget.org, runsapicompat --left prev.dll --right head.dllper TFM..github/api-compat/suppressions.xml(empty). This is where intentional MAJOR-version-bump ABI breaks land as part of the release PR — that's how the "set of intentional breaks recorded" AC is satisfied.Microsoft.DotNet.ApiCompat.Tool 10.0.302(current SDK 10 line), pinned so a future runner-image bump doesn't silently change the compat model.Stacked-PR base
Base =
vNext. Third of the 11-PR batch.Local dry-run
On this branch:
dotnet build src/Wolfgang.TryPattern -c Release -f net8.0→ OKwolfgang.trypattern.0.3.4.nupkgfrom nuget.orgapicompat --left <v0.3.4 .dll> --right <HEAD .dll> --suppression-file …/suppressions.xml→ "APICompat ran successfully without finding any breaking changes."Coverage vs. PublicApiAnalyzers
Complementary, not overlapping. PublicApiAnalyzers (
PublicAPI.Shipped.txtdiff) catches ADDED / REMOVED signatures at compile time.apicompatcatches BEHAVIOURAL breaks — default-value changes, nullability annotation flips, binary-layout shifts that consumers' compiled assemblies trip over at runtime.Protected-file guard
Adds a new workflow file → protected. Expected admin-bypass at merge, same pattern as PRs #256 / #257 / #258 / #261 / #262 / #263 / #265.
Test plan
api-compat (net8.0)job passes on this PRapi-compat (net10.0)job passes on this PR