action-dependabot-auto-merge icon indicating copy to clipboard operation
action-dependabot-auto-merge copied to clipboard

Support caret and tilde version updates

Open mjpieters opened this issue 3 years ago • 1 comments

I use version strings that allow for updates to minor versions, such as:

importlib_metadata = { version = "^1.3.0", python = "< 3.8" }

The version restriction is ^1.3.0, a caret version, which allows 1.x major release provided it is equal to 1.3.0 or newer. A related syntax is a ~ tilde version restriction, which pins the minor version , such that ~1.3.0 would accept 1.3.8 but not 1.4.0.

Dependabot has upgraded this package to also accept 2.x, which for this specific package is a helluva good idea (not doing this would make my package not play ball in projects that also use libraries that have yet to update this dependency where others pin it to ^2.0.0), but auto-merge hasn't been able to parse the title:

title: "Update importlib-metadata requirement from ^1.3.0 to >=1.3,<3.0"
depName: requirement
Warning: failed to parse title: no recognizable versions

In my case, the action should not auto-approve as I set it to approve minor versions only, but it should at least be able to parse the above expanded range.

mjpieters avatar Oct 12 '20 16:10 mjpieters

that would be nice indeed.

I think all the ingredients are already in place to make this happen, the semver library is readily availabel to parse the ranges, the regex can be changed to just fetch the "to xxxx" section without verifying a version format ...

would love to see this as a pull request, I don't have time in the enar future to get to it, so I'll keep this open in case somebody gets to it first!

ahmadnassri avatar Oct 15 '20 15:10 ahmadnassri