Repository navigation
Crate Datasource with custom registryUrl does not respect config.json if using a sparse crate index #41452
How are you running Renovate?Self-hosted Renovate CLI Which platform you running Renovate on?GitHub Enterprise Server Which version of Renovate are you using?43.31.9 Please tell us more about your question or problemRenovate does not parse the crate datasource correctly if a custom registryUrl is used. Config snippet: "customManagers": [
{
"customType": "regex",
"description": "Process Annotations in Build Arg Conf",
"managerFilePatterns": [
"/^containers\\/.*\\.conf$/"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)( versioning=(?<versioning>\\S+))?\\r?\\n.+=(?<currentValue>\\S+)",
"# renovate: datasource=docker\\r?\\n.+=(?<depName>[^:]+?):(?<currentValue>[^'\"@]+)(@(?<currentDigest>sha256:[a-f0-9]+))?"
],
"datasourceTemplate": "{{{datasource}}}"
}
],
"packageRules": [
{
"description": "Use NXRM mirror for Rust crates",
"matchDatasources": [
"crate"
],
"registryUrls": [
"sparse+https://nxrm.example.com/repository/crates.io"
]
}
]The config looks for datasources using regex and sets a custom Sonatype Nexus Repository Manager URL as crates.io mirror. "deps": [
{
"depName": "jj-cli",
"currentValue": "0.38.0",
"datasource": "crate",
"replaceString": "# renovate: datasource=crate depName=jj-cli\r\nJJ_VERSION=0.38.0",
"updates": [],
"packageName": "jj-cli",
"versioning": "cargo",
"warnings": [],
"registryUrl": "sparse+https://nxrm.example.com/repository/crates.io",
"dependencyUrl": "https://nxrm.example.com/repository/crates.io/jj-cli",
"mostRecentTimestamp": "2026-02-05T14:47:12.000Z",
"currentVersion": "0.38.0",
"currentVersionTimestamp": "2026-02-05T14:47:12.000Z",
"currentVersionAgeInDays": 18
},
{
"depName": "uv",
"currentValue": "0.10.2",
"datasource": "crate",
"replaceString": "# renovate: datasource=crate depName=uv\r\nUV_VERSION=0.10.2",
"updates": [],
"packageName": "uv",
"versioning": "cargo",
"warnings": [],
"registryUrl": "sparse+https://nxrm.example.com/repository/crates.io",
"dependencyUrl": "https://nxrm.example.com/repository/crates.io/uv",
"mostRecentTimestamp": "2026-02-24T04:06:06.000Z",
"currentVersion": "0.10.2",
"currentVersionTimestamp": "2026-02-10T19:19:45.000Z",
"currentVersionAgeInDays": 13
}
],However, the dependencyUrl is wrong and no version updates are found (uv should be at least 0.10.5). The dependencyUrl should be "https://nxrm.example.com/repository/crates.io/crates/uv" because the sparse index config.json looks like this but is not respected: {"dl":"https://nxrm.example.com/repository/crates.io/crates","api":"https://nxrm.example.com/repository/crates.io"}Logs (if relevant)Logs |
Replies: 1 comment 1 reply
|
I am wrong about the dependencyUrl, since it doesn't really matter. Still, the current code doesn't respect the download url in config.json, in this case the "/crates" part is missing when downloading releases. |
i've provided a fix in #41536