Skip to content

versions: Requested versions eligible only if they were already present#5

Merged
apparentlymart merged 1 commit intomainfrom
b-positive-negative-contradiction
Jul 6, 2023
Merged

versions: Requested versions eligible only if they were already present#5
apparentlymart merged 1 commit intomainfrom
b-positive-negative-contradiction

Conversation

@apparentlymart
Copy link
Copy Markdown
Owner

The versions.MeetingConstraints method tried to permit selection of any prereleases explicitly requested by an exact version constraint, but it didn't also check that those prereleases were included in the original set.

That worked okay for positive exact version constraints, like 1.0.0-beta.1, but was incorrect for negative ones like ! 1.0.0-beta.1 which still get counted as "requested" in certain cases but that should not cause them to then be included in the overall result set.

Now we'll filter the list of requested versions first by membership of the "exact" set, so that the requested status of a version can only return versions that would've been eligible for inclusion in the original unfiltered set.

Fixes #4.

The versions.MeetingConstraints method tried to permit selection of
any prereleases explicitly requested by an exact version constraint, but
it didn't also check that those prereleases were included in the original
set.

That worked okay for positive exact version constraints, like
"1.0.0-beta.1", but was incorrect for negative ones like "! 1.0.0-beta.1"
which still get counted as "requested" in certain cases but that should
not cause them to then be included in the overall result set.

Now we'll filter the list of requested versions first by membership of
the "exact" set, so that the requested status of a version can only
return versions that would've been eligible for inclusion in the original
unfiltered set.
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.

Excluding prereleases from a constraint doesn't work correctly

1 participant