Skip to content

Commit

Permalink
feat(presets)!: rename config:base to config:recommended (#21136)
Browse files Browse the repository at this point in the history
Closes #12024

Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Bastian Gutschke <bastian.gutschke@gmx.de>

BREAKING CHANGE: Preset config:base is now called config:recommended
  • Loading branch information
viceice authored and rarkins committed Jul 4, 2023
1 parent c7832e5 commit f9e3e80
Show file tree
Hide file tree
Showing 23 changed files with 66 additions and 64 deletions.
2 changes: 1 addition & 1 deletion docs/development/creating-editing-renovate-presets.md
Expand Up @@ -27,7 +27,7 @@ We have multiple kinds of `group:` presets, with different rules.
##### Rules for `group:*` presets

1. Finally, any other `group:*` presets can be added if they are beneficial to a wide number of users
1. They don't need to be added to `group:recommended`, meaning that users will "opt in" to them one by one and not get them automatically from `config:base`, which includes `group:monorepo` and `group:recommended`
1. They don't need to be added to `group:recommended`, meaning that users will "opt in" to them one by one and not get them automatically from `config:recommended`, which includes `group:monorepo` and `group:recommended`

#### Replacement presets

Expand Down
14 changes: 7 additions & 7 deletions docs/usage/config-presets.md
Expand Up @@ -101,7 +101,7 @@ You can set a Git tag (like a SemVer) to use a specific release of your shared c
An example of a small rule is `:preserveSemverRanges`, which has the description "Preserve (but continue to upgrade) any existing SemVer ranges.".
It simply sets the configuration option `rangeStrategy` to `replace`.

An example of a full config is `config:base`, which is Renovate's default configuration.
An example of a full config is `config:recommended`, which is Renovate's default configuration.
It mostly uses Renovate config defaults but adds a few smart customizations such as grouping monorepo packages together.

<!-- prettier-ignore -->
Expand All @@ -111,27 +111,27 @@ It mostly uses Renovate config defaults but adds a few smart customizations such

## How to Use Preset Configs

By default, Renovate App's onboarding PR suggests the `["config:base]"` preset.
If you're self hosting, and want to use the `config:base` preset, then you must add `"onboardingConfig": { "extends": ["config:base"] }` to your bot's config.
By default, Renovate App's onboarding PR suggests the `["config:recommended]"` preset.
If you're self hosting, and want to use the `config:recommended` preset, then you must add `"onboardingConfig": { "extends": ["config:recommended"] }` to your bot's config.

Read the [Full Config Presets](https://docs.renovatebot.com/presets-config/) page to learn more about our `config:` presets.

A typical onboarding `renovate.json` looks like this:

```json
{
"extends": ["config:base"]
"extends": ["config:recommended"]
}
```

Here's an example of using presets to change Renovate's behavior.
You're happy with the `config:base` preset, but want Renovate to create PRs when you're not at the office.
You're happy with the `config:recommended` preset, but want Renovate to create PRs when you're not at the office.
You look at our `schedule:` presets, and find the `schedule:nonOfficeHours` preset.
You put `schedule:nonOfficeHours` in the `extends` array of your `renovate.json` file, like this:

```json
{
"extends": ["config:base", "schedule:nonOfficeHours"]
"extends": ["config:recommended", "schedule:nonOfficeHours"]
}
```

Expand Down Expand Up @@ -256,7 +256,7 @@ For example:
"version": "0.0.1",
"renovate-config": {
"default": {
"extends": ["config:base", "schedule:nonOfficeHours"]
"extends": ["config:recommended", "schedule:nonOfficeHours"]
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions docs/usage/configuration-options.md
Expand Up @@ -320,7 +320,7 @@ Configuring this to `true` means that Renovate will detect and apply the default
## branchConcurrentLimit

By default, Renovate won't enforce any concurrent branch limits.
The `config:base` preset that many extend from limits the number of concurrent branches to 10, but in many cases a limit as low as 3 or 5 can be most efficient for a repository.
The `config:recommended` preset that many extend from limits the number of concurrent branches to 10, but in many cases a limit as low as 3 or 5 can be most efficient for a repository.

If you want the same limit for both concurrent branches and concurrent PRs, then set a value for `prConcurrentLimit` and it will be re-used for branch calculations too.
But if you want to allow more concurrent branches than concurrent PRs, you can configure both values (e.g. `branchConcurrentLimit=5` and `prConcurrentLimit=3`).
Expand Down Expand Up @@ -648,13 +648,13 @@ Compare that to `registryUrls`, which are a way to _override_ registries.

## dependencyDashboard

Starting from version `v26.0.0` the "Dependency Dashboard" is enabled by default as part of the commonly-used `config:base` preset.
Starting from version `v26.0.0` the "Dependency Dashboard" is enabled by default as part of the commonly-used `config:recommended` preset.

To disable the Dependency Dashboard, add the preset `:disableDependencyDashboard` or set `dependencyDashboard` to `false`.

```json
{
"extends": ["config:base", ":disableDependencyDashboard"]
"extends": ["config:recommended", ":disableDependencyDashboard"]
}
```

Expand Down Expand Up @@ -1574,7 +1574,7 @@ For instance if you have a project with an `"examples/"` directory you wish to i
```

Renovate's default ignore is `node_modules` and `bower_components` only.
If you are extending from the popular `config:base` preset then it adds ignore patterns for `vendor`, `examples`, `test(s)` and `fixtures` directories too.
If you are extending from the popular `config:recommended` preset then it adds ignore patterns for `vendor`, `examples`, `test(s)` and `fixtures` directories too.

## ignorePlugins

Expand All @@ -1595,12 +1595,12 @@ For example, consider this config:

```json
{
"extends": ["config:base"],
"extends": ["config:recommended"],
"ignorePresets": [":prHourlyLimit2"]
}
```

It would take the entire `"config:base"` preset - which has a lot of sub-presets - but ignore the `":prHourlyLimit2"` rule.
It would take the entire `"config:recommended"` preset - which has a lot of sub-presets - but ignore the `":prHourlyLimit2"` rule.

## ignoreReviewers

Expand Down Expand Up @@ -2629,7 +2629,7 @@ The `postUpgradeTasks` configuration consists of three fields:

A list of commands that are executed after Renovate has updated a dependency but before the commit is made.

You can use variable templating in your commands if [`allowPostUpgradeCommandTemplating`](./self-hosted-configuration.md#allowpostupgradecommandtemplating) is enabled.
You can use variable templating in your commands as long as [`allowPostUpgradeCommandTemplating`](./self-hosted-configuration.md#allowpostupgradecommandtemplating) is enabled.

<!-- prettier-ignore -->
!!! note
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/docker.md
Expand Up @@ -185,7 +185,7 @@ Add all paths to ignore into the `ignorePaths` configuration field. e.g.

```json
{
"extends": ["config:base"],
"extends": ["config:recommended"],
"ignorePaths": ["docker/old-files/"]
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/examples/self-hosting.md
Expand Up @@ -248,7 +248,7 @@ module.exports = {
token: '**gitlab_token**',
platform: 'gitlab',
onboardingConfig: {
extends: ['config:base'],
extends: ['config:recommended'],
},
repositories: ['username/repo', 'orgname/repo'],
};
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/getting-started/installing-onboarding.md
Expand Up @@ -108,7 +108,7 @@ Sometimes Renovate detects that an override to these defaults is needed, and wil
Please check the docs on this website for an exhaustive Configuration Reference.
To help you get started, here are some of the most commonly changed (overridden) configuration settings:

- **rangeStrategy**: By default (with zero config) it's `"replace"` but the `"config:base"` preset overrides it to `"auto"`. Some prefer `"bump"`.
- **rangeStrategy**: By default (with zero config) it's `"replace"` but the `"config:recommended"` preset overrides it to `"auto"`. Some prefer `"bump"`.
- **labels**: Labels to assign to Pull Requests
- **assignees**: GitHub user(s) to assign the Pull Requests to

Expand Down
2 changes: 1 addition & 1 deletion docs/usage/getting-started/use-cases.md
Expand Up @@ -213,7 +213,7 @@ This also means that you might want a similar config for all of your repositorie
You can use configuration "presets" to avoid duplicating your configuration across your repositories.

Configuration presets are JSON configuration files which are committed to repositories and then referenced from others.
Renovate includes over 100 built-in presets, like the default recommended `config:base` preset.
Renovate includes over 100 built-in presets, like the default recommended `config:recommended` preset.

The typical workflow for a company is:

Expand Down
4 changes: 2 additions & 2 deletions docs/usage/java.md
Expand Up @@ -10,14 +10,14 @@ This includes libraries and plugins as well as the Gradle Wrapper.

## LTS releases

The `config:base` preset includes the `workarounds:javaLTSVersions` preset.
The `config:recommended` preset includes the `workarounds:javaLTSVersions` preset.
The workaround limits Renovate to upgrade to LTS versions of the Java runtime only.

If you want Renovate to offer all `major` Java updates then add `workarounds:javaLTSVersions` to the `ignorePreset` array:

```json
{
"extends": ["config:base"],
"extends": ["config:recommended"],
"ignorePresets": ["workarounds:javaLTSVersions"]
}
```
Expand Down
6 changes: 3 additions & 3 deletions docs/usage/key-concepts/dashboard.md
Expand Up @@ -23,7 +23,7 @@ To turn on the Dashboard manually, add the `:dependencyDashboard` preset to your

```json
{
"extends": ["config:base", ":dependencyDashboard"]
"extends": ["config:recommended", ":dependencyDashboard"]
}
```

Expand All @@ -41,7 +41,7 @@ To disable the Dependency Dashboard, add the preset `:disableDependencyDashboard

```json
{
"extends": ["config:base", ":disableDependencyDashboard"]
"extends": ["config:recommended", ":disableDependencyDashboard"]
}
```

Expand Down Expand Up @@ -86,7 +86,7 @@ To require manual approval for _all updates_, add the `:dependencyDashboardAppro

```json
{
"extends": ["config:base", ":dependencyDashboardApproval"]
"extends": ["config:recommended", ":dependencyDashboardApproval"]
}
```

Expand Down
6 changes: 3 additions & 3 deletions docs/usage/key-concepts/presets.md
Expand Up @@ -18,17 +18,17 @@ Use presets to:

## How to use presets

Let's say you're using the `config:base` preset, and want to pin your GitHub Action digests.
Let's say you're using the `config:recommended` preset, and want to pin your GitHub Action digests.
Instead of writing your own Renovate config, you search through Renovate's built-in presets.
You find the the `helpers:pinGitHubActionDigests` preset and add it to the `extends` array:

```json
{
"extends": ["config:base", "helpers:pinGitHubActionDigests"]
"extends": ["config:recommended", "helpers:pinGitHubActionDigests"]
}
```

Renovate now follows the rules for `config:base` plus the rules for `helpers:pinGitHubActionDigests`.
Renovate now follows the rules for `config:recommended` plus the rules for `helpers:pinGitHubActionDigests`.
If there is a logical conflict between presets, then the last preset in the array wins.

## Managing config for many repositories
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/modules/manager/index.md
Expand Up @@ -52,7 +52,7 @@ Renovate will _extend_ the existing [`fileMatch`](/configuration-options/#filema
In other words, the regular expression are "additive".
If a manager matches a file that you _don't_ want it to, ignore it using the [`ignorePaths`](/configuration-options/#ignorepaths) configuration option.
Also, if you ever find that Renovate is _not_ matching a file name that you're certain it should, check your preset config isn't the cause of it.
The `config:base` preset ignores common test and example directory names, for example.
The `config:recommended` preset ignores common test and example directory names, for example.

### Enabling and disabling managers

Expand Down
4 changes: 2 additions & 2 deletions docs/usage/reading-list.md
Expand Up @@ -22,8 +22,8 @@ If you're self-hosting or need to update private packages, complete the relevant
If you're new to Renovate, you should:

- Use the Mend-hosted GitHub App, or let somebody else host Renovate for you
- Stick with the `config:base` preset
- Use the Dependency Dashboard (`config:base` enables it automatically)
- Stick with the `config:recommended` preset
- Use the Dependency Dashboard (`config:recommended` enables it automatically)
- Read the pages in the "Beginners" list
- Only create custom Renovate configuration when really needed

Expand Down
2 changes: 1 addition & 1 deletion docs/usage/semantic-commits.md
Expand Up @@ -16,7 +16,7 @@ When Renovate finds Angular-style commits, Renovate creates commit messages and

By default, Renovate uses the `chore` prefix.

If you extend from `config:base` then Renovate:
If you extend from `config:recommended` then Renovate:

- still defaults to the `chore` prefix
- uses the `fix` prefix for npm production dependencies
Expand Down
7 changes: 4 additions & 3 deletions lib/config/presets/common.ts
Expand Up @@ -3,7 +3,7 @@ export const removedPresets: Record<string, string | null> = {
':autodetectRangeStrategy': null,
':automergeBranchMergeCommit': ':automergeBranch',
':automergeBranchPush': ':automergeBranch',
':base': 'config:base',
':base': 'config:recommended',
':app': 'config:js-app',
':enableGradleLite': null,
':js-app': 'config:js-app',
Expand All @@ -14,11 +14,12 @@ export const removedPresets: Record<string, string | null> = {
':unpublishSafe': 'npm:unpublishSafe',
'compatibility:additionalBranchPrefix': null,
'config:application': 'config:js-app',
'config:base-js': 'config:base',
'config:base': 'config:recommended',
'config:base-js': 'config:recommended',
'config:library': 'config:js-lib',
'default:automergeBranchMergeCommit': ':automergeBranch',
'default:automergeBranchPush': ':automergeBranch',
'default:base': 'config:base',
'default:base': 'config:recommended',
'default:app': 'config:js-app',
'default:js-app': 'config:js-app',
'default:library': 'config:js-lib',
Expand Down
8 changes: 4 additions & 4 deletions lib/config/presets/index.spec.ts
Expand Up @@ -144,7 +144,7 @@ describe('config/presets/index', () => {

it('throws noconfig', async () => {
config.foo = 1;
config.extends = ['noconfig:base'];
config.extends = ['noconfig:recommended'];
let e: Error | undefined;
try {
await presets.resolveConfigPresets(config);
Expand All @@ -154,7 +154,7 @@ describe('config/presets/index', () => {
expect(e).toBeDefined();
expect(e!.validationSource).toBeUndefined();
expect(e!.validationError).toBe(
'Preset package is missing a renovate-config entry (noconfig:base)'
'Preset package is missing a renovate-config entry (noconfig:recommended)'
);
expect(e!.validationMessage).toBeUndefined();
});
Expand Down Expand Up @@ -270,9 +270,9 @@ describe('config/presets/index', () => {
});

it('ignores presets', async () => {
config.extends = ['config:base'];
config.extends = ['config:recommended'];
const res = await presets.resolveConfigPresets(config, {}, [
'config:base',
'config:recommended',
]);
expect(config).toMatchObject(res);
expect(res).toBeEmptyObject();
Expand Down
29 changes: 15 additions & 14 deletions lib/config/presets/internal/config.ts
Expand Up @@ -3,18 +3,6 @@ import type { Preset } from '../types';
/* eslint sort-keys: ["error", "asc", {caseSensitive: false, natural: true}] */

export const presets: Record<string, Preset> = {
base: {
description: 'Default base configuration for all languages.',
extends: [
':dependencyDashboard',
':semanticPrefixFixDepsChoreOthers',
':ignoreModulesAndTests',
'group:monorepos',
'group:recommended',
'replacements:all',
'workarounds:all',
],
},
'best-practices': {
configMigration: true,
description: 'Preset with best practices from the Renovate maintainers.',
Expand All @@ -27,11 +15,24 @@ export const presets: Record<string, Preset> = {
},
'js-app': {
description: 'Default configuration for webapps.',
extends: ['config:base', ':pinAllExceptPeerDependencies'],
extends: ['config:recommended', ':pinAllExceptPeerDependencies'],
},
'js-lib': {
description: 'Default configuration for libraries.',
extends: ['config:base', ':pinOnlyDevDependencies'],
extends: ['config:recommended', ':pinOnlyDevDependencies'],
},
recommended: {
description:
'Recommended configuration for most users. It does not matter what programming language you use.',
extends: [
':dependencyDashboard',
':semanticPrefixFixDepsChoreOthers',
':ignoreModulesAndTests',
'group:monorepos',
'group:recommended',
'replacements:all',
'workarounds:all',
],
},
semverAllMonthly: {
description:
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/platform/codecommit/index.md
Expand Up @@ -157,7 +157,7 @@ env:
variables:
RENOVATE_PLATFORM: 'codecommit'
RENOVATE_REPOSITORIES: '["repoName1", "repoName2"]'
RENOVATE_CONFIG: '{"extends":["config:base"]}'
RENOVATE_CONFIG: '{"extends":["config:recommended"]}'
LOG_LEVEL: 'debug'
AWS_REGION: 'us-east-1'
phases:
Expand All @@ -177,7 +177,7 @@ env:
variables:
RENOVATE_PLATFORM: 'codecommit'
RENOVATE_REPOSITORIES: '["repoName1", "repoName2"]'
RENOVATE_CONFIG: '{"extends":["config:base"]}'
RENOVATE_CONFIG: '{"extends":["config:recommended"]}'
LOG_LEVEL: 'debug'
AWS_REGION: 'us-east-1'
phases:
Expand Down
6 changes: 3 additions & 3 deletions lib/modules/platform/gitea/index.md
Expand Up @@ -24,9 +24,9 @@ If you use Gitea packages, add the `read:packages` scope.

## Unsupported platform features/concepts

- **Adding reviewers to PRs not supported**: Gitea versions older than `v1.14.0` lack the required API
- **`platformAutomerge` (on by default) for PRs not supported**: Gitea versions older than `v1.17.0` lack the required API
- **Git upload filters**: If you're using a Gitea version older than `v1.16.0` then you must enable [clone filters](https://docs.gitea.io/en-us/clone-filters/)
- **Adding reviewers to PRs not supported**: Gitea versions older than `v1.14.0` do not have the required API.
- **`platformAutomerge` (`true` by default) for platform-native automerge not supported**: Gitea versions older than v1.17.0 do not have the required API.
- **Git upload filters**: If you're using a Gitea version older than `v1.16.0` then you must enable [clone filters](https://docs.gitea.io/en-us/clone-filters/).

## Features awaiting implementation

Expand Down
4 changes: 2 additions & 2 deletions lib/workers/global/config/parse/cli.spec.ts
Expand Up @@ -156,10 +156,10 @@ describe('workers/global/config/parse/cli', () => {
});

it('parses json object correctly', () => {
argv.push(`--onboarding-config={"extends": ["config:base"]}`);
argv.push(`--onboarding-config={"extends": ["config:recommended"]}`);
expect(cli.getConfig(argv)).toEqual({
onboardingConfig: {
extends: ['config:base'],
extends: ['config:recommended'],
},
});
});
Expand Down

0 comments on commit f9e3e80

Please sign in to comment.