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(packageRules): migrate matchers and excludes #28602

Open
wants to merge 71 commits into
base: v38
Choose a base branch
from

Conversation

rarkins
Copy link
Collaborator

@rarkins rarkins commented Apr 23, 2024

Changes

Migrate matchPackageX and excludePackageX plus associated matchDepX to use matchPackageNames and matchDepNames.

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

rarkins and others added 17 commits April 22, 2024 09:28
Previously, config from globalExtends was incorrectly merged _after_ other global config. This meant for example that packageRules in a config.js could not override packageRules from within globalExtends, because they were applied after. Now, globalExtends content will be merged first, and remaining global config merged second.

Fixes #28131

BREAKING CHANGE: order of globalExtends resolution is changed so that it is applied first and remaining global config takes precedence.
Previously, the “depName” for pep621 was constructed using groupName/packageName, which in turn meant that the same dependency was upgraded in different branches if it was present in multiple groups. Instead, depName is now set to packageName. This will lead to a change of branch name for pep621 updates.

Closes #28131

BREAKING CHANGE: depName for pep621 dependencies changes, which will lead to branch name changes, which will lead to some autoclosing and reopening of PRs.
Previous Gitea implementation used non-standard “token” auth instead of “Bearer”. Gitea supports Bearer al alternate to token since v1.8.0, so it’s safe to make this change now.

BREAKING CHANGE: Gitea platfor authentication will now be done using Bearer auth instead of token auth.
Stop publishing -slim Renovate tags - slim is now the default.

