Open rarkins opened 4 months ago
🤔 it's working fine for bitnami docker image updates which have 5 parts.
Maybe getSatisfyingVersion() wasn't ever called except when my changes triggered it
maybe. do you have a reproduction?
oh, I see. here are some versions no longer detected
so this is a critical bug
repro: https://github.com/renovate-reproductions/27510-multipart-regex-versioning
bitnami versioning works, but forgejo not 🤔
DEBUG: packageFiles with updates (repository=renovate-reproductions/27510-multipart-regex-versioning, baseBranch=main)
"config": {
"dockerfile": [
{
"deps": [
{
"depName": "codeberg.org/forgejo/forgejo",
"currentValue": "1.21.5-0-rootless",
"replaceString": "codeberg.org/forgejo/forgejo:1.21.5-0-rootless",
"autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}",
"datasource": "docker",
"depType": "stage",
"updates": [],
"packageName": "codeberg.org/forgejo/forgejo",
"versioning": "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-(?<build>\\d+)(?:-(?<compatibility>.+))?$",
"warnings": [],
"registryUrl": "https://codeberg.org",
"currentVersion": "1.21.5",
"skipReason": "invalid-version"
},
{
"depName": "codeberg.org/forgejo/forgejo",
"currentValue": "1.21.5-0-rootless",
"currentDigest": "sha256:f23f56a0a1f53fa9f3ffbbb19aad3afef180fad7f8d4250174363ecab80d5166",
"replaceString": "codeberg.org/forgejo/forgejo:1.21.5-0-rootless@sha256:f23f56a0a1f53fa9f3ffbbb19aad3afef180fad7f8d4250174363ecab80d5166",
"autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}",
"datasource": "docker",
"depType": "stage",
"updates": [],
"packageName": "codeberg.org/forgejo/forgejo",
"versioning": "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-(?<build>\\d+)(?:-(?<compatibility>.+))?$",
"warnings": [],
"registryUrl": "https://codeberg.org",
"currentVersion": "1.21.5",
"skipReason": "invalid-version"
},
{
"depName": "bitnami/nginx",
"currentValue": "1.24.0-debian-12-r15",
"replaceString": "bitnami/nginx:1.24.0-debian-12-r15",
"autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}",
"datasource": "docker",
"depType": "stage",
"updates": [
{
"bucket": "non-major",
"newVersion": "1.25.4-debian-12-r2",
"newValue": "1.25.4-debian-12-r2",
"newMajor": 1,
"newMinor": 25,
"updateType": "minor",
"branchName": "renovate-test/bitnami-nginx-1.x"
}
],
"packageName": "bitnami/nginx",
"versioning": "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)(:?-(?<compatibility>.+)-(?<build>\\d+)(?:-r(?<revision>\\d+))?)?$",
"warnings": [],
"registryUrl": "https://index.docker.io",
"currentVersion": "1.24.0",
"isSingleVersion": true,
"fixedVersion": "1.24.0-debian-12-r15"
},
{
"depName": "bitnami/nginx",
"currentValue": "1.24.0-debian-12-r15",
"currentDigest": "sha256:a842d93d1903fab7b7cf01a226331bd62e45dc5e39a5e19517e054d977ef9bc3",
"replaceString": "bitnami/nginx:1.24.0-debian-12-r15@sha256:a842d93d1903fab7b7cf01a226331bd62e45dc5e39a5e19517e054d977ef9bc3",
"autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}",
"datasource": "docker",
"depType": "final",
"updates": [
{
"bucket": "non-major",
"newVersion": "1.25.4-debian-12-r2",
"newValue": "1.25.4-debian-12-r2",
"newMajor": 1,
"newMinor": 25,
"updateType": "minor",
"newDigest": "sha256:8936f5a21ad81326147fc75795222882a083bec04e8e46e4b22adb5ef56d662f",
"branchName": "renovate-test/bitnami-nginx-1.x"
}
],
"packageName": "bitnami/nginx",
"versioning": "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)(:?-(?<compatibility>.+)-(?<build>\\d+)(?:-r(?<revision>\\d+))?)?$",
"warnings": [],
"registryUrl": "https://index.docker.io",
"currentVersion": "1.24.0",
"isSingleVersion": true,
"fixedVersion": "1.24.0-debian-12-r15"
}
],
"packageFile": "Dockerfile"
}
]
}
my repro is a different issue
currentVersion
is of cause not a valid version on my regex!
getSatisfyingVersion
needs to return the original version, not the coerced.
Describe the proposed change(s).
Example code: https://github.com/renovatebot/renovate/blob/fe56ee0d7c4160838a7f3b5ac6fe44d838b57a5f/lib/modules/versioning/regex/index.ts#L116-L130
This means that regex versioning like this isn't fully supported:
"versioning": "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)$"