From 3bd509ec3d2bef5815365d36fbcbc1d0f584a77f Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Tue, 4 Apr 2023 13:48:00 +0200 Subject: [PATCH 1/2] feat(automerge)!: default to platformAutomerge=true Closes #21319 BREAKING CHANGE: Platform automerge is now used by default when PR automerge is configured --- docs/usage/configuration-options.md | 10 +++++----- docs/usage/key-concepts/automerge.md | 12 +++++------- lib/config/options/index.ts | 2 +- lib/modules/platform/gitea/index.md | 2 +- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index ea790acc370d63..c862c01675a422 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2332,28 +2332,28 @@ If enabled Renovate will pin Docker images or GitHub Actions by means of their S ## platformAutomerge -!!! warning - Before you enable `platformAutomerge` you should enable your Git hosting platform's capabilities to enforce test passing before PR merge. +!!! note + If you use the default `platformAutomerge=true` then you should enable your Git hosting platform's capabilities to enforce test passing before PR merge. If you don't do this, the platform might merge Renovate PRs even if the repository's tests haven't started, are in still in progress, or possibly even when they have failed. On GitHub this is called "Require status checks before merging", which you can find in the "Branch protection rules" section of the settings for your repository. [GitHub docs, about protected branches](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches) [GitHub docs, require status checks before merging](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches#require-status-checks-before-merging) If you're using another platform, search their documentation for a similar feature. -If you have enabled `automerge` and set `automergeType=pr` in the Renovate config, then you can also set `platformAutomerge` to `true` to speed up merging via the platform's native automerge functionality. +If you have enabled `automerge` and set `automergeType=pr` in the Renovate config, then leaving `platformAutomerge` as `true` speeds up merging via the platform's native automerge functionality. Renovate tries platform-native automerge only when it initially creates the PR. Any PR that is being updated will be automerged with the Renovate-based automerge. `platformAutomerge` will configure PRs to be merged after all (if any) branch policies have been met. -This option is available for Azure, GitHub and GitLab. +This option is available for Azure, Gitea, GitHub and GitLab. It falls back to Renovate-based automerge if the platform-native automerge is not available. You can also fine-tune the behavior by setting `packageRules` if you want to use it selectively (e.g. per-package). Note that the outcome of `rebaseWhen=auto` can differ when `platformAutomerge=true`. Normally when you set `rebaseWhen=auto` Renovate rebases any branch that's behind the base branch automatically, and some people rely on that. -This behavior is no longer guaranteed when you enable `platformAutomerge` because the platform might automerge a branch which is not up-to-date. +This behavior is no longer guaranteed when `platformAutomerge` is true because the platform might automerge a branch which is not up-to-date. For example, GitHub might automerge a Renovate branch even if it's behind the base branch at the time. Please check platform specific docs for version requirements. diff --git a/docs/usage/key-concepts/automerge.md b/docs/usage/key-concepts/automerge.md index 4df1b7f68c178b..2758472bfb8c6e 100644 --- a/docs/usage/key-concepts/automerge.md +++ b/docs/usage/key-concepts/automerge.md @@ -100,9 +100,8 @@ Say you want to automerge `patch` and `minor` updates for packages in the `group ### Faster merges with platform-native automerge -You can speed up merges by letting Renovate use your platform's native automerge. -The config option is called `platformAutomerge`. -If `automerge=true` and `automergeType=pr` then you can set `platformAutomerge=true`. +Renovate by default uses platform-native automerge to speed up automerging. +The config option is called `platformAutomerge` and can be disabled if it's not desired. For example: @@ -112,7 +111,7 @@ For example: "enabled": true, "automerge": true, "automergeType": "pr", - "platformAutomerge": true + "platformAutomerge": false } } ``` @@ -155,11 +154,10 @@ On `github.com`, go to your repository's "homepage", click on Settings, scroll d Then go to your repository's branch protection rules for your base branch (usually `main`) and enable the "Require merge queue" setting. Confirm you've set the correct "required checks" for your base branch. -Finally, allow Renovate to automerge by setting `automerge=true` and `platformAutomerge=true` in your Renovate config file, for example: +Finally, allow Renovate to automerge by setting `automerge=true` in your Renovate config file, for example: ```json { - "platformAutomerge": true, "packageRules": [ { "description": "Automerge non-major updates", @@ -180,7 +178,7 @@ On `github.com`, go to your repository's "homepage", click on Settings, scroll d Go to your repository's branch protection rules for your base branch (usually `main`) and enable the "Require merge queue" setting. Confirm you've set the correct "required checks" for your base branch. -Finally, allow Renovate to automerge by setting `automerge=true` and `platformAutomerge=true` in your Renovate config file (see earlier example). +Finally, allow Renovate to automerge by setting `automerge=true` in your Renovate config file (see earlier example). ## Automerging and scheduling diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index faa0653fd50761..ae69348293953e 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -2563,7 +2563,7 @@ const options: RenovateOptions[] = [ description: `Controls if platform-native auto-merge is used.`, type: 'boolean', supportedPlatforms: ['azure', 'gitea', 'github', 'gitlab'], - default: false, + default: true, }, { name: 'userStrings', diff --git a/lib/modules/platform/gitea/index.md b/lib/modules/platform/gitea/index.md index 098fb39be1f9fc..2b97ae097aeeea 100644 --- a/lib/modules/platform/gitea/index.md +++ b/lib/modules/platform/gitea/index.md @@ -18,7 +18,7 @@ Either the account should have full name and email address set to allow Renovate ## Unsupported platform features/concepts - **Adding reviewers to PRs not supported**: Gitea versions older than `v1.14.0` do not have the required API. -- **Setting `platformAutomerge` to use platform-native automerge for PRs not supported**: Gitea versions older than v1.17.0 do not have the required API. +- **`platformAutomerge` (default=true) 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 From a2c7aab9f4af1630ece5eb363fbfa2909c167e49 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Wed, 5 Apr 2023 09:16:25 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> --- docs/usage/configuration-options.md | 2 +- docs/usage/key-concepts/automerge.md | 4 ++-- lib/modules/platform/gitea/index.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index c862c01675a422..ab8aab4e848e94 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2353,7 +2353,7 @@ You can also fine-tune the behavior by setting `packageRules` if you want to use Note that the outcome of `rebaseWhen=auto` can differ when `platformAutomerge=true`. Normally when you set `rebaseWhen=auto` Renovate rebases any branch that's behind the base branch automatically, and some people rely on that. -This behavior is no longer guaranteed when `platformAutomerge` is true because the platform might automerge a branch which is not up-to-date. +This behavior is no longer guaranteed when `platformAutomerge` is `true` because the platform might automerge a branch which is not up-to-date. For example, GitHub might automerge a Renovate branch even if it's behind the base branch at the time. Please check platform specific docs for version requirements. diff --git a/docs/usage/key-concepts/automerge.md b/docs/usage/key-concepts/automerge.md index 2758472bfb8c6e..20a20649dbdc9d 100644 --- a/docs/usage/key-concepts/automerge.md +++ b/docs/usage/key-concepts/automerge.md @@ -100,8 +100,8 @@ Say you want to automerge `patch` and `minor` updates for packages in the `group ### Faster merges with platform-native automerge -Renovate by default uses platform-native automerge to speed up automerging. -The config option is called `platformAutomerge` and can be disabled if it's not desired. +By default, Renovate uses platform-native automerge to speed up automerging. +If you don't want Renovate to use the platform-native automerge, then set `platformAutomerge` to `false`. For example: diff --git a/lib/modules/platform/gitea/index.md b/lib/modules/platform/gitea/index.md index 2b97ae097aeeea..1f68d933542c5e 100644 --- a/lib/modules/platform/gitea/index.md +++ b/lib/modules/platform/gitea/index.md @@ -18,7 +18,7 @@ Either the account should have full name and email address set to allow Renovate ## Unsupported platform features/concepts - **Adding reviewers to PRs not supported**: Gitea versions older than `v1.14.0` do not have the required API. -- **`platformAutomerge` (default=true) for platform-native automerge not supported**: Gitea versions older than v1.17.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