Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve restore error messages in source mapping scenarios #4374

Merged

Conversation

nkolev92
Copy link
Member

@nkolev92 nkolev92 commented Dec 21, 2021

Bug

Fixes: NuGet/Home#11385

Regression? Last working version:

Description

Some failure scenarios, in particular, NU1100, NU1101, NU1102, NU1103 relate to not being able to resolve a certain package from sources.
PackageSourceMapping filters some of those sources.

This changes adds extra details in those scenarios in source mapping scenarios, where appropriate (ie. source mapping filtered out some sources).

NU1100

Before:

  C:\Code\Temp\NU1000SourceMapping\NU1000SourceMapping.csproj : error NU1100: Unable to resolve 'NuGet.VersioningBla (>= 6.0.0)' for 'net6.0'.

After:

  C:\Code\Temp\NU1000SourceMapping\NU1000SourceMapping.csproj : error NU1100: Unable to resolve 'NuGet.VersioningBla (>= 6.0.0)' for 'net6.0'. PackageSourceMapping is enabled, the following source(s) were not considered: nuget, nuget-bu
ild.

NU1101

Before:

C:\Code\Temp\NU1000SourceMapping\NU1000SourceMapping.csproj : error NU1101: Unable to find package NuGet.VersioningBla. No packages exist with this id in source(s): nuget-build

After:

  C:\Code\Temp\NU1000SourceMapping\NU1000SourceMapping.csproj : error NU1101: Unable to find package NuGet.VersioningBla. No packages exist with this id in source(s): nuget-build. PackageSourceMapping is enabled, the following source(s)
 were not considered: nuget.

NU1102

NU1103 works the same way.

Before:

  C:\Code\Temp\NU1000SourceMapping\NU1000SourceMapping.csproj : error NU1102: Unable to find package NuGet.Versioning with version (= 6.0.0-preview.14)
C:\Code\Temp\NU1000SourceMapping\NU1000SourceMapping.csproj : error NU1102:   - Found 3684 version(s) in nuget-build [ Nearest version: 6.0.0-rc.235 ]

After:

  C:\Code\Temp\NU1000SourceMapping\NU1000SourceMapping.csproj : error NU1102: Unable to find package NuGet.Versioning with version (= 6.0.0-preview.14)
C:\Code\Temp\NU1000SourceMapping\NU1000SourceMapping.csproj : error NU1102:   - Found 3684 version(s) in nuget-build [ Nearest version: 6.0.0-rc.235 ]
C:\Code\Temp\NU1000SourceMapping\NU1000SourceMapping.csproj : error NU1102:   - Versions from nuget were not considered

PR Checklist

@nkolev92 nkolev92 requested a review from a team as a code owner December 21, 2021 21:42
@nkolev92 nkolev92 requested a review from erdembayar December 22, 2021 19:18
@nkolev92 nkolev92 requested a review from erdembayar December 22, 2021 20:20
@ghost ghost added the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Dec 30, 2021
@ghost
Copy link

ghost commented Dec 30, 2021

This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 7 days of this comment. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch.

@ghost ghost removed the Status:No recent activity PRs that have not had any recent activity and will be closed if the label is not removed label Jan 3, 2022
@nkolev92 nkolev92 merged commit e050b00 into dev Jan 3, 2022
@nkolev92 nkolev92 deleted the dev-nkolev92-improveRestoreErrorMessagesInSourceMappingScenarios branch January 3, 2022 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: PackageSourceMapping inconsistencies should be reported
4 participants