Repository navigation
Replace broken ApiCompat setup with SDK package validation - #4673
Merged
Merged
Conversation
The old setup (Arcade ApiCompat beta from the dnceng feed plus scripts that downloaded the previous nupkg) was disabled during 15.0 and has not run since. Package validation is built into the SDK and runs on pack. It is enabled only on Windows, since that build produces the net471 target and is the one that packs and publishes. The baseline is 16.0.0. CompatibilitySuppressions.xml records the existing differences: - Members added to public interfaces in 15.1.1 / 16.1.0 (DI-enabled ConstructUsing, Condition/PreCondition, PolymorphicProjectionsEnabled) - netstandard2.0 vs net8.0 differences from default interface members that are only available on net8.0+, plus StringToEnumMapper being sealed only on net8.0+ Replaces ApiCompatBaseline.txt (last updated for 14.0) and updates the API Changes docs page to point at the suppression file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The package-validation changes have no active review issues requiring resolution.
No open issues 🎉
What changed in this PR
Replaces the inactive ApiCompat setup with SDK package validation, restoring compatibility checks when AutoMapper packages are packed on Windows.
Changes:
- Enables validation against version 16.0.0 and across target frameworks.
- Records accepted compatibility differences in a suppression file and documents its maintenance.
- Removes obsolete validation scripts, baseline output, and configuration.
| File | Description |
|---|---|
src/AutoMapper/CompatibilitySuppressions.xml |
Records accepted baseline and cross-framework compatibility differences. |
src/AutoMapper/AutoMapper.csproj |
Enables Windows-only package validation and removes legacy configuration. |
src/AutoMapper/ApiCompatBaseline.txt |
Deletes the outdated compatibility report. |
src/AutoMapper/ApiCompat/PreBuild.sh |
Deletes the obsolete Bash baseline-download script. |
src/AutoMapper/ApiCompat/PreBuild.ps1 |
Deletes the obsolete PowerShell baseline-download script. |
docs/source/API-Changes.md |
Documents package validation, suppressions, and baseline updates. |
.gitignore |
Removes the obsolete baseline-binary ignore entry. |
Review effort: Balanced
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
The old ApiCompat setup used the Arcade
Microsoft.DotNet.ApiCompatbeta from the dnceng feed plus bash/PowerShell scripts that curl the previous nupkg. It was commented out during 15.0 and hasn't run since. As a result,ApiCompatBaseline.txt(which the docs link to) still describes the 13 → 14 changes.This PR replaces it with the SDK's built-in package validation:
EnablePackageValidation+PackageValidationBaselineVersion=16.0.0, Windows only. That's the build that produces net471 and packs and publishes (Build.ps1only packs on the Windows runner).ApiCompat/scripts,ApiCompatBaseline.txt, the old ApiCompat properties andResolvedMatchingContract, and the.gitignoreentry forLastMajorVersionBinary.CompatibilitySuppressions.xmland updatesdocs/source/API-Changes.mdto point at it, including how to maintain it across major versions.What validation found (all suppressed)
Compared with the 16.0.0 baseline (CP0006: members added to public interfaces). These are binary breaks for anyone who implements these interfaces themselves. All of them first shipped in 15.1.1 (a patch release) and 16.1.0:
IMappingExpressionBase<,,>.ConstructUsing(Type)/ConstructUsing<TConstructor>()(DI-enabled destination factories)IMemberConfigurationExpression.Condition(Type)/PreCondition(Type)and the generic versions (Dependency injection in conditions #4562)IProfileConfiguration/IProfileExpression/IGlobalConfiguration.PolymorphicProjectionsEnabled(Allow disabling of polymorphic mapping for LINQ queries #4595)netstandard2.0 compared with net8.0 (CP0002 ×29, CP0009 ×1), existing by design. On net8.0+ these are default interface members (
#if NET8_0_OR_GREATER). On netstandard2.0 and net471 the classes implement them directly (FULL_OR_STANDARD). All are inAutoMapper.Execution/AutoMapper.Internal/MemberMap, which overlaps with the existing public issue about cleaning upAutoMapper.Internal.StringToEnumMapperis sealed only on net8.0+.From now on, changes like these fail the Windows pack unless they're added to the suppression file deliberately.
Verification
-p:IsWindows=true(includes net471): fails without the suppression file and passes with itEnablePackageValidationempty, so Linux CI is unaffected🤖 Generated with Claude Code