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

feat(nuget): adds package source mapping and generate cached NuGet.config without CLI commands #25052

Merged
merged 35 commits into from Oct 17, 2023

Conversation

wterpstra
Copy link
Contributor

@wterpstra wterpstra commented Oct 5, 2023

Changes

This changes the way the cached nuget config gets generated, it no longer runs CLI commands to add sources but generates a NuGet.config XML using the createNuGetConfigXml inside the config-formatter.ts file. This was done so it can support packageSourceMapping which cannot be set using the CLI commands.

The getConfiguredRegistries now also picks up any package patterns that are mapped to a repository.

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Test run on a real repo
The resulting PR

@wterpstra wterpstra changed the title Generate cached NuGet.config without using CLI and support packageSourceMapping feat(nuget): Adds package source mapping and generate cached NuGet.config without CLI commands Oct 5, 2023
@wterpstra wterpstra force-pushed the feature/nugetpackagesourcemapping branch from 7fdd50d to 2118bb0 Compare October 5, 2023 08:24
@wterpstra wterpstra marked this pull request as ready for review October 5, 2023 10:35
@wterpstra wterpstra changed the title feat(nuget): Adds package source mapping and generate cached NuGet.config without CLI commands feat(nuget): adds package source mapping and generate cached NuGet.config without CLI commands Oct 5, 2023
@hoerup
Copy link

hoerup commented Oct 12, 2023

Is it correctly understood that with this MR, I can only configure packageSourceMapping via a nuget.conf file -that must reside in the individual repo's ?

lib/modules/manager/nuget/util.ts Outdated Show resolved Hide resolved
lib/modules/manager/nuget/config-formatter.ts Show resolved Hide resolved
lib/modules/manager/nuget/config-formatter.ts Outdated Show resolved Hide resolved
lib/modules/manager/nuget/config-formatter.ts Outdated Show resolved Hide resolved
lib/modules/manager/nuget/config-formatter.ts Outdated Show resolved Hide resolved
@wterpstra
Copy link
Contributor Author

Is it correctly understood that with this MR, I can only configure packageSourceMapping via a nuget.conf file -that must reside in the individual repo's ?

Correct

wterpstra and others added 4 commits October 16, 2023 08:30
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
@hoerup
Copy link

hoerup commented Oct 16, 2023

Is it correctly understood that with this MR, I can only configure packageSourceMapping via a nuget.conf file -that must reside in the individual repo's ?

Correct

I am using renovate on-prem for 100+ repos and I would really like if there was any way that I could use this with a centralized config 🙏

@wterpstra
Copy link
Contributor Author

Is it correctly understood that with this MR, I can only configure packageSourceMapping via a nuget.conf file -that must reside in the individual repo's ?

Correct

I am using renovate on-prem for 100+ repos and I would really like if there was any way that I could use this with a centralized config 🙏

Is there currently a feature in renovate where you can centralize this configuration for all repos? If so, I can have a look to make this compatible with it. But wouldn't it be weird to update your dependencies with a different configuration than the developers that are running/merging it?

lib/modules/manager/nuget/config-formatter.spec.ts Outdated Show resolved Hide resolved
lib/modules/manager/nuget/config-formatter.spec.ts Outdated Show resolved Hide resolved
lib/modules/manager/nuget/config-formatter.spec.ts Outdated Show resolved Hide resolved
lib/modules/manager/nuget/config-formatter.spec.ts Outdated Show resolved Hide resolved
lib/modules/manager/nuget/config-formatter.spec.ts Outdated Show resolved Hide resolved
lib/modules/manager/nuget/config-formatter.ts Outdated Show resolved Hide resolved
lib/modules/manager/nuget/config-formatter.ts Outdated Show resolved Hide resolved
lib/modules/manager/nuget/config-formatter.ts Outdated Show resolved Hide resolved
lib/modules/manager/nuget/config-formatter.ts Outdated Show resolved Hide resolved
lib/modules/manager/nuget/config-formatter.ts Outdated Show resolved Hide resolved
wterpstra and others added 7 commits October 16, 2023 11:35
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
wterpstra and others added 2 commits October 16, 2023 13:13
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
viceice
viceice previously approved these changes Oct 16, 2023
@viceice
Copy link
Member

viceice commented Oct 16, 2023

Missing code coverage

@wterpstra
Copy link
Contributor Author

Missing code coverage

There was no test for reading nuget.config files, I added it now. That should do the trick

viceice
viceice previously approved these changes Oct 16, 2023
@viceice
Copy link
Member

viceice commented Oct 16, 2023

still missing coverage

auto-merge was automatically disabled October 16, 2023 18:13

Head branch was pushed to by a user without write access

@wterpstra
Copy link
Contributor Author

still missing coverage

A line handling unnamed package sources was partially covered, I changed a test to include this case.

@viceice viceice added this pull request to the merge queue Oct 17, 2023
Merged via the queue into renovatebot:main with commit 65a69d5 Oct 17, 2023
38 of 52 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 37.27.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@viceice
Copy link
Member

viceice commented Oct 25, 2023

jon4hz pushed a commit to jon4hz/renovate that referenced this pull request Nov 9, 2023
…nfig without CLI commands (renovatebot#25052)

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression Issue about a regression bug, or the PR caused it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nuget: support for packageSourceMapping feature
5 participants