Skip to content

write user-level NuGet.Config in end-to-end updater #12105

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

Merged
merged 2 commits into from
Apr 25, 2025

Conversation

brettfo
Copy link
Contributor

@brettfo brettfo commented Apr 21, 2025

This PR updates the end-to-end updater with support for writing a user-level NuGet.Config with the feed credentials that were passed in via the job file or dependabot.yml. This behavior already exists in the hybrid Ruby/C# updater.

The end-to-end updater also now has support for the replaces-base parameter which is used to suppress the default package feed; in this case api.nuget.org.

All relevant implementation and testing is done in the PowerShell scripts with only a single change in the C# code to allow the contents of credentials-metadata to be anything (object) instead of string. The native updater doesn't use those values so the type is irrelevant.

No tokens or passwords are written to the user-level NuGet.Config file; the proxy handles all of that for us.

Fixes #11781

Also adds support for `replaces-base`
@github-actions github-actions bot added the L: dotnet:nuget NuGet packages via nuget or dotnet label Apr 21, 2025
@@ -32,7 +31,7 @@ public sealed record Job
public bool RejectExternalCode { get; init; } = false;
public bool RepoPrivate { get; init; } = false;
public CommitOptions? CommitMessageOptions { get; init; } = null;
public ImmutableArray<Dictionary<string, string>>? CredentialsMetadata { get; init; } = null;
public ImmutableArray<Dictionary<string, object>>? CredentialsMetadata { get; init; } = null;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The native updater doesn't use these values so object is fine.

@brettfo brettfo marked this pull request as ready for review April 21, 2025 20:57
@brettfo brettfo requested a review from a team as a code owner April 21, 2025 20:57
@AbhishekBhaskar AbhishekBhaskar merged commit 59ed185 into main Apr 25, 2025
81 checks passed
@AbhishekBhaskar AbhishekBhaskar deleted the dev/brettfo/nuget-native-package-sources branch April 25, 2025 16:56
phillipuniverse pushed a commit to phillipuniverse/dependabot-core that referenced this pull request Apr 29, 2025
Also adds support for `replaces-base`

Co-authored-by: Abhishek <[email protected]>
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.

NuGet end-to-end updater needs to populate user-local NuGet.Config file
3 participants