Skip to content

Nuget search: fix the prerelease filtering

David Fernandez requested to merge 207213-fix-nuget-search into master

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:

  1. A package with only pre release versions.
  2. 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:

Screenshot_2020-04-14_at_13.18.03

Screenshot_2020-04-14_at_13.18.46

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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
Edited by David Fernandez

Merge request reports