-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rangeStrategy refactor #19802
Comments
Copying from WyriHaximus in @19866: What would you like Renovate to be able to do?Coming from Dependabot Renovate gives an impressive amount of additional features. My initial experience with Renovate was a bit spotty but that is being resolved through #18715. The thing I would love Renovate to be able to do is allow to pass in an array of range strategies into To paint a situation and how Renovate would deal with that: Then a However, what I really want Renovate to do is to update the lockfile and widen if a new major version comes out that supports my targeting ranges. So I can currently either change it to either If you have any ideas on how this should be implemented, please tell us here.While reading through the code I realized that having an array of possible strategies to try is a massively complex thing to implement in one manager, not even to mention all of them. So I came to the conclusion that the simplest way to get some of it is to provide a
Is this a feature you are interested in implementing yourself?Yes |
I too would like to utilise the above image. You could make rangeStrategy: {
unlockedInRange: 'bump',
unlockedOutOfRange: 'widen',
lockedInRange: 'update-lockfile',
lockedOutOfRange: 'widen',
} |
My gut instinct says to stay away from a nested structure like this. All it really does is shorten the variable names, while adding new ways for people to configure it wrong |
Created #21902 (Use pinVersions instead of rangeStrategy=pin) |
Should the default Locked - in range strategy for |
I think it would probably be best to generate such in-range locked updates by default, and then have "is this in-range or not?" metadata which users can use package rules on, e.g. to filter our in-range OR out-of-range updates |
This one might be too much for me. I can't even figure out where this logic is (I've spent a few hours reading the code, reviewing old PRs, trying to figure it out). Best I can gather is that I suspect I'd need much more in depth knowledge to implement this. Sorry. |
Describe the proposed change(s).
One thing I'd like to do is remove rangeStrategy=pin and instead revert back to having a boolean pinVersions setting.
This would then leave values
replace
,update-lockfile
,bump
andwiden
.replace
andwiden
affect how the package file is updated whenever a new version doesn't match the current constraint.replace
, it means to retain the same precision but "shift" the range, e.g. from^1.0.0
to^2.0.0
.widen
, it means to widen the constraint to satisfy current and new, e.g. from^1.0.0
to^1.0.0 || ^2.0.0
bump
andupdate-lockfile
affect what to do when the locked version is outdated:bump
, the low range of the package file constraint is increased, e.g. from^1.0.0
to^1.0.1
. It essentially behaves the same regardless of whether the update is in-range, out of range, major/minor/patch, etc.update-lockfile
, the package file constraint is retained, and the locked version is increased, e.g. from1.0.0
to1.0.1
. It only really does this for in-range updates, and falls back toreplace
for out of rangeAfter we extract, we have:
Summary of today:
bump
will essentially always update the package file, which in turn causes an update to the lock file if present.Whether to update the lockfile when in-range could be valid for both
replace
andwiden
, so maybe it should be a boolean option for those. Alternatively we could have it update by default, with updateType=lockfileUpdate and then allow people to enable/disabled based on that.The text was updated successfully, but these errors were encountered: