Skip to content

Conversation

dolejska-daniel
Copy link

@dolejska-daniel dolejska-daniel commented Oct 4, 2025

Changes

  • add a dotnetEnableWindowsTargeting to postUpdateOptions of nuget manager
    • if the option is, present add -p:EnableWindowsTargeting=true CLI arg to all dotnet restore commands run

Context

Please select one of the below:

  • This closes an existing Issue: #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

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

The public repository: https://github.com/dolejska-daniel/renovate

@dolejska-daniel dolejska-daniel changed the title fix: allow enabling Windows targeting for NuGet restore commands feat(nuget): allow enabling Windows targeting for NuGet restore commands Oct 4, 2025
Copy link
Contributor

@jamietanna jamietanna left a comment

Choose a reason for hiding this comment

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

I'll let @RahulGautamSingh have a re-review too, but one thing I noticed is that we also need to update:

  • {
    name: 'postUpdateOptions',
    description:
    'Enable post-update options to be run after package/artifact updating.',
    type: 'array',
    default: [],
    subType: 'string',
    allowedValues: [
    'bundlerConservative',
    'composerWithAll',
    'dotnetWorkloadRestore',
    'gomodMassage',
    'gomodTidy',
    'gomodTidy1.17',
    'gomodTidyE',
    'gomodUpdateImportPaths',
    'gomodSkipVendor',
    'gomodVendor',
    'helmUpdateSubChartArchives',
    'kustomizeInflateHelmCharts',
    'npmDedupe',
    'npmInstallTwice',
    'pnpmDedupe',
    'yarnDedupeFewer',
    'yarnDedupeHighest',
    ],
    cli: false,
    env: false,
    mergeable: true,
    },
  • ## postUpdateOptions

Once those and the outstanding comments are addressed, this looks good to go!

const cmds = [
...dependentPackageFileNames.map(
(fileName) =>
// it is essential that dotnetRestoreOpts are added directly after the previous arguments
Copy link
Contributor

Choose a reason for hiding this comment

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

If it was added with an additional space, the only "problem" we'd see are that our tests would need to update as there'd be an additional space, right?

There's nothing the dotnet CLI will have issues with?

jamietanna
jamietanna previously approved these changes Oct 7, 2025
Copy link
Contributor

@jamietanna jamietanna left a comment

Choose a reason for hiding this comment

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

Awesome, thank you!

Will confirm ☝️ then we'll get this merged

@jamietanna jamietanna added the hacktoberfest-accepted The Renovate project does not officially participate in Hacktoberfest - but some PRs are accepted label Oct 7, 2025
Co-authored-by: RahulGautamSingh <[email protected]>
Copy link
Collaborator

@RahulGautamSingh RahulGautamSingh left a comment

Choose a reason for hiding this comment

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

Please take a look at the issue with import of Ajv

(Updated by @jamietanna - this is unrelated to this PR)

Comment on lines +56 to +57
In case you need to allow Windows targeting during package restore, e.g. adding the `-p:EnableWindowsTargeting=true`.
In Renovate, the same effect is achieved by adding `dotnetEnableWindowsTargeting` to `postUpdateOptions`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
In case you need to allow Windows targeting during package restore, e.g. adding the `-p:EnableWindowsTargeting=true`.
In Renovate, the same effect is achieved by adding `dotnetEnableWindowsTargeting` to `postUpdateOptions`.
In case you need to allow Windows targeting during package restore, e.g. adding the `-p:EnableWindowsTargeting=true`.
You can do so by adding `dotnetEnableWindowsTargeting` to the `postUpdateOptions`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted The Renovate project does not officially participate in Hacktoberfest - but some PRs are accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants