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!: categories #16534

Merged
merged 153 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
f0e063e
feat(config)!: add new option `constraintsFiltering` (#19992)
RahulGautamSingh Jan 28, 2023
6f41e6b
feat!: default to rangeStrategy=auto, prefer update-lockfile (#19942)
rarkins Jan 28, 2023
25988d2
feat(config)!: non-zero defaults for PR concurrent, hourly limits (#1…
rarkins Jan 28, 2023
90cb59d
feat(cache): default cacheHardTtlMinutes to 24 hours (#20079)
rarkins Jan 28, 2023
1fadf7b
feat(go)!: default GOPROXY (#20081)
rarkins Jan 29, 2023
fdeba67
fix(regex): don’t escape forward slash in fileMatch (#19314)
rarkins Jan 30, 2023
9caf9ae
feat(cache): file cache cleanup (#20061)
rarkins Feb 1, 2023
a5577c3
feat(config): default `dockerImagePrefix` to `containerbase` (#20150)
viceice Feb 1, 2023
490be09
feat: introduce categories for managers and packageRules to match them
secustor Jul 11, 2022
daf3294
chore: remove enum from category
secustor Jul 12, 2022
6c3a5fd
docs: add categories to manager docs and reference them in conf optio…
secustor Jul 12, 2022
06438d7
chore: remove commented code
secustor Jul 12, 2022
e769862
refactor: sort alphabetically and rename jvm to java
secustor Aug 16, 2022
bee0094
adapt to new package-rule setup
secustor Sep 1, 2022
6cb7f64
docs: add deprecation notion and refer to match rule limitations
secustor Oct 22, 2022
cde8e7a
Apply suggestions from code review
secustor Oct 24, 2022
64afdf6
Update lib/config/options/index.ts
secustor Nov 30, 2022
67ef967
chore(categories): implement requested changes
secustor Dec 1, 2022
b03475b
docs(categories): use categories in manager overview instead of langu…
secustor Dec 1, 2022
eb4018a
Apply suggestions from code review
secustor Dec 13, 2022
2c4b7f8
Apply suggestions from code review
secustor Dec 14, 2022
ebdb037
docs: move matchCategories above matchLanguages
secustor Dec 14, 2022
f71c702
add whitespace back in
secustor Dec 14, 2022
33bb257
Apply suggestions from code review
secustor Dec 17, 2022
a99aadc
add categories to new managers and `kubernetes` to helm managers
secustor Dec 17, 2022
20b07d8
implement change requests
secustor Dec 21, 2022
7e6faae
Apply suggestions from code review
secustor Jan 24, 2023
16430c5
feat(manager/terraform): export updateLockedDependency
secustor Jan 25, 2023
94b7670
feat!: remove matchLanguage
secustor Jan 25, 2023
ea97326
chore(migrations): move migrations to package-rules-migration
secustor Jan 27, 2023
7991649
feat(languages)!: remove languages completely
secustor Jan 31, 2023
79425ab
tests(languages): remove test changes
secustor Jan 31, 2023
d019224
merge changes
secustor Feb 7, 2023
f61a511
feat(config)!: add new option `constraintsFiltering` (#19992)
RahulGautamSingh Jan 28, 2023
f38c303
feat!: default to rangeStrategy=auto, prefer update-lockfile (#19942)
rarkins Jan 28, 2023
909357d
feat(config)!: non-zero defaults for PR concurrent, hourly limits (#1…
rarkins Jan 28, 2023
1da183e
feat(cache): default cacheHardTtlMinutes to 24 hours (#20079)
rarkins Jan 28, 2023
4ecd182
feat(go)!: default GOPROXY (#20081)
rarkins Jan 29, 2023
bb827ae
fix(regex): don’t escape forward slash in fileMatch (#19314)
rarkins Jan 30, 2023
1fbe4b0
feat(cache): file cache cleanup (#20061)
rarkins Feb 1, 2023
11c0960
feat(config): default `dockerImagePrefix` to `containerbase` (#20150)
viceice Feb 1, 2023
a0a091b
chore: fix artifacts tests
rarkins Feb 11, 2023
38c419c
Merge branch 'v35' into implement_category
secustor Feb 13, 2023
17cd1ff
implement suggestions
secustor Feb 13, 2023
26acf2c
feat(config)!: add new option `constraintsFiltering` (#19992)
RahulGautamSingh Jan 28, 2023
dfd52ac
feat!: default to rangeStrategy=auto, prefer update-lockfile (#19942)
rarkins Jan 28, 2023
8214646
feat(config)!: non-zero defaults for PR concurrent, hourly limits (#1…
rarkins Jan 28, 2023
4bdd48c
feat(cache): default cacheHardTtlMinutes to 24 hours (#20079)
rarkins Jan 28, 2023
895cc26
feat(go)!: default GOPROXY (#20081)
rarkins Jan 29, 2023
8846efe
fix(regex): don’t escape forward slash in fileMatch (#19314)
rarkins Jan 30, 2023
62db658
feat(cache): file cache cleanup (#20061)
rarkins Feb 1, 2023
f320601
feat(config): default `dockerImagePrefix` to `containerbase` (#20150)
viceice Feb 1, 2023
6e8c6c6
chore: fix artifacts tests
rarkins Feb 11, 2023
c24ed82
fix(versioning)!: bump short ranges to version (#20494)
rarkins Feb 20, 2023
6a2bbaf
Merge branch 'v35' into implement_category
rarkins Feb 20, 2023
4176840
fix dotnet
rarkins Feb 21, 2023
2ef4307
implement suggestions
secustor Feb 22, 2023
186dd81
Merge branch 'main' into implement_category
secustor Mar 20, 2023
3204293
Merge branch 'main' into implement_category
secustor Mar 21, 2023
b4d6a9b
fixup merge
secustor Mar 22, 2023
d196622
implement suggestions, remove left over config option
secustor Mar 24, 2023
c202c03
Merge branch 'main' into implement_category
secustor Mar 30, 2023
9b89ebb
Merge branch 'main' into implement_category
secustor Apr 16, 2023
3c33034
docs: remove language reference from add-package-manager
secustor Apr 16, 2023
5fae6ec
Merge branch 'main' into implement_category
secustor Apr 25, 2023
2e4c3d8
Merge branch 'main' into implement_category
secustor May 7, 2023
5ccf756
feat: directly migrate from matchLanguages to matchCategories
secustor May 9, 2023
df877f8
Merge branch 'main' into implement_category
secustor May 10, 2023
0039e8d
feat!: allow post upgrade templating by default (#21326)
rarkins Apr 5, 2023
63ac11e
feat(automerge)!: default to platformAutomerge=true (#21327)
rarkins Apr 5, 2023
17849cc
feat(platform/gitlab)!: prefer `commit_email` (#21122
viceice Apr 26, 2023
854bbaf
fix(post-upgrade-tasks)!: enable dot option for file filters (#21282)
bgutschke Apr 26, 2023
a562b93
feat(npm)!: disable rollbackPrs for npm by default (#21970)
rarkins May 5, 2023
a640971
fix(presets)!: remove compatibility:additionalBranchPrefix (#22015)
rarkins May 7, 2023
160d872
remove compatibility presets
rarkins May 10, 2023
0f5c870
chore: export all types from category
secustor May 10, 2023
d2d1a93
Merge branch 'v36' into implement_category
secustor May 15, 2023
d2c6725
feat!: allow post upgrade templating by default (#21326)
rarkins Apr 5, 2023
4c0bb3a
feat(automerge)!: default to platformAutomerge=true (#21327)
rarkins Apr 5, 2023
94d73e4
feat(platform/gitlab)!: prefer `commit_email` (#21122
viceice Apr 26, 2023
4d95133
fix(post-upgrade-tasks)!: enable dot option for file filters (#21282)
bgutschke Apr 26, 2023
1b0570a
feat(npm)!: disable rollbackPrs for npm by default (#21970)
rarkins May 5, 2023
90975fb
fix(presets)!: remove compatibility:additionalBranchPrefix (#22015)
rarkins May 7, 2023
88ab057
feat(package-rules)!: remove fuzzy matchPaths matching (#22394)
rarkins May 24, 2023
86831e4
feat!: merge matchPaths and matchFiles into matchFileNames (#22406)
rarkins May 25, 2023
e5574c6
feat!: remove `skipInstalls` config option (#22648)
RahulGautamSingh Jun 12, 2023
68a0a1a
Merge remote-tracking branch 'upstream/v36' into category_test
secustor Jun 13, 2023
d9fd127
feat!: allow post upgrade templating by default (#21326)
rarkins Apr 5, 2023
83b0ccc
feat(automerge)!: default to platformAutomerge=true (#21327)
rarkins Apr 5, 2023
3548688
feat(platform/gitlab)!: prefer `commit_email` (#21122
viceice Apr 26, 2023
18365d0
fix(post-upgrade-tasks)!: enable dot option for file filters (#21282)
bgutschke Apr 26, 2023
fc60631
feat(npm)!: disable rollbackPrs for npm by default (#21970)
rarkins May 5, 2023
6c83e38
fix(presets)!: remove compatibility:additionalBranchPrefix (#22015)
rarkins May 7, 2023
df55d86
feat(package-rules)!: remove fuzzy matchPaths matching (#22394)
rarkins May 24, 2023
cd48668
feat!: merge matchPaths and matchFiles into matchFileNames (#22406)
rarkins May 25, 2023
d96e777
feat!: remove `skipInstalls` config option (#22648)
RahulGautamSingh Jun 12, 2023
ddd2af9
feat!: replace `dockerImagePrefix` with `dockerSidecarImage` (#22708)
RahulGautamSingh Jun 17, 2023
b11bb7d
feat!: Revert "feat!: remove `skipInstalls` config option (#22648)"
rarkins Jun 18, 2023
41d97e8
feat(release-notes)!: support configurable fetching stage (#22781)
RahulGautamSingh Jun 18, 2023
c450257
feat(npm): support constraintsFiltering=strict (#22447)
rarkins Jun 18, 2023
b0ab823
feat(package-rules)!: match packageName for matchPackageNames (#22703)
rarkins Jun 24, 2023
6432496
chore: fix docker exec test
rarkins Jun 27, 2023
4f5df0a
feat!: remove BUILDPACK env support
rarkins Jun 27, 2023
028f63c
Merge branch 'v36' into implement_category
rarkins Jun 27, 2023
155bc96
fix
rarkins Jun 27, 2023
c990e90
feat!: allow post upgrade templating by default (#21326)
rarkins Apr 5, 2023
bfc52b5
feat(automerge)!: default to platformAutomerge=true (#21327)
rarkins Apr 5, 2023
8c1202c
feat(platform/gitlab)!: prefer `commit_email` (#21122
viceice Apr 26, 2023
c07e60a
fix(post-upgrade-tasks)!: enable dot option for file filters (#21282)
bgutschke Apr 26, 2023
d0f8e4a
feat(npm)!: disable rollbackPrs for npm by default (#21970)
rarkins May 5, 2023
d80cdef
fix(presets)!: remove compatibility:additionalBranchPrefix (#22015)
rarkins May 7, 2023
332a3df
feat(package-rules)!: remove fuzzy matchPaths matching (#22394)
rarkins May 24, 2023
db9d90c
feat!: merge matchPaths and matchFiles into matchFileNames (#22406)
rarkins May 25, 2023
126ddef
feat!: remove `skipInstalls` config option (#22648)
RahulGautamSingh Jun 12, 2023
6b0bd7e
feat!: replace `dockerImagePrefix` with `dockerSidecarImage` (#22708)
RahulGautamSingh Jun 17, 2023
91f10f1
feat!: Revert "feat!: remove `skipInstalls` config option (#22648)"
rarkins Jun 18, 2023
cb6ae96
feat(release-notes)!: support configurable fetching stage (#22781)
RahulGautamSingh Jun 18, 2023
eff6063
feat(npm): support constraintsFiltering=strict (#22447)
rarkins Jun 18, 2023
1881137
feat(package-rules)!: match packageName for matchPackageNames (#22703)
rarkins Jun 24, 2023
2d51454
chore: fix docker exec test
rarkins Jun 27, 2023
f473e4f
feat!: remove BUILDPACK env support
rarkins Jun 27, 2023
e303e02
feat(presets)!: rename `config:base` to `config:recommended` (#21136)
viceice Jun 27, 2023
caa425c
feat(datasource)!: default to the central default versioning (#23020)
secustor Jun 29, 2023
0c74d90
Merge branch 'v36' into implement_category
secustor Jun 30, 2023
c0653fb
feat!: allow post upgrade templating by default (#21326)
rarkins Apr 5, 2023
949eef7
feat(automerge)!: default to platformAutomerge=true (#21327)
rarkins Apr 5, 2023
f67f0bc
feat(platform/gitlab)!: prefer `commit_email` (#21122
viceice Apr 26, 2023
8c7ab59
fix(post-upgrade-tasks)!: enable dot option for file filters (#21282)
bgutschke Apr 26, 2023
38bcaf7
feat(npm)!: disable rollbackPrs for npm by default (#21970)
rarkins May 5, 2023
076d012
fix(presets)!: remove compatibility:additionalBranchPrefix (#22015)
rarkins May 7, 2023
e966eeb
feat(package-rules)!: remove fuzzy matchPaths matching (#22394)
rarkins May 24, 2023
ad0c754
feat!: merge matchPaths and matchFiles into matchFileNames (#22406)
rarkins May 25, 2023
a80cb32
feat!: remove `skipInstalls` config option (#22648)
RahulGautamSingh Jun 12, 2023
4b76705
feat!: replace `dockerImagePrefix` with `dockerSidecarImage` (#22708)
RahulGautamSingh Jun 17, 2023
f1e6683
feat!: Revert "feat!: remove `skipInstalls` config option (#22648)"
rarkins Jun 18, 2023
e6abadd
feat(release-notes)!: support configurable fetching stage (#22781)
RahulGautamSingh Jun 18, 2023
d6e7139
feat(npm): support constraintsFiltering=strict (#22447)
rarkins Jun 18, 2023
9256d6a
feat(package-rules)!: match packageName for matchPackageNames (#22703)
rarkins Jun 24, 2023
38977cc
chore: fix docker exec test
rarkins Jun 27, 2023
2f1d419
feat!: remove BUILDPACK env support
rarkins Jun 27, 2023
a992665
feat(presets)!: rename `config:base` to `config:recommended` (#21136)
viceice Jun 27, 2023
061c0f4
feat(datasource)!: default to the central default versioning (#23020)
secustor Jun 29, 2023
c06e4cb
Merge branch 'v36' into implement_category
rarkins Jul 1, 2023
fb14776
go module
rarkins Jul 1, 2023
14ccb9a
feat!: drop node v19 support (#23006)
rarkins Jul 1, 2023
6abe789
Merge branch 'v36' into implement_category
secustor Jul 1, 2023
2e11610
do not migrate language to matchLanguage
secustor Jul 1, 2023
4e7de5c
cherry pick skipInstalls revert
rarkins Jul 2, 2023
d0ea42c
Revert "do not migrate language to matchLanguage"
secustor Jul 3, 2023
71e5883
tests: test migration from languages to matchCategories
secustor Jul 3, 2023
c4fd575
fixup! tests: test migration from languages to matchCategories
secustor Jul 3, 2023
3796f83
chore: remove custom migration logic
secustor Jul 3, 2023
a0d496e
Merge branch 'v36' into implement_category
rarkins Jul 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions docs/development/adding-a-package-manager.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Adding a Package Manager

This document explains how to add a new language/package manager.
This document explains how to add a new package manager.

## Code structure

Expand All @@ -21,7 +21,7 @@ The manager's `index.ts` file supports the following values or functions:
| `extractPackageFile` | | yes |
| `extractAllPackageFiles` | yes | yes |
| `getRangeStrategy` | yes | |
| `language` | yes | |
| `categories` | yes | |
| `supportsLockFileMaintenance` | yes | |
| `updateArtifacts` | yes | yes |
| `updateDependency` | yes | |
Expand Down Expand Up @@ -80,10 +80,6 @@ The `npm` manager uses the `getRangeStrategy` function to pin `devDependencies`

If left undefined, then a default `getRangeStrategy` will be used that always returns "replace".

### `language` (optional)

This is used when more than one package manager shares settings from a common language.

### `supportsLockFileMaintenance` (optional)

Set to `true` if this package manager needs to update lock files in addition to package files.
Expand Down
68 changes: 11 additions & 57 deletions docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -763,24 +763,6 @@ Descriptions fields embedded within presets are also collated as part of the onb

Add to this object if you wish to define rules that apply only to PRs that update digests.

## docker
secustor marked this conversation as resolved.
Show resolved Hide resolved

Add config here if you wish it to apply to Docker package managers Dockerfile and Docker Compose.
If instead you mean to apply settings to any package manager that updates using the Docker _datasource_, use a package rule instead, e.g.

```json
{
"packageRules": [
{
"matchDatasources": ["docker"],
"labels": ["docker-update"]
}
]
}
```

## dotnet
rarkins marked this conversation as resolved.
Show resolved Hide resolved

## draftPR

If you want the PRs created by Renovate to be considered as drafts rather than normal PRs, you could add this property to your `renovate.json`:
Expand Down Expand Up @@ -1132,16 +1114,6 @@ If you need to modify this path, for example in order to ignore directories, you
}
```

## golang

Configuration added here applies for all Go-related updates.
The only supported package manager for Go is the native Go Modules (the `gomod` manager).

For self-hosted users, `GOPROXY`, `GONOPROXY`, `GOPRIVATE` and `GOINSECURE` environment variables are supported ([reference](https://go.dev/ref/mod#module-proxy)).

Usage of `direct` will fallback to the Renovate-native release fetching mechanism.
Also we support the `off` keyword which will stop any fetching immediately.

## group

The default configuration for groups are essentially internal to Renovate and you normally shouldn't need to modify them.
Expand Down Expand Up @@ -1664,14 +1636,6 @@ Currently this applies to the `minimumReleaseAge` check only.
The `flexible` mode can result in "flapping" of Pull Requests, for example: a pending PR with version `1.0.3` is first released but then downgraded to `1.0.2` once it passes `minimumReleaseAge`.
We recommend that you use the `strict` mode, and enable the `dependencyDashboard` so that you can see suppressed PRs.

## java

Use this configuration option for shared config across all Java projects (Gradle and Maven).

## js

Use this configuration option for shared config across npm/Yarn/pnpm and meteor package managers.

## labels

By default, Renovate won't add any labels to PRs.
Expand Down Expand Up @@ -1810,12 +1774,6 @@ This works because Renovate will add a "renovate/stability-days" pending status

Add to this object if you wish to define rules that apply only to minor updates.

## node

Using this configuration option allows you to apply common configuration and policies across all Node.js version updates even if managed by different package managers (`npm`, `yarn`, etc.).

Check out our [Node.js documentation](https://docs.renovatebot.com/node) for a comprehensive explanation of how the `node` option can be used.

## npmToken

See [Private npm module support](./getting-started/private-packages.md) for details on how this is used.
Expand Down Expand Up @@ -2055,17 +2013,23 @@ See also `matchPackagePrefixes`.

The above will match all package names starting with `eslint` but exclude ones starting with `eslint-foo`.

### matchLanguages
### matchCategories
rarkins marked this conversation as resolved.
Show resolved Hide resolved
secustor marked this conversation as resolved.
Show resolved Hide resolved

Use `matchCategories` to restrict rules to a particular language or group.
secustor marked this conversation as resolved.
Show resolved Hide resolved
Matching is done using "any" logic, i.e. "match any of the following categories".
The categories can be found in the [manager documentation](./modules/manager/index.md).

Use this field to restrict rules to a particular language. e.g.
<!-- prettier-ignore -->
!!! note
Rules with `matchCategories` are only applied _after_ extraction of dependencies.
If you want to configure which managers are being extracted at all, use `enabledManagers` instead.

```json
{
"packageRules": [
{
"matchPackageNames": ["request"],
"matchLanguages": ["python"],
"enabled": false
"matchCategories": ["python"],
"addLabels": ["py"]
}
]
}
Expand Down Expand Up @@ -2528,8 +2492,6 @@ For example to replace the npm package `jade` with version `2.0.0` of the packag

Add to this object if you wish to define rules that apply only to patch updates.

## php

## pin

Add to this object if you wish to define rules that apply only to PRs that pin dependencies.
Expand Down Expand Up @@ -2864,10 +2826,6 @@ Set `pruneBranchAfterAutomerge` to `false` to keep the branch after automerging.
Configure to `false` to disable deleting orphan branches and autoclosing PRs.
Defaults to `true`.

## python

Currently the only Python package manager is `pip` - specifically for `requirements.txt` and `requirements.pip` files, or any file that matches the pattern `requirements-*.(txt|pip)` - so adding any config to this `python` object is essentially the same as adding it to the `pip_requirements` object instead.

## rangeStrategy

Behavior:
Expand Down Expand Up @@ -3314,10 +3272,6 @@ Renovate's "rollback" feature exists to propose a downgrade to the next-highest
Renovate does not create these rollback PRs by default, so this functionality needs to be opted-into.
We recommend you do this selectively with `packageRules` and not globally.

## ruby

## rust

## schedule

The `schedule` option allows you to define times of week or month for Renovate updates.
Expand Down
9 changes: 9 additions & 0 deletions docs/usage/golang.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ description: Go modules support in Renovate

Renovate supports upgrading dependencies in `go.mod` files and their accompanying `go.sum` checksums.

If you're self-hosting Renovate, you may use these environment variables:
secustor marked this conversation as resolved.
Show resolved Hide resolved

- `GOPROXY`
- `GONOPROXY`
- `GOPRIVATE`
- `GOINSECURE`

To learn what these variables do, read the [Go Modules Reference about the`GOPROXY` protocol](https://go.dev/ref/mod#module-proxy).

## How It Works

1. Renovate searches in each repository for any `go.mod` files
Expand Down
12 changes: 4 additions & 8 deletions lib/config/__snapshots__/validation.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,10 @@ exports[`config/validation validateConfig(config) errors if invalid combinations
]
`;

exports[`config/validation validateConfig(config) errors if language or manager objects are nested 1`] = `
exports[`config/validation validateConfig(config) errors if manager objects are nested 1`] = `
[
{
"message": "The "docker" object can only be configured at the top level of a config but was found inside "major.minor"",
"topic": "Configuration Error",
},
{
"message": "The "gradle" object can only be configured at the top level of a config but was found inside "java"",
"message": "The "gradle" object can only be configured at the top level of a config but was found inside "maven"",
"topic": "Configuration Error",
},
]
Expand Down Expand Up @@ -233,11 +229,11 @@ exports[`config/validation validateConfig(config) returns nested errors 1`] = `
exports[`config/validation validateConfig(config) selectors outside packageRules array trigger errors 1`] = `
[
{
"message": "docker.minor.matchDepNames: matchDepNames should be inside a \`packageRule\` only",
"message": "ansible.minor.matchDepNames: matchDepNames should be inside a \`packageRule\` only",
"topic": "Configuration Error",
},
{
"message": "docker.minor.matchPackageNames: matchPackageNames should be inside a \`packageRule\` only",
"message": "ansible.minor.matchPackageNames: matchPackageNames should be inside a \`packageRule\` only",
"topic": "Configuration Error",
},
{
Expand Down
13 changes: 5 additions & 8 deletions lib/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { logger } from '../logger';
import { get, getLanguageList, getManagerList } from '../modules/manager';
import { get, getManagerList } from '../modules/manager';
import * as options from './options';
import type {
AllConfig,
Expand All @@ -17,18 +17,15 @@ export function getManagerConfig(
): ManagerConfig {
let managerConfig: ManagerConfig = {
...config,
language: null,
manager,
};
const language = get(manager, 'language');
if (language) {
// TODO: fix types #7154
managerConfig = mergeChildConfig(managerConfig, config[language] as any);
managerConfig.language = language;
const categories = get(manager, 'categories');
if (categories) {
managerConfig.categories = categories;
}
// TODO: fix types #7154
managerConfig = mergeChildConfig(managerConfig, config[manager] as any);
for (const i of getLanguageList().concat(getManagerList())) {
for (const i of getManagerList()) {
delete managerConfig[i];
}
return managerConfig;
Expand Down
2 changes: 1 addition & 1 deletion lib/config/migration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ describe('config/migration', () => {
matchBaseBranches: ['master'],
matchDatasources: ['orb'],
matchDepTypes: ['peerDependencies'],
matchLanguages: ['python'],
matchCategories: ['python'],
matchManagers: ['dockerfile'],
matchPackageNames: ['foo'],
matchPackagePatterns: ['^bar'],
Expand Down
50 changes: 50 additions & 0 deletions lib/config/migrations/custom/package-rules-migration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,54 @@ describe('config/migrations/custom/package-rules-migration', () => {
}
);
});

it('should migrate languages to categories', () => {
expect(PackageRulesMigration).toMigrate(
{
packageRules: [
{
matchLanguages: ['docker', 'js'],
addLabels: ['docker'],
},
{
languages: ['java'],
addLabels: ['java'],
},
],
},
{
packageRules: [
{
matchCategories: ['docker', 'js'],
addLabels: ['docker'],
},
{
matchCategories: ['java'],
addLabels: ['java'],
},
],
}
);
});

it('should migrate single match rule', () => {
expect(PackageRulesMigration).toMigrate(
{
packageRules: [
{
matchLanguages: ['python'],
addLabels: ['py'],
},
],
},
{
packageRules: [
{
matchCategories: ['python'],
addLabels: ['py'],
},
],
}
);
});
});
3 changes: 2 additions & 1 deletion lib/config/migrations/custom/package-rules-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export const renameMap = {
matchFiles: 'matchFileNames',
matchPaths: 'matchFileNames',
paths: 'matchFileNames',
languages: 'matchLanguages',
viceice marked this conversation as resolved.
Show resolved Hide resolved
secustor marked this conversation as resolved.
Show resolved Hide resolved
languages: 'matchCategories',
matchLanguages: 'matchCategories',
baseBranchList: 'matchBaseBranches',
managers: 'matchManagers',
datasources: 'matchDatasources',
Expand Down
Loading