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

Support empty lower and upper bounds in P2 VersionRange #565

Merged

Conversation

HannesWell
Copy link
Member

This enables support for version range specifications where the lower or upper bound is not specified and the delimiting bracket is directly next to the separating colon. For example [1,) or (,1] but also (,) can then be parsed successfully.

The type of supported brackets for an empty or unspecified bound is something that's not inherently obvious. From a mathematical perspective an empty bound can be considered equivalent to infinity. And in math may not say inclusive infinity. From that perspective only [1,infinity) respectively [1,) would be permitted, but not [1,]. But technically infinity has a specific value for P2 versions, i.e. Version.MAX_VERSION. So if one really wants to cover all possible values, the upper bound still has to be inclusive, i.e. ]. For the lower bound the situation is similar, where 0.0.0 or the 'empty'-version is the smallest one possible.

Alternatively we could treat no lower bound simply as a synonym for 0.0.0 and no upper bound as synonym for Version.MAX_VERSION and consider the bounds as specified?

This enables support for version range specifications where the lower or
upper bound is not specified and the delimiting bracket is directly next
to the separating colon. For example '[1,)' or '(,1]' but also '(,)' can
then be parsed successfully.

The type of supported brackets for an empty or unspecified bound is
something that's not inherently obvious. From a mathematical perspective
an empty bound can be considered equivalent to infinity. And in math may
not say inclusive infinity. From that perspective only '[1,infinity)'
respectively '[1,)' would be permitted, but not '[1,]'.
But technically infinity has a specific value for P2 versions, i.e.
Version.MAX_VERSION. So if one really wants to cover all possible
values, the upper bound still has to be inclusive, i.e. ']'. For the
lower bound the situation is similar, where '0.0.0' or the
'empty'-version is the smallest one possible.
@HannesWell HannesWell requested review from merks and laeubi October 18, 2024 21:03
Copy link

Test Results

  375 files  ± 0    375 suites  ±0   42m 8s ⏱️ - 1m 53s
1 904 tests + 9  1 901 ✅ + 9  3 💤 ±0  0 ❌ ±0 
6 712 runs  +27  6 703 ✅ +27  9 💤 ±0  0 ❌ ±0 

Results for commit c39bad3. ± Comparison against base commit 3388118.

Copy link
Contributor

@merks merks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good.

@HannesWell HannesWell merged commit 3af8373 into eclipse-equinox:master Oct 19, 2024
12 checks passed
@HannesWell HannesWell deleted the version-range-without-bounds branch October 19, 2024 18:12
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

Successfully merging this pull request may close these issues.

2 participants