Nuget search: fix the prerelease filtering
What does this MR do?
The NuGet search service is used mainly by Visual Studio to perform searches within the GitLab NuGet repository.
One of the options of the search is including or not pre release versions. Pre release versions are defined by having a -
in their version string (see https://docs.microsoft.com/en-us/nuget/concepts/package-versioning#pre-release-versions).
There are two cases to deal with:
- A package with only pre release versions.
- A package with a mix of release and pre release versions.
The prerelease filter works with 1. but not with 2. This is due to how the search service works. It is implemented using a partition subquery (more details here !24182 (merged)).
The subquery already filters out the pre release version but the root query doesn't. So with a package in (2.), the subquery will filter out the pre release version but still return the package name to the root query (as it has release versions). The root query will return all available versions ->
This MR patches the root query so that the pre release filtering is also done there.
Related issue #207213 (closed)
Screenshots
See #207213 (closed) for the current behavior.
With this MR:
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team