Repository navigation
Support updating version-specific info inside compatibility suffixes #24849
Replies: 4 comments 1 reply
|
I haven't seen any conversation on this suggestion, but I wanted to give it a +1 👍🏽 The NodeJS example is very relevant for my company. Lemme talk out an example; Renovate might find three potential upgrades:
I suppose, based on settings, we would expect to see either |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
|
I would like to see this feature for Debian release names, too, for example in container image versions I tried to use a packagesRule with replacements and the "packageRules": [
{
"matchDatasources": [
"docker"
],
"matchCurrentValue": "/-?bullseye-?/",
"replacementVersion": "{{{replace 'bullseye' 'bookworm' currentValue}}}"
}
]But if you have a specific image version it does work for, for example this is a configuration is used for a Golang image: {
matchDatasources: [
"docker"
],
matchDepNames: [
"golang",
"library/golang",
"docker.io/library/golang",
"public.ecr.aws/docker/library/golang"
],
matchCurrentValue: "1.22.4-bullseye",
replacementVersion: "1.22.4-bookworm"
}In some places I used custom.regex managers to update Debian release names and Alpine versions in container tags but it would be much nicer if I could use packageRules instead to avoid duplicating and then maintaining the "customManagers": [
{
"description": "Update Debian version codenames in container image tags, for example 'buster' in 'node:20.10.0-buster'.",
"customType": "regex",
"fileMatch": [
"(^|/|\\.)([Dd]ocker|[Cc]ontainer)file$",
"(^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$",
"\\.ya?ml$"
],
"matchStrings": [
"(?:^|[ \"'])(?<depName>[\\w/.:-]+?):[\\w.-]+?-(?<currentValue>[a-z]+)(?:-slim)?(?:@(?<currentDigest>sha256:[0-9a-f]{64}))?(?:$|[ \"'])"
],
"datasourceTemplate": "docker",
"versioningTemplate": "debian"
},
{
"description": "Update the Alpine version in container image tags. For example, update php:8.2.24-fpm-alpine3.19 to php:8.2.24-fpm-alpine3.20.",
"customType": "regex",
"fileMatch": [
"(^|/|\\.)([Dd]ocker|[Cc]ontainer)file$",
"(^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$",
".*\\.ya?ml$"
],
"matchStrings": [
"(?:FROM|image:)[ ]+[\"']?(?<depName>[^@\"'\\s]+):(?<currentValue>[^:@\"'\\s]*alpine\\d+\\.\\d+[^:@\"'\\s]*)(?:@(?<currentDigest>sha256:[0-9a-f]+))?[\"']?\\s"
],
"versioningTemplate": "regex:^(?<compatibility>.*alpine)(?<major>\\d+)\\.(?<minor>\\d+).*$",
"datasourceTemplate": "docker"
}
]For Alpine I also used this package rule as a workaround, where the Alpine major and minor versions are treated as build and revision version: {
"description": "Update Alpine version in container image tags like 'docker.io/library/node:21.6.1-alpine3.18'.",
"matchDatasources": [
"docker"
],
"matchCurrentValue": "/^(?:(?<major>\\d+)(?:\\.(?<minor>\\d+)(?:\\.(?<patch>\\d+))?)?-)?alpine(?<build>\\d+)(?:\\.(?<revision>\\d+))?$/",
"versioning": "regex:^(?:(?<major>\\d+)(?:\\.(?<minor>\\d+)(?:\\.(?<patch>\\d+))?)?-)?alpine(?<build>\\d+)(?:\\.(?<revision>\\d+))?$"
}, |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What would you like Renovate to be able to do?
Renovate should be able to analyze version-specific info (major, minor, patch) within the
compatibilitysection of the version of a dependency.In Docker tags, it is common for the
compatibilitypart of the tag to include version info (i.e.-alpine3.14). Without this capability,Dockerfiletags that include version info in thecompatibilitysection, where that same compatibility tag no longer exists in newer versions (e.x.img1.2-alpine3.14toimg1.3-alpine3.15, whereimg1.3-alpine3.14never exists), will never see version updates proposed by Renovate.Practical example: Node.js images (see current tags here). It would be great to get proposed updates from any of
17-alpine3.14,17.3-alpine3.14,17.3.1-alpine3.14to17-alpine3.15,17.3-alpine3.15,17.3.1-alpine3.15respectively. You could use-alpinetags alone, but you lose precision into the underlying Alpine version and increase the risk of consuming breaking changes without knowing.See the Docker Version compatibility docs for more info on how this works today. Regex versioning is also related.
I split this out as a separate request from #5990 (comment) to be discussed on its own. I'm not sure if this is more relevant to managers or to versioning support (probably the latter?).
If you have any ideas on how this should be implemented, please tell us here.
Introduce a concept of
compatibilityVersioning, where thecompatibilitysection of the version is parsed for version info. The matching logic could be similar to the general regex matching logic but applied within thecompatibilitysection, so something like^(?<compatibility>.[A-Za-z] )(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)?$.This would complicate how Renovate looks for updated dependency versions, increasing the number of tags it would need to check. Example: Renovate would need to check combinations of 1) same version info except
compatibilityversion update 2) update to version info except samecompatibilityversion, and 3) both update to version info andcompatibilityversion.It may also be difficult to parse version info out of
compatibility(there may be examples where numeric characters are used as part of thecompatibilitytag and do not represent version info). Consumers may also want to separate regular version updates fromcompatibilityversion updates when applicable, adding additional config and support requirements (similar toseparateMinorPatch).Perhaps a preferred order could be considered here to make the proposed updates more deterministic. Ex: Renovate could look for updates to both version and compatibility, version alone, and then compatibility alone.
Some alternatives or workarounds that may be suitable
compatibility(i.e.-alpineover-alpine3.14) in combination with digest pinning. This would help prevent consuming breaking changes from compatibility updates in the less specific tag. It still reduces visibility into the underlying Alpine version being used.compatibilityversion info will no longer receive updates. This would depend on Docker support in replacements being completed in Replacing deprecated dependencies for docker datasource only replace version #12623 first. It's also a manual process for each image, making it less than ideal and a large burden to maintain for many images.Is this a feature you are interested in implementing yourself?
Maybe
All reactions