Skip to content

Commit

Permalink
feat(automerge)!: default to platformAutomerge=true (#21327)
Browse files Browse the repository at this point in the history
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
  • Loading branch information
rarkins and HonkingGoose committed Apr 5, 2023
1 parent d11731c commit b31a389
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
10 changes: 5 additions & 5 deletions docs/usage/configuration-options.md
Expand Up @@ -2332,28 +2332,28 @@ If enabled Renovate will pin Docker images or GitHub Actions by means of their S
## platformAutomerge

<!-- prettier-ignore -->
!!! 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.
Expand Down
12 changes: 5 additions & 7 deletions docs/usage/key-concepts/automerge.md
Expand Up @@ -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`.
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:

Expand All @@ -112,7 +111,7 @@ For example:
"enabled": true,
"automerge": true,
"automergeType": "pr",
"platformAutomerge": true
"platformAutomerge": false
}
}
```
Expand Down Expand Up @@ -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",
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/config/options/index.ts
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/platform/gitea/index.md
Expand Up @@ -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` (`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

0 comments on commit b31a389

Please sign in to comment.