-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix(config/inherit): resolve presets #31642
base: main
Are you sure you want to change the base?
fix(config/inherit): resolve presets #31642
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop support for npm presets in inheritedConfig
@@ -159,6 +159,19 @@ Inherited config may use all Repository config settings, and any Global config o | |||
|
|||
For information on how the Mend Renovate App supports Inherited config, see the dedicated "Mend Renovate App Config" section toward the end of this page. | |||
|
|||
#### Presets handling | |||
|
|||
If the inherited config has presets, then Renovate: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the inherited config has presets, then Renovate: | |
If the inherited config contains `extends` presets, then Renovate: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the inherited config has presets, then Renovate: | |
If the inherited config contains `extends` presets, then Renovate will: |
If the inherited config has presets, then Renovate: | ||
|
||
1. Resolves the presets | ||
1. Adds the resolved presets to the inherited config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Adds the resolved presets to the inherited config | |
1. Add resolved preset config at the beginning of the inherited config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Adds the resolved presets to the inherited config | |
1. Add the resolved preset config to the beginning of the inherited config |
Maybe this is better. If we go with @rarkins
's suggestion, we should keep the the
word. 😉
// Decrypt after resolving, in case the preset contains npm authentication | ||
logger.debug('Resolving presets found in inherited config'); | ||
const resolvedConfig = await decryptConfig( | ||
await resolveConfigPresets(returnConfig, config, config.ignorePresets), | ||
config.repository, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm presets have been deprecated for a long time, please remove this logic to simplify things
returnConfig = removeGlobalConfig(resolvedConfig, true); | ||
if (!dequal(resolvedConfig, returnConfig)) { | ||
logger.debug( | ||
{ inheritedConfig: resolvedConfig, filteredConfig: returnConfig }, | ||
'Removed global config from inherited config presets.', | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inherited config does allow some fields which were previously considered "global", such as onboarding
. Please check that we don't log in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small additions to @rarkins
's suggestions.
|
||
1. Resolves the presets | ||
1. Adds the resolved presets to the inherited config | ||
1. Merges the presets on top of the global config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Merges the presets on top of the global config | |
1. Merge the presets on top of the global config |
@@ -159,6 +159,19 @@ Inherited config may use all Repository config settings, and any Global config o | |||
|
|||
For information on how the Mend Renovate App supports Inherited config, see the dedicated "Mend Renovate App Config" section toward the end of this page. | |||
|
|||
#### Presets handling | |||
|
|||
If the inherited config has presets, then Renovate: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the inherited config has presets, then Renovate: | |
If the inherited config contains `extends` presets, then Renovate will: |
If the inherited config has presets, then Renovate: | ||
|
||
1. Resolves the presets | ||
1. Adds the resolved presets to the inherited config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Adds the resolved presets to the inherited config | |
1. Add the resolved preset config to the beginning of the inherited config |
Maybe this is better. If we go with @rarkins
's suggestion, we should keep the the
word. 😉
Changes
Resolve presets present in inherited config
Context
Closes: #31278
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: