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

add explicit clone command for NuGet updater #10864

Merged
merged 2 commits into from
Oct 31, 2024
Merged

Conversation

brettfo
Copy link
Contributor

@brettfo brettfo commented Oct 29, 2024

This code is not yet live

The changes in this PR are only relevant for the long-standing work item of rewriting the NuGet updater in C#.

This PR moves the calls to git clone ... from the PowerShell script into C#. The reason is that we already have much of the architecture available there to process and report errors.

We can now unit test the result of the git clone ... commands without actually needing to invoke the tool.

The contents of the PowerShell script were also simplified to call the new tool.

There are still two separate calls into the NuGetUpdater.Cli tool because that's how an update job is invoked. One call with fetch_files and another with update_files. This also means that we can easily test either half in isolation; no need to perform a meaningless clone just to test the updater, and no need to prepare a bunch of files just to test the clone behavior.

The shape of some of the error types was incorrect and has also been fixed.

I manually verified the following:

Private repo - authenticated Private repo - unauthenticated Public repo
GitHub works appropriate error generated works
AzureDevOps works appropriate error generated untested, but no reason it shouldn't work

@brettfo brettfo requested a review from a team as a code owner October 29, 2024 23:30
@github-actions github-actions bot added the L: dotnet:nuget NuGet packages via nuget or dotnet label Oct 29, 2024
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.

For deployment

@kbukum1 kbukum1 merged commit 0e1d277 into main Oct 31, 2024
106 checks passed
@kbukum1 kbukum1 deleted the dev/brettfo/nuget-clone branch October 31, 2024 19:17
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.

4 participants