Skip to content

ci: add Microsoft.DotNet.ApiCompat ABI-diff gate (#174) - #266

Merged
Chris-Wolfgang merged 1 commit into
vNextfrom
tier2/174-api-compat
Jul 17, 2026
Merged

ci: add Microsoft.DotNet.ApiCompat ABI-diff gate (#174)#266
Chris-Wolfgang merged 1 commit into
vNextfrom
tier2/174-api-compat

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Closes #174.

Summary

  • Adds api-compat.yaml: matrix over net8.0 + net10.0, builds HEAD, downloads latest published Wolfgang.TryPattern .nupkg from nuget.org, runs apicompat --left prev.dll --right head.dll per TFM.
  • Adds .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.
  • Uses 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 → OK
  • Downloaded wolfgang.trypattern.0.3.4.nupkg from nuget.org
  • apicompat --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.txt diff) catches ADDED / REMOVED signatures at compile time. apicompat catches 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 PR
  • api-compat (net10.0) job passes on this PR

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>
Copilot AI review requested due to automatic review settings July 16, 2026 00:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants