0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-11-05 08:37:05 +00:00
renovatebot_renovate/docs/usage/modules/versioning/index.md
Rhys Arkins 879f7cc212 feat(packageRules): migrate matchers and excludes (#28602)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-07-25 15:28:16 +02:00

2.4 KiB

title
Versioning

Versioning

Once Managers have extracted dependencies, and Datasources have located available versions, then Renovate will use a "Versioning" scheme to perform sorting and filtering of results. The "versioning" is different for each package manager, because different package managers use different versioning schemes. For example, npm uses 1.0.0-beta.1 while pip uses 1.0.0b1.

Why you might need to manually configure versioning

Renovate interprets versions correctly out-of-the-box most of the time. But Renovate can't automatically detect all versioning schemes. So sometimes you need to tell the bot what versioning scheme it should use.

You can manually configure or override the versioning value for a particular dependency. You generally won't need to override the defaults for ecosystems which enforce a strict version scheme like npm.

Configuring or overriding the default versioning can be extra helpful for ecosystems like Docker, Kubernetes or Helm, where versioning is barely a "convention".

General concepts behind overriding versioning

  • Although you can reconfigure versioning per-manager or per-datasource, you probably don't need such a broad change
  • More commonly you would need to configure versioning for individual packages or potentially package patterns
  • The best way to do this is with packageRules, with a combination of matchManagers, matchDatasources, and matchPackageNames. Avoid configuring versioning in a rule that also uses matchUpdateTypes, as the update types aren't known at the time the versioning is applied

Examples of versioning overrides

Overriding Docker versioning to use a versioning specific for a package

The configuration below overrides Renovate's default docker versioning for the python Docker image and instead uses the pep440 versioning scheme to evaluate versions.

{
  "packageRules": [
    {
      "matchDatasources": ["docker"],
      "matchPackageNames": ["python"],
      "versioning": "pep440"
    }
  ]
}

Using a custom regex versioning scheme

{
  "packageRules": [
    {
      "matchPackageNames": ["foo/bar"],
      "versioning": "regex:^(?<compatibility>.*)-v?(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)?$"
    }
  ]
}

Supported Versioning