Skip to content
Snippets Groups Projects
Unverified Commit 05bf839b authored by Gabriel-Ladzaretti's avatar Gabriel-Ladzaretti Committed by GitHub
Browse files

fix(pep440): renovate downgrades when rangeStrategy=bump (#15358)

parent 4de0e459
No related branches found
No related tags found
No related merge requests found
......@@ -168,6 +168,14 @@ describe('modules/versioning/pep440/index', () => {
${'==3.2.*,>=3.2.2'} | ${'replace'} | ${'3.2.2'} | ${'4.1.1'} | ${'==4.1.*'}
${'==3.2.*,>=3.2.2'} | ${'replace'} | ${'3.2.2'} | ${'4.0.0'} | ${'==4.0.*'}
${'>=1.0.0,<1.1.0'} | ${'replace'} | ${'1.0.0'} | ${'1.2.0'} | ${'>=1.2.0,<1.3.0'}
${'<1.3.0'} | ${'bump'} | ${'1.3.0'} | ${'0.9.2'} | ${'<1.3.0'}
${'<1.3.0'} | ${'bump'} | ${'0.9.0'} | ${'0.9.2'} | ${'<1.3.0'}
${'<=1.3.0'} | ${'bump'} | ${'0.9.0'} | ${'0.9.2'} | ${'<=1.3.0'}
${'<=1.3.0'} | ${'bump'} | ${'1.3.0'} | ${'0.9.2'} | ${'<=1.3.0'}
${'<1.3.0'} | ${'bump'} | ${'1.3.0'} | ${'1.6.0'} | ${'<1.6.1'}
${'<1.3.0'} | ${'bump'} | ${'0.9.0'} | ${'1.6.0'} | ${'<1.6.1'}
${'<=1.3.0'} | ${'bump'} | ${'0.9.0'} | ${'1.6.0'} | ${'<=1.6.0'}
${'<=1.3.0'} | ${'bump'} | ${'1.3.0'} | ${'1.6.0'} | ${'<=1.6.0'}
`(
'getNewValue("$currentValue", "$rangeStrategy", "$currentVersion", "$newVersion") === "$expected"',
({ currentValue, rangeStrategy, currentVersion, newVersion, expected }) => {
......
......@@ -316,6 +316,9 @@ function updateRangeValue(
return range.operator + newVersion;
}
if (['==', '<='].includes(range.operator)) {
if (lte(newVersion, range.version)) {
return range.operator + range.version;
}
return range.operator + newVersion;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment