release/api-compatibility/dotnet
A library checks its API against the previous release
Implements release/api-compatibility for dotnet.
| Severity | info |
| Tiers | 1 |
| Stacks | dotnet |
| Scope | root |
| Kind | outcome |
| Source | library v0.6.0 |
| Selected by | fleetlint-recommended@v0.6.0 |
Requirement
A packable project enables package validation against the previous version (EnablePackageValidation with PackageValidationBaselineVersion) or runs ApiCompat.
Why
A breaking change in a minor release is found by every user at once; the check finds it before the tag.
Applies when
glob("**/*.csproj").exists(f, text(f).matches(r'<(PackageId|IsPackable>true)'))Fix
Set <EnablePackageValidation>true</EnablePackageValidation> and <PackageValidationBaselineVersion> (the previous release) in the packable project.
Agent instruction: Add the stack’s API compatibility tool to the release workflow, comparing against the latest tag; on a breaking change bump the major version instead of silencing the tool.
A finding of this rule points at Directory.Build.props.
Sources
- https://semver.org/spec/v2.0.0.html (standard)
- https://fleetlint.org/baseline/#releases (convention)
- https://learn.microsoft.com/en-us/dotnet/fundamentals/apicompat/package-validation/baseline-version-validator (spec)
- https://fleetlint.org/stacks/#net
Generated by fleetlint docs from catalog v0.6.0.