How to handle date-based version ranges properly? #40319
Replies: 2 comments 2 replies
-
|
Hello! I think the From the documentation:
|
Beta Was this translation helpful? Give feedback.
-
Yeah so in this case, you'll want to use https://docs.renovatebot.com/modules/versioning/regex/ to handle this, like so: packageRules: [
/*
{
"deps": [
{
"depName": "ghcr.io/home-assistant/home-assistant",
"packageName": "ghcr.io/home-assistant/home-assistant",
"currentValue": "2025.11.3",
"replaceString": "ghcr.io/home-assistant/home-assistant:2025.11.3",
"autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}",
"datasource": "docker"
}
],
"packageFile": "demo/compose.yml"
}
*/
{
"matchPackageNames": ["ghcr.io/home-assistant/home-assistant"],
"versioning": "regex:^(?<major>\\d+\\.\\d+)\\.(?<minor>\\d+)(?<compatibility>.*)"
},
],This would lead to: {
"depName": "ghcr.io/home-assistant/home-assistant",
"packageName": "ghcr.io/home-assistant/home-assistant",
"currentValue": "2025.11.3",
"replaceString": "ghcr.io/home-assistant/home-assistant:2025.11.3",
"autoReplaceStringTemplate": "{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}",
"datasource": "docker",
"updates": [
{
"bucket": "non-major",
"newVersion": "2025.12.5",
"newValue": "2025.12.5",
"newMajor": 2025,
"newMinor": 12,
"newPatch": 5,
"updateType": "minor",
"isBreaking": false,
"newDigest": "sha256:9a5a3eb4a213dfb25932dee9dc6815c9305f78cecb5afa716fa2483163d8fb5b",
"branchName": "renovate/ghcr.io-home-assistant-home-assistant-2025.x"
},
{
"bucket": "major",
"newVersion": "2026.1.0",
"newValue": "2026.1.0",
"newMajor": 2026,
"newMinor": 1,
"newPatch": 0,
"updateType": "major",
"isBreaking": true,
"newDigest": "sha256:97d63b3d0028b6b52ad8e5ac7b014c3404e69bf1656b5489eec48b59184e0bc7",
"branchName": "renovate/ghcr.io-home-assistant-home-assistant-2026.x"
},
{
"isPinDigest": true,
"updateType": "pinDigest",
"newValue": "2025.11.3",
"newDigest": "sha256:f971850a6ec1fb5c5fd4e1748058e9e1f589aaf0da933b8d88bb5dee03f5b5e8",
"branchName": "renovate/pin-dependencies"
}
],
"versioning": "docker",
"warnings": [],
"sourceUrl": "https://github.com/home-assistant/core",
"registryUrl": "https://ghcr.io",
"homepage": "https://www.home-assistant.io/",
"lookupName": "home-assistant/home-assistant",
"currentVersion": "2025.11.3",
"isSingleVersion": true,
"fixedVersion": "2025.11.3"
}Notice that the multiple numbers of the major isn't allowed, so it won't quite work with what you're hoping for 🤔 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How are you running Renovate?
A Mend.io-hosted app
Which platform you running Renovate on?
GitHub.com
Which version of Renovate are you using?
No response
Please tell us more about your question or problem
We have Renovate set up over on the catppuccin/home-assistant repo, in part to keep our demo instance using the latest Home Assistant version. The issue is that Home Assistant versions using the format
year.month.patch(e.g. the latest version is2026.1.0), which means that the "major" version is actuallyyear.month, but Renovate is parsing it as SemVer, and thus thinking it is major version 2026. Is there any way to tell Renovate that the major version should be "2026.1"?What I really want is that if we are behind, updates are split into two groups: major (year + month) and minor/patch (final number). For example, given the versions
2025.11.0,2025.11.1,2025.11.2,2025.11.3,2025.12.0,2025.12.1,2025.12.2,2025.12.3,2025.12.4,2025.12.5,2026.1.0, if we are on2025.11.1, I would want to see two PRs: one minor/patch update ("update to 2025.11.3"), and one major update ("update to 2026.1" [note that this is not "update to 2026", I want it to include the month]). IfseparateMultipleMajoris on, then I would want an additional major update PR ("update to 2025.12"). Is this possible? I know I can (ab)use thepackageRulesto override automerge, but how can I make it include the month in the PR title / commit message when crossing year boundaries?Logs (if relevant)
Logs
Beta Was this translation helpful? Give feedback.
All reactions