Skip to content

Commit

Permalink
fix(packageRules): prPriority should only be in packageRules (#29201)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed May 22, 2024
1 parent 56856d4 commit 70f1f93
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 33 deletions.
66 changes: 33 additions & 33 deletions docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -3215,6 +3215,39 @@ For example to replace the npm package `jade` with version `2.0.0` of the packag
}
```

### prPriority

Sometimes Renovate needs to rate limit its creation of PRs, e.g. hourly or concurrent PR limits.
By default, Renovate sorts/prioritizes based on the update type, going from smallest update to biggest update.
Renovate creates update PRs in this order:

1. `pinDigest`
1. `pin`
1. `digest`
1. `patch`
1. `minor`
1. `major`

If you have dependencies that are more or less important than others then you can use the `prPriority` field for PR sorting.
The default value is 0, so setting a negative value will make dependencies sort last, while higher values sort first.

Here's an example of how you would define PR priority so that `devDependencies` are raised last and `react` is raised first:

```json
{
"packageRules": [
{
"matchDepTypes": ["devDependencies"],
"prPriority": -1
},
{
"matchPackageNames": ["react"],
"prPriority": 5
}
]
}
```

## patch

Add to this object if you wish to define rules that apply only to patch updates.
Expand Down Expand Up @@ -3499,39 +3532,6 @@ This is why we configured an upper limit for how long we wait until creating a P
!!! note
If the option `minimumReleaseAge` is non-zero then Renovate disables the `prNotPendingHours` functionality.

## prPriority

Sometimes Renovate needs to rate limit its creation of PRs, e.g. hourly or concurrent PR limits.
By default, Renovate sorts/prioritizes based on the update type, going from smallest update to biggest update.
Renovate creates update PRs in this order:

1. `pinDigest`
1. `pin`
1. `digest`
1. `patch`
1. `minor`
1. `major`

If you have dependencies that are more or less important than others then you can use the `prPriority` field for PR sorting.
The default value is 0, so setting a negative value will make dependencies sort last, while higher values sort first.

Here's an example of how you would define PR priority so that `devDependencies` are raised last and `react` is raised first:

```json
{
"packageRules": [
{
"matchDepTypes": ["devDependencies"],
"prPriority": -1
},
{
"matchPackageNames": ["react"],
"prPriority": 5
}
]
}
```

## prTitle

The PR title is important for some of Renovate's matching algorithms (e.g. determining whether to recreate a PR or not) so ideally don't modify it much.
Expand Down
1 change: 1 addition & 0 deletions lib/config/options/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2040,6 +2040,7 @@ const options: RenovateOptions[] = [
'Set sorting priority for PR creation. PRs with higher priority are created first, negative priority last.',
type: 'integer',
default: 0,
parents: ['packageRules'],
cli: false,
env: false,
},
Expand Down

0 comments on commit 70f1f93

Please sign in to comment.