Repository navigation
Custom regex manager gets no updates for bare NuGet versions since 43.208.2 #48077
Unanswered
gitfool
asked this question in
Request Help
Replies: 1 comment
|
Your analysis of the interaction between #43737, 1. Assessing Option B for the PROption B is the cleanest fix for this regression without reintroducing the unintended global preset pin leakage from #34037: } else if (
compareValue &&
(rangeStrategy === null || versioningApi.isSingleVersion(compareValue)) &&
releases.some((release) => release.version === compareValue)
) {
currentVersion = compareValue;
}Why this is safe:
2. Immediate Configuration Workaround (for hosted Mend runs today)Until your PR merges and propagates to the hosted runner, you can restore updates immediately by setting {
"packageRules": [
{
"matchDatasources": ["nuget"],
"matchManagers": ["custom.regex"],
"versioning": "semver"
}
]
}Since |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
44.228.0
Please tell us more about your question or problem
Since 43.208.2, a custom regex manager that extracts a bare NuGet version (for example
6.2.0) gets no updates. SettingrangeStrategythroughpackageRulesdoesn't help. The nuget manager still updates the same bare version on the same Renovate version.Minimal reproduction
https://github.com/gitfool/renovate-custom-manager-range-strategy
All four files pin Cake.Tool
6.2.0. Releases6.3.0and7.0.0exist.rangeStrategycontrol.csprojbump).config/dotnet-tools.jsondefault.txtbump.txtbump, viapackageRulesLocal runs with
--platform=local --dry-run=lookup:default.txtandbump.txtacurrentVersionof7.0.0and no updates.default.txt.The same thing happens in a real repo. In https://github.com/gitfool/cake-docker the
Dockerfiledeclarescake.toolthrough a regex manager, and.config/dotnet-tools.jsondeclares it again. Renovate last bumped theDockerfilecopy on 2026-05-22, to 6.2.0. Since then #159 and #163 bumped onlydotnet-tools.json, to 6.3.0 and 7.0.0.Cause
I think two changes combine. Links are pinned to 44.240.0, the latest release. Both pieces of code are unchanged on
mainas of25d511d.getRangeStrategyreturnsnullfor every custom manager (lib/modules/manager/index.ts#L84-L109). It only checks the built-in managers map, so arangeStrategyset by a package rule that matchescustom.regexis dropped.isSingleVersion(compareValue)guard beforecurrentValuecan become the current version (lib/workers/repository/process/lookup/current.ts#L96-L119). NuGet versioning treats a bare6.2.0as>= 6.2.0, so the guard fails andgetCurrentVersionruns. With anullstrategy, it picks the highest matching release (L39), which is7.0.0. No release is newer, so there are no updates.The nuget manager isn't affected, because #43820 defaulted its
rangeStrategytobump, andbumppicks the lowest matching release. Custom managers can't use that, because of point 1.Earlier history
The
nullin point 1 appears to be deliberate. #33800 madegetRangeStrategylook up custom managers, for #28090. #34083 reverted it after #34037, where arangeStrategy: pinfrom a preset started applying to a custom manager and broke its updates.Possible fix
I patched two options into the 44.236.5 build and ran a single regex file (the same as
default.txt) under three configs. "Global pin" adds a top-level"rangeStrategy": "pin", as in #34037.[7.0.0]Option A brings back the #34037 problem and still leaves the default case broken. Option B changes one condition in
resolveCurrentVersion, so that a manager without a range strategy keeps an exact release match, as before 43.208.2:Option B doesn't make custom managers honour
rangeStrategy. That's the separate request in #28090. I'm happy to open a PR for option B with tests for the three cases, if that approach works for you.Related: #43762 (the same regression in the nuget manager, fixed by #43820) and #44010 (plans to remove the nuget manager's
bumpdefault).The investigation and patch testing were done with AI assistance (Claude). I checked the results against the reproduction and the hosted runs.
Logs (if relevant)
Logs
Mend-hosted run, Renovate 44.228.0, 2026-11-16 03:21 UTC (logContext
5b250ff0-26e9-4e07-a423-ab483fa879ed). FrompackageFiles with updates, trimmed:{ "packageFile": "default.txt", "depName": "Cake.Tool", "currentValue": "6.2.0", "datasource": "nuget", "versioning": "nuget", "currentVersion": "7.0.0", "updates": [] }{ "packageFile": "control.csproj", "depName": "Cake.Tool", "currentValue": "6.2.0", "datasource": "nuget", "versioning": "nuget", "currentVersion": "6.2.0", "updates": [ { "updateType": "minor", "newValue": "6.3.0" }, { "updateType": "major", "newValue": "7.0.0" } ] }All reactions