BREAKING CHANGE: Renovate docker images no longer have -slim tags. Drop the -slim prefix as this is now the default behavior.
… alerts (#25166)

Use sanitized depName in vulnerability/remediation branches instead of raw depName. This will result in some open remediation branches being autoclosed and replaced for ecosystems like go in particular which have special characters in depNames.

BREAKING CHANGE: Branch names for remediation will be sanitized to exclude special characters, potentially resulting in some autoclosing/replacing of existing PRs.
This option only worked for npm <7, which is now EOL.

BREAKING CHANGE: Transitive remediation for npm <7 is no longer supported.
Change onboardingNoDeps from boolean to enum, with new default "auto". Auto means that Renovate will continue skipping repos with no dependencies if autodiscover is in use, but onboarding them if they are explicitly specified in a non-autodiscover mode.

Closes #28101

BREAKING CHANGE: onboardingNoDeps changes from boolean to enum. Repositories with no dependencies will be onboarded unless in autodiscover mode.
Removes fallback to checking depName for all matchPackageX and excludePackageX rules.

BREAKING CHANGE: matchPackageNames and related functions no longer fall back to checking depName. Rewrite packageRules to use matchDepNames instead.
…for tag lookups (#28400)

Changes default Docker Hub lookups from index.docker.io to hub.docker.com, which is more efficient. If you are configuring a Docker Hub token for docker.io then you should now configure it for docker.com as well. 

Closes #24666

BREAKING CHANGE: Docker Hub lookups prefer hub.docker.com over index.docker.io. Set RENOVATE_X_DOCKER_HUB_TAGS_DISABLE=true in env to revert behavior.
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
@rarkins
Copy link
Collaborator Author

rarkins commented Apr 23, 2024

Blocked by #28591

@rarkins rarkins changed the title feat(packageRules): migrate matchers and excludes to use matchPackageNames/matchDepNames feat(packageRules): migrate matchers and excludes Apr 23, 2024
lib/modules/datasource/npm/npmrc.ts Outdated Show resolved Hide resolved
lib/modules/datasource/npm/npmrc.ts Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
lib/util/package-rules/index.ts Outdated Show resolved Hide resolved
rarkins and others added 18 commits May 5, 2024 08:26
Previously, config from globalExtends was incorrectly merged _after_ other global config. This meant for example that packageRules in a config.js could not override packageRules from within globalExtends, because they were applied after. Now, globalExtends content will be merged first, and remaining global config merged second.

Fixes #28131

BREAKING CHANGE: order of globalExtends resolution is changed so that it is applied first and remaining global config takes precedence.
Previously, the “depName” for pep621 was constructed using groupName/packageName, which in turn meant that the same dependency was upgraded in different branches if it was present in multiple groups. Instead, depName is now set to packageName. This will lead to a change of branch name for pep621 updates.

Closes #28131

BREAKING CHANGE: depName for pep621 dependencies changes, which will lead to branch name changes, which will lead to some autoclosing and reopening of PRs.
Previous Gitea implementation used non-standard “token” auth instead of “Bearer”. Gitea supports Bearer al alternate to token since v1.8.0, so it’s safe to make this change now.

BREAKING CHANGE: Gitea platfor authentication will now be done using Bearer auth instead of token auth.
Stop publishing -slim Renovate tags - slim is now the default.

BREAKING CHANGE: Renovate docker images no longer have -slim tags. Drop the -slim prefix as this is now the default behavior.
… alerts (#25166)

Use sanitized depName in vulnerability/remediation branches instead of raw depName. This will result in some open remediation branches being autoclosed and replaced for ecosystems like go in particular which have special characters in depNames.

BREAKING CHANGE: Branch names for remediation will be sanitized to exclude special characters, potentially resulting in some autoclosing/replacing of existing PRs.
This option only worked for npm <7, which is now EOL.

BREAKING CHANGE: Transitive remediation for npm <7 is no longer supported.
Change onboardingNoDeps from boolean to enum, with new default "auto". Auto means that Renovate will continue skipping repos with no dependencies if autodiscover is in use, but onboarding them if they are explicitly specified in a non-autodiscover mode.

Closes #28101

BREAKING CHANGE: onboardingNoDeps changes from boolean to enum. Repositories with no dependencies will be onboarded unless in autodiscover mode.
Removes fallback to checking depName for all matchPackageX and excludePackageX rules.

BREAKING CHANGE: matchPackageNames and related functions no longer fall back to checking depName. Rewrite packageRules to use matchDepNames instead.
…for tag lookups (#28400)

Changes default Docker Hub lookups from index.docker.io to hub.docker.com, which is more efficient. If you are configuring a Docker Hub token for docker.io then you should now configure it for docker.com as well. 

Closes #24666

BREAKING CHANGE: Docker Hub lookups prefer hub.docker.com over index.docker.io. Set RENOVATE_X_DOCKER_HUB_TAGS_DISABLE=true in env to revert behavior.
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
# Conflicts:
#	docs/usage/configuration-options.md
#	lib/util/package-rules/dep-names.ts
#	lib/util/package-rules/dep-patterns.spec.ts
#	lib/util/package-rules/dep-patterns.ts
#	lib/util/package-rules/index.spec.ts
#	lib/util/package-rules/package-names.spec.ts
#	lib/util/package-rules/package-names.ts
#	lib/util/package-rules/package-patterns.spec.ts
#	lib/util/package-rules/package-patterns.ts
#	lib/util/package-rules/package-prefixes.spec.ts
#	lib/util/package-rules/package-prefixes.ts
#	lib/util/package-rules/utils.ts
@rarkins rarkins requested review from secustor and viceice May 5, 2024 06:30
viceice
viceice previously approved these changes May 5, 2024
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

we need to check again when we change presets in main (like I did recently)

Comment on lines 2844 to 2845
"matchPackagePatterns": ["^angular"],
"rangeStrategy": "replace"
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
"matchPackagePatterns": ["^angular"],
"rangeStrategy": "replace"
"matchDatasources": ["npm"],
"matchPackageNames": ["@angular/*", "!@angular/abc"],
"groupName": "Angular"

The above will group together any npm package which starts with @angular/ except @angular/abc.

https://github.com/renovatebot/renovate/pull/28602/files#diff-be0a39f342380493f17c380bbd694f1f05d18bdd8d7cecf174369084952102deR2851
This does not fit the description

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought it does, how come you think why not?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The description is below not above the code snippet. Notice the The above will prefixes.

docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking change, requires major version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants