Discover --update-packages candidates from restore feeds - #137
Draft
georgepwall1991 wants to merge 1 commit into
Draft
georgepwall1991 wants to merge 1 commit into
georgepwall1991 wants to merge 1 commit into
Conversation
Replace the nuget.org-only HTTP lookup with dotnet list package --outdated so NuGet.Config sources, credentials, and source mapping decide "latest". Fail closed (exit 8) when any project cannot be scanned, and probe every configured source from --doctor instead of claiming nuget.org is reachable. Co-authored-by: George Wall <georgepwall1991@users.noreply.github.com>
This branch has not been deployed
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.
--update-packagesused to learn "latest version" by HTTP-GETtingapi.nuget.org/v3-flatcontainerfor every pin inDirectory.Packages.props. NuGet.Config was never read.That had two silent-wrong outcomes:
Everything up to date!.Contoso.Core 99.0.0on nuget.org, CPMigrate proposed that upgrade, wrote it into the props file, and--bisectwould keep it if tests stayed green.--outdated,--audit,--deprecated, and--licensesalready go throughdotnet, which honours NuGet.Config, credential providers, and source mapping.--update-packagesnow does the same.What changed
IUpdateCandidateSource/RestoreBackedUpdateCandidateSourcerunsScanOutdatedPackagesAsyncper project throughGroupedScanScheduler. "Latest" isdotnet list package --outdatedagainst the caller's feeds.8(IncompleteAnalysis), prints the project names plus "A project that cannot restore against your configured feeds cannot be updated safely.", and writes nothing — no backup, no props edit, including--dry-runand--output Json.NuGetVersionLookupService,INuGetVersionLookupService, andNuGetRetryPolicy. Self-update (cpmigrate --update) still talks to nuget.org, which is where CPMigrate itself is published.--doctorenumerates enabled sources viadotnet nuget list source --format Detailedand probes each HTTP source (200 = reachable, 401/403 = authenticated, anything else names the source). Falls back to the nuget.org service-index probe only when listing fails.Tests
RestoreBackedUpdateCandidateSourceTests: highest-wins merge, direct vs transitive, prerelease pass-through, one failed project inUnscannedProjects, completion-order independence, bounded peak concurrency.IBackupManagernever called (including dry-run and JSON).PackageUpdateService*fixtures migrated fromINuGetVersionLookupServicemocks toFakeUpdateCandidateSource.No output schema bump:
Warningsand integerexitCodealready exist. Exit8for--update-packagesis a deliberate contract change so this path matches every other scan.