Closed mawosoft closed 2 years ago
The only way to mitigate this with the current toolset would be to store the refPackage
as artifact which seems a bit overkill.
Consider using an alternative to api-tools
:
PublicApiGenerator is available as dotnet tool and as library package. The dotnet tool creates a csproj with package refs, therefore leaving all the package retrival to the project system. The output is much better readable, smaller (~300KB for benchmarkdotnet.dll), and suitable for a standard diff tool like git diff. The output for the latest package can be stored as artifact and then used by the next run, avoiding any problems due to overwrites on the AppVeyor feed.
In general, breaking changes are removals in the diff, but not sure yet, how reliable that assumption is. Also, api-tools regards the removal of a type, method, etc. as non-breaking if it previously was marked as obsolete. That's not doable with a simple diff.
Example workflow
dotnet tool install --global PublicApiGenerator.Tool
generate-public-api --target-frameworks net5.0 --package benchmarkdotnet --package-version 0.13.1 >refbasepkg.txt
generate-public-api --target-frameworks net5.0 --package benchmarkdotnet --package-version *-* --package-source https://ci.appveyor.com/nuget/benchmarkdotnet >diffpkg.txt
git diff --no-index refbasepkg.txt diffpkg.txt >diffbase.txt
git diff --no-index previouspkg.txt diffpkg.txt >diffprevious.txt
PRs on BDN still seem to publish to the AppVeyor feed. They also overwrite existing versions. See https://github.com/dotnet/BenchmarkDotNet/issues/1937. We have to include the SHA and/or publishing timestamp in the
LastChecked.json
when checking for updated versions.https://github.com/mawosoft/Mawosoft.Extensions.BenchmarkDotNet/blob/691dd68c845f817c1841a215f98921751b32ac33/build/checkBreakingBDNChange.ps1#L98-L99 https://github.com/mawosoft/Mawosoft.Extensions.BenchmarkDotNet/blob/691dd68c845f817c1841a215f98921751b32ac33/build/ApiDiffHelper.psm1#L263-L271