malliaridis commented on code in PR #4273: URL: https://github.com/apache/solr/pull/4273#discussion_r3066046472
########## .github/renovate.json: ########## @@ -4,9 +4,19 @@ "enabled": true, "gitIgnoredAuthors": ["renovate-bot <[email protected]>"], "dependencyDashboard": false, - "enabledManagers": ["gradle", "github-actions"], + "enabledManagers": ["gradle", "github-actions", "regex"], "labels": ["exempt-stale"], - "includePaths": ["gradle/libs.versions.toml", "versions.*", "build.gradle", ".github/workflows/*"], + "includePaths": ["gradle/libs.versions.toml", "versions.*", "build.gradle", ".github/workflows/*", "solr/docker/templates/Dockerfile.body.template"], + "customManagers": [ + { + "description": "Track gosu GitHub releases and update ARG GOSU_VERSION in Dockerfile template", + "customType": "regex", + "fileMatch": ["^solr/docker/templates/Dockerfile\\.body\\.template$"], + "matchStrings": ["ARG GOSU_VERSION=(?<currentValue>[^\\s]+)"], + "depNameTemplate": "tianon/gosu", + "datasourceTemplate": "github-releases" Review Comment: I could confirm your solution with the following command (renovate was installed via `npm install -g renovate`): ```bash LOG_LEVEL=debug RENOVATE_LOG_FORMAT=json npx renovate --platform local --dry-run=lookup 2>&1 > report.log ``` I downgraded to 1.17 to see if renovate picks it up, and the output confirmed it: ```log {"depName":"tianon/gosu","currentValue":"1.17","datasource":"github-releases","replaceString":"# renovate: datasource=github-releases depName=tianon/gosu\nARG GOSU_VERSION=1.17","updates":[{"bucket":"non-major","newVersion":"1.19","newValue":"1.19","releaseTimestamp":"2025-09-23T19:10:36.000Z","newVersionAgeInDays":198,"newMajor":1,"newMinor":19,"newPatch":0,"updateType":"minor","libYears":1.890115138254693,"branchName":"renovate/tianon-gosu-1.x"}],"packageName":"tianon/gosu","versioning":"semver-coerced","warnings":[],"sourceUrl":"https://github.com/tianon/gosu","registryUrl":"https://github.com","currentVersion":"1.17","currentVersionTimestamp":"2023-11-02T21:46:05.000Z","currentVersionAgeInDays":889,"isSingleVersion":true,"fixedVersion":"1.17"} ``` The solution with the comment can still be used though, so that we can generalize the matching to other packages as well (more future-proof). This can be done by changing the matchStrings with ```json "matchStrings": [ "# renovate: datasource=(?<datasource>[a-z-]+) depName=(?<depName>[^\\s]+)\\nARG \\w+_VERSION=(?<currentValue>[^\\s]+)" ], ``` and add this comment above the `ARG`: ``` # renovate: datasource=github-releases depName=tianon/gosu ARG GOSU_VERSION=1.19 ``` renovate will then pick the datasource and depName from the comment, rather than the renovate.json file (more flexible). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
