Skip to content

Ignore unlisted versions when choosing the release to compare with - #113

Merged
Mpdreamz merged 1 commit into
mainfrom
fix/ignore-unlisted-baseline
Nov 24, 2026
Merged

Mpdreamz merged 1 commit into
mainfrom
fix/ignore-unlisted-baseline

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

The tool no longer picks an unlisted package version as the release to compare with, so a version its owner took off the feed cannot turn unchanged code into a major change.

Prompt summary: Onboard Elastic.Transport to the assembly-differ GitHub Action. On unchanged main the tool reported a major change against an unlisted 8.0.1, so the owner asked for the tool to ignore unlisted packages and for a bug-fix PR here.

Why

PreviousRelease.Find reads versions from NuGet's flat container, which lists every version, unlisted ones too. Elastic.Transport 8.0.1 is unlisted on nuget.org (its registration says listed: false), yet it was the newest version, so projects and nuget compared unchanged 1.1.x code with it and suggested Major. The release command only avoided it because 8.0.1 is above the packed version.

What

Baseline from the registration

Find now lists versions through PackageMetadataResource with includeUnlisted: false, so only listed, stable versions below the given one are candidates. The rule for stable and lower versions is unchanged.

Feeds without a registration

A v3 feed that offers no registration resource makes NuGet throw. Find catches that and lists the flat container as before, so such a feed keeps working. Local folder feeds have no unlisted state and are unaffected.

Test feed

FakeNuGetFeed serves a v3 service index, flat container, registration and .nupkg files on localhost, with a per-version listed flag. UnlistedReleaseTests publishes a listed 1.0.0 and an unlisted 8.0.1 and expects release for 9.0.0 to compare with 1.0.0.

Out of scope: the other FindPackageByIdResource uses (nuget provider downloads) still read the flat container; they fetch a version the user names, not a baseline.

Verify

dotnet test --project tests/assembly-differ.Tests -c Release --treenode-filter "/*/*/UnlistedReleaseTests/*"

Put the old PreviousRelease.cs back and the test fails with Comparing with ... 8.0.1. On a checkout of elastic/elastic-transport-net after dotnet build -c Release, assembly-differ projects now says Comparing Elastic.Transport ... with Elastic.Transport 1.1.0 and Suggested version change: None; before it said 8.0.1 and Major. The native-AOT binary resolves Proc 0.18.0's previous release as 0.17.0 (the smokeaot command, run by hand).

🤖 Generated with Claude Code

The flat container lists every version of a package, unlisted ones too,
so an unlisted 8.0.1 of Elastic.Transport became the baseline for every
build and made unchanged code a major change. PreviousRelease now reads
the registration, which says which versions are listed, and falls back
to the flat container for a feed that has none.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@Mpdreamz Mpdreamz added the bug A defect fixed (patch) label Nov 24, 2026
@Mpdreamz
Mpdreamz merged commit ab878fc into main Nov 24, 2026
8 checks passed
@Mpdreamz
Mpdreamz deleted the fix/ignore-unlisted-baseline branch November 24, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A defect fixed (patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant