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

refactor!: rename renovate/stability-days check to renovate/minimum-release-age #22704

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1169d19
feat!: allow post upgrade templating by default (#21326)
rarkins Apr 5, 2023
a9f5219
feat(automerge)!: default to platformAutomerge=true (#21327)
rarkins Apr 5, 2023
c1b63f6
feat(platform/gitlab)!: prefer `commit_email` (#21122
viceice Apr 26, 2023
ca7357f
fix(post-upgrade-tasks)!: enable dot option for file filters (#21282)
bgutschke Apr 26, 2023
bbc72d9
feat(npm)!: disable rollbackPrs for npm by default (#21970)
rarkins May 5, 2023
3f432a4
fix(presets)!: remove compatibility:additionalBranchPrefix (#22015)
rarkins May 7, 2023
6e95ba7
feat(package-rules)!: remove fuzzy matchPaths matching (#22394)
rarkins May 24, 2023
107e2bc
feat!: merge matchPaths and matchFiles into matchFileNames (#22406)
rarkins May 25, 2023
fa90bf3
refactor!: rename renovate/stability-days check to renovate/minimum-r…
rarkins Jun 12, 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
223cdf1
Merge branch 'v36' into feat/21442-stability-days-check
rarkins Jun 12, 2023
ad78373
Update lib/workers/repository/update/branch/status-checks.ts
rarkins Jun 12, 2023
8113e29
fix lint
rarkins Jun 12, 2023
dfcca82
fix test
rarkins Jun 12, 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
104 changes: 47 additions & 57 deletions docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ If you are more interested in including only certain package managers (e.g. `npm

Copy link
Collaborator

Choose a reason for hiding this comment

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

renovate-stabilitydays-in-pr-checks

I don't know if renaming the app/check-thing from renovate/stability-days to renovate/minimum-release-age is something you want to do. Renaming that is a breaking change, because users will need to update their "required tests before allowing merge" in their platform settings.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, it's in a major release, however app users won't have a choice. We could set both for a while, but that probably doesn't help things

Copy link
Collaborator

@HonkingGoose HonkingGoose Jun 12, 2023

Choose a reason for hiding this comment

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

Having both names is probably more confusing than a breaking rename to renovate/minimum-release-age. But in the short term having both is probably needed for users to switch without breakage to the new check.

How about something like this?

  1. Create the new check renovate/minimum-release-age
  2. Create a notice about "Switch to renovate/minimum-release-age check" in:
    • a pinned Issue
    • a pinned Discussion
    • our docs announcement bar
  3. After enough time remove the old renovate/stability-days check

Optional: use GitHub's brownout strategy, they sometimes break a feature intentionally, and put a comment in the log, so people go looking why things changed. That way they nudge users into updating before the feature is fully removed by GitHub.

## internalChecksAsSuccess

By default, internal Renovate checks such as `renovate/stability-days` are not counted towards a branch being "green" or not.
By default, internal Renovate checks such as `renovate/minimum-release-age` are not counted towards a branch being "green" or not.
This is primarily to prevent automerge when the only check is a passing Renovate check.

Internal checks will always be counted/considered if they are in pending or failed states.
Expand Down Expand Up @@ -1730,7 +1730,7 @@ Maven users: you cannot use `minimumReleaseAge` if a Maven source returns unreli

<!-- prettier-ignore -->
!!! note
Configuring this option will add a `renovate/stability-days` option to the status checks.
Configuring this option will add a `renovate/minimum-release-age` option to the status checks.

There are a couple of uses for `minimumReleaseAge`:

Expand Down Expand Up @@ -1760,7 +1760,7 @@ Set `minimumReleaseAge` to `3 days` for npm packages to prevent relying on a pac
#### Await X time duration before Automerging

If you enabled `automerge` _and_ `minimumReleaseAge`, it means that PRs will be created immediately but automerging will be delayed until the time-duration has passed.
This works because Renovate will add a "renovate/stability-days" pending status check to each branch/PR and that pending check will prevent the branch going green to automerge.
This works because Renovate will add a "renovate/minimum-release-age" pending status check to each branch/PR and that pending check will prevent the branch going green to automerge.

<!-- markdownlint-enable MD001 -->

Expand Down Expand Up @@ -1863,28 +1863,28 @@ Example:

The above rule will group together the `neutrino` package and any package matching `@neutrino/*`.

Path rules are convenient to use if you wish to apply configuration rules to certain package files using patterns.
File name matches are convenient to use if you wish to apply configuration rules to certain package or lock files using patterns.
For example, if you have an `examples` directory and you want all updates to those examples to use the `chore` prefix instead of `fix`, then you could add this configuration:

```json
{
"packageRules": [
{
"matchPaths": ["examples/**"],
"matchFileNames": ["examples/**"],
"extends": [":semanticCommitTypeAll(chore)"]
}
]
}
```

If you wish to limit Renovate to apply configuration rules to certain files in the root repository directory, you have to use `matchPaths` with a `minimatch` pattern or use [`matchFiles`](#matchfiles) with an exact match.
If you wish to limit Renovate to apply configuration rules to certain files in the root repository directory, you have to use `matchFileNames` with a `minimatch` pattern (which can include an exact file name match).
For example you have multiple `package.json` and want to use `dependencyDashboardApproval` only on the root `package.json`:

```json
{
"packageRules": [
{
"matchFiles": ["package.json"],
"matchFileNames": ["package.json"],
"dependencyDashboardApproval": true
}
]
Expand Down Expand Up @@ -2179,23 +2179,50 @@ Use the syntax `!/ /` like this:
}
```

### matchFiles
### matchFileNames

Renovate will compare `matchFiles` for an exact match against the dependency's package file or lock file.
Renovate will compare `matchFileNames` glob matching against the dependency's package file or lock file.

For example the following would match `package.json` but not `package/frontend/package.json`:
The following example matches `package.json` but _not_ `package/frontend/package.json`:

```json
{
"packageRules": [
{
"matchFiles": ["package.json"]
"matchFileNames": ["package.json"],
"labels": ["npm"]
}
]
}
```

Use [`matchPaths`](#matchpaths) instead if you need more flexible matching.
The following example matches any `package.json`, including files like `backend/package.json`:

```json
{
"packageRules": [
{
"description": "Group dependencies from package.json files",
"matchFileNames": ["**/package.json"],
"groupName": "All package.json changes"
}
]
}
```

The following example matches any file in directories starting with `app/`:

```json
{
"packageRules": [
{
"description": "Group all dependencies from the app directory",
"matchFileNames": ["app/**"],
"groupName": "App dependencies"
}
]
}
```

### matchDepNames

Expand Down Expand Up @@ -2255,43 +2282,6 @@ See also `excludePackagePrefixes`.

Like the earlier `matchPackagePatterns` example, the above will configure `rangeStrategy` to `replace` for any package starting with `angular`.

### matchPaths

Renovate finds the file(s) listed in `matchPaths` with a `minimatch` glob pattern.

For example the following matches any `package.json`, including files like `backend/package.json`:

```json
{
"packageRules": [
{
"description": "Group dependencies from package.json files",
"matchPaths": ["**/package.json"],
"groupName": "All package.json changes"
}
]
}
```

The following matches any file in directories starting with `app/`:

```json
{
"packageRules": [
{
"description": "Group all dependencies from the app directory",
"matchPaths": ["app/**"],
"groupName": "App dependencies"
}
]
}
```

<!-- prettier-ignore -->
!!! warning
Partial matches for `matchPaths` are deprecated.
Please use a `minimatch` glob pattern or switch to [`matchFiles`](#matchfiles) if you need exact matching.

### matchSourceUrlPrefixes

Here's an example of where you use this to group together all packages from the `renovatebot` GitHub org:
Expand Down Expand Up @@ -2513,28 +2503,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 Expand Up @@ -2605,6 +2595,7 @@ You can use variable templating in your commands if [`allowPostUpgradeCommandTem
### fileFilters

A list of glob-style matchers that determine which files will be included in the final commit made by Renovate.
Dotfiles are included.

### executionMode

Expand Down Expand Up @@ -3267,9 +3258,8 @@ There are times when a dependency version in use by a project gets removed from
For some registries, existing releases or even whole packages can be removed or "yanked" at any time, while for some registries only very new or unused releases can be removed.
Renovate's "rollback" feature exists to propose a downgrade to the next-highest release if the current release is no longer found in the registry.

Renovate does not create these rollback PRs by default, with one exception: npm packages get a rollback PR if needed.

You can configure the `rollbackPrs` property globally, per-language, or per-package to override the default behavior.
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

Expand Down
12 changes: 5 additions & 7 deletions docs/usage/key-concepts/automerge.md
Original file line number Diff line number Diff line change
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
16 changes: 4 additions & 12 deletions docs/usage/self-hosted-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,17 @@ Please also see [Self-Hosted Experimental Options](./self-hosted-experimental.md

## allowPostUpgradeCommandTemplating

Set to `true` to allow templating of dependency level post-upgrade commands.

Let's look at an example of configuring packages with existing Angular migrations.

Add two properties to `config.js`: `allowPostUpgradeCommandTemplating` and `allowedPostUpgradeCommands`:

```javascript
module.exports = {
allowPostUpgradeCommandTemplating: true,
allowedPostUpgradeCommands: ['^npm ci --ignore-scripts$', '^npx ng update'],
};
```

In the `renovate.json` file, define the commands and files to be included in the final commit.

The command to install dependencies (`npm ci --ignore-scripts`) is needed because, by default, the installation of dependencies is skipped (see the `skipInstalls` global option).
The command to install dependencies (`npm ci --ignore-scripts`) is needed because, by default, the installation of dependencies is skipped.

```json
{
Expand All @@ -60,6 +55,9 @@ npm ci --ignore-scripts
npx ng update @angular/core --from=10.0.0 --to=11.0.0 --migrate-only --allow-dirty --force
```

If you wish to disable templating because of any security or performance concern, you may set `allowPostUpgradeCommandTemplating` to `false`.
But before you disable templating completely, try the `allowedPostUpgradeCommands` config option to limit what commands are allowed to run.

## allowScripts

## allowedPostUpgradeCommands
Expand Down Expand Up @@ -800,12 +798,6 @@ It could then be used in a repository config or preset like so:

Secret names must start with an upper or lower case character and can have only characters, digits, or underscores.

## skipInstalls

By default, Renovate will use the most efficient approach to updating package files and lock files, which in most cases skips the need to perform a full module install by the bot.
If this is set to false, then a full install of modules will be done.
This is currently applicable to `npm` and `lerna`/`npm` only, and only used in cases where bugs in `npm` result in incorrect lock files being updated.

## token

## unicodeEmoji
Expand Down
16 changes: 8 additions & 8 deletions lib/config/__snapshots__/migration.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates config 1`
"extends": [
"node",
],
"matchPaths": [
"matchFileNames": [
"node/**",
],
},
Expand Down Expand Up @@ -211,7 +211,7 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates config 1`
"extends": [
"foo",
],
"matchPaths": [
"matchFileNames": [
"examples/**",
],
},
Expand Down Expand Up @@ -293,7 +293,7 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates more pack
"matchDepTypes": [
"devDependencies",
],
"matchPaths": [
"matchFileNames": [
"package.json",
],
"rangeStrategy": "pin",
Expand All @@ -302,7 +302,7 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates more pack
"matchDepTypes": [
"dependencies",
],
"matchPaths": [
"matchFileNames": [
"package.json",
],
"rangeStrategy": "pin",
Expand Down Expand Up @@ -332,13 +332,13 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates packageFi
],
"packageRules": [
{
"matchPaths": [
"matchFileNames": [
"backend/package.json",
],
"rangeStrategy": "replace",
},
{
"matchPaths": [
"matchFileNames": [
"frontend/package.json",
],
"rangeStrategy": "pin",
Expand All @@ -347,7 +347,7 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates packageFi
"matchDepTypes": [
"devDependencies",
],
"matchPaths": [
"matchFileNames": [
"other/package.json",
],
"rangeStrategy": "pin",
Expand All @@ -356,7 +356,7 @@ exports[`config/migration migrateConfig(config, parentConfig) migrates packageFi
"matchDepTypes": [
"dependencies",
],
"matchPaths": [
"matchFileNames": [
"other/package.json",
],
"rangeStrategy": "pin",
Expand Down
1 change: 0 additions & 1 deletion lib/config/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ describe('config/index', () => {
const config = getManagerConfig(parentConfig, 'npm');
expect(config).toContainEntries([
['fileMatch', ['(^|/)package\\.json$']],
['rollbackPrs', true],
]);
expect(getManagerConfig(parentConfig, 'html')).toContainEntries([
['fileMatch', ['\\.html?$']],
Expand Down
Loading