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

report specific error when project cannot be restored #10720

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

brettfo
Copy link
Contributor

@brettfo brettfo commented Oct 2, 2024

If a required package is missing from all sources in a packages.config scenario, report UpdateNotPossible instead of unknown_error.

An instance of this was seen where a NuGet.Config file was using an Azure DevOps feed with a restricted view that didn't have all packages listed.

@github-actions github-actions bot added the L: dotnet:nuget NuGet packages via nuget or dotnet label Oct 2, 2024
@brettfo brettfo force-pushed the dev/brettfo/nuget-no-package-found branch from 084dbf8 to f85188b Compare October 7, 2024 16:10
}

// this is a convenient method for tests
internal async Task<UpdateOperationResult> RunWithErrorHandlingAsync(string repoRootPath, string workspacePath, string dependencyName, string previousDependencyVersion, string newDependencyVersion, bool isTransitive)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This refactoring makes the unit tests easier to write.

@@ -192,4 +192,67 @@
end
end
end

describe "#ensure_no_errors" do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously we didn't have unit tests for converting updater errors into Ruby errors; this fixes that for all cases.

@brettfo brettfo force-pushed the dev/brettfo/nuget-no-package-found branch 3 times, most recently from b07a83d to 77d491e Compare October 7, 2024 20:27
@brettfo brettfo marked this pull request as ready for review October 7, 2024 20:46
@brettfo brettfo requested a review from a team as a code owner October 7, 2024 20:46
Copy link
Contributor

@kbukum1 kbukum1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for deployment.

@kbukum1 kbukum1 merged commit bfc7c91 into main Oct 7, 2024
88 checks passed
@kbukum1 kbukum1 deleted the dev/brettfo/nuget-no-package-found branch October 7, 2024 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: dotnet:nuget NuGet packages via nuget or dotnet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants