Version rules: Matching "0" patch version with tag?

itemplate's Avatar

itemplate

16 Jun, 2017 10:26 AM

In the channel version rule I'm trying to match version 4.8.0 <= x < 4.9.0 but this fails.
I've tried [4.8,4.9) and just 4.8 but the validation shows:

4.8.0 (valid)
4.8.1 (valid)
4.8.1-dev-234 (valid)
4.8.0-dev-234 (NOT valid)

Why isn't 4.8.0-dev-234 valid?

  1. Support Staff 1 Posted by Daniel Fischer on 19 Jun, 2017 05:07 AM

    Daniel Fischer's Avatar

    Hi,

    Thanks for getting in touch! In SemVer's precedence ranking, the pre-release tag -dev-234 precedes 4.8.0, whereas your expression stops at 4.8.0, which is why your expression is not picking up 4.8.0-dev-234. To make the expression inclusive of 4.8.0-dev-234 you will need to either change it to (4.7,4.9) which is everything between, exclusive of 4.7 & 4.9 or add the pre-release tag to make it: [4.8-dev-234,4.9).

    So either of the following will work here.
    (4.7,4.9) [4.8-dev-234,4.9)

    You can find more info on this at the following page: http://semver.org/spec/v2.0.0.html

    Let me know how you go. :)

    Best regards,
    Daniel

  2. 2 Posted by itemplate on 19 Jun, 2017 08:09 AM

    itemplate's Avatar

    Hi Daniel,

    Thanks, well yes but this is somewhat trouble. You see, "4.8.0-dev-234" is just an example, it could be "4.8.0-featureX-234" or similar. So having to specify the pre-release tag is a problem. Is there a way to specify any tag?

    Anyways, going with your suggestion with "(4.7,4.9)" would still match "4.9.0-dev-1377" which of course is also a problem. I just want all builds from "4.8" to be matched here. More or less regardless of what comes after.

    Possible?

  3. 3 Posted by itemplate on 19 Jun, 2017 08:16 AM

    itemplate's Avatar

    Note, I guess I could just do smth like (4.7.10000,4.8.10000) or similar...

  4. Support Staff 4 Posted by Daniel Fischer on 20 Jun, 2017 01:13 AM

    Daniel Fischer's Avatar

    Hi,

    Thanks for getting back. I think you will be fine as long as the max version in your expression is the latest version you would want to include. With (4.7.10000,4.8.10000) you will be including everything before 4.8.10000 excluding 4.8.10000. Using the parenthesis makes it select the range exclusive of the values defined. Using [] is the same but inclusive of the values defined.

    You can use something like (4.7,4.8.99999] to select everything from 4.7, excluding 4.7, up to and including 4.8.9999.

    Sorry if I'm at all making this confusing. Let me know if this helps. :)

    Best regards,
    Daniel

  5. 5 Posted by itemplate on 20 Jun, 2017 06:31 AM

    itemplate's Avatar

    Hi Daniel,

    No you're helping me alright, I got what I want now, thanks :)

  6. Support Staff 6 Posted by Daniel Fischer on 20 Jun, 2017 08:29 AM

    Daniel Fischer's Avatar

    Hi,

    Great! Glad to hear. :)

    Best regards,
    Daniel

  7. Paul Stovell closed this discussion on 28 Sep, 2017 04:33 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac