Skip to content
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

semver < doesn't seem to work correctly #287

Open
jhheider opened this issue Jan 24, 2024 · 2 comments
Open

semver < doesn't seem to work correctly #287

jhheider opened this issue Jan 24, 2024 · 2 comments

Comments

@jhheider
Copy link
Contributor

jhheider commented Jan 24, 2024

trying to exclude a test for a specific version of jenkins.io; this should work:

    - run: jenkins-lts --version | grep {{version}}
      if: '<2.426.3 || >2.426.3'

but doesn't. indeed, even this doesn't work:

    - run: jenkins-lts --version | grep {{version}}
      if: '<2.426.3 || >2.426.4'

but this does:

    - run: jenkins-lts --version | grep {{version}}
      if: '<2.426.3 || >=2.426.4'

so, there's something up with the handling of the > operator.

@mxcl
Copy link
Member

mxcl commented Jan 24, 2024

we don’t support > since it is ambiguous what the user means.

eg. > 1.2.3 will allow 1.2.3.1 but you probably mean 1.2.4 and above

Probably the error message should state that or we should just allow 1.2.3.1 and it's your own fault. What you think?

@jhheider
Copy link
Contributor Author

jhheider commented Jan 24, 2024

well, i personally think its the latter. i don't consider 1.2.3.1 > 1.2.3 ambiguous (since "1.2.4 and above" is expressly >=1.2.4), but i agree it'll catch someone by surprise.

i suppose the other option would be to get fancy and support something like:

  - if: next_patch(1.2.3)
  - if: next_major(1.2.3)

that's what github would do.

edited to add: i was using > specifically because i wasn't in a >=2.426.4 situation trying to exclude a single version. perhaps a negation operation would have been simpler, but yuck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants