Advanced search - allow queries for milestone in work item index

What does this MR do and why?

This MR introduces support for the following GLQL milestone queries:

Single Milestone Queries

GLQL Query WorkItems Finder ES Filter Name
milestone = %"18.1" milestone_title: ["18.1"] milestone_title
milestone != %"18.1" not: {milestone_title: ["18.1"]} not_milestone_title

Multiple Milestone Queries (OR Logic)

GLQL Query WorkItems Finder ES Filter Name
milestone in (%"18.1", %"18.2") milestone_title: ["18.1", "18.2"] milestone_title
milestone != (%"18.1", %"18.2") not: {milestone_title: ["18.1", "18.2"]} not_milestone_title

Wildcard Milestone Queries

GLQL Query WorkItems Finder ES Filter Name
milestone = none milestone_wildcard_id: "NONE" none_milestone_title
milestone != any milestone_wildcard_id: "NONE" none_milestone_title
milestone = any milestone_wildcard_id: "ANY" any_milestone_title
milestone != none milestone_wildcard_id: "ANY" any_milestone_title

Note 1: We are not going to implement the milestone started and upcoming scopes now. This will be done in a follow up issue #547410 (closed).

Note 2: Milestone title and milestone wildcards are mutually exclusive filters (done on the level of resolver here and in the negated filters here).

References

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Follow this guide to have ES enabled locally for GDK
  2. GLQL relies on crypto.subtle, which is unavailable in insecure contexts (except for localhost), it won’t work if you're using a custom URL like http://gdk.test:3000 locally. To resolve this, one of the options is to enable HTTPS in GDK by following this link.
  3. Enable the following two feature flags in rails c:
=> Feature.enable(:glql_integration)
=> Feature.enable(:glql_work_items)
  1. Navigate to any issue comment or description field where Markdown is supported
  2. Add the following GLQL query into the field:
```glql
display: table
fields: title, labels("workflow::*"), author, labels
query: group = "gitlab-org" and milestone = %"18.1"
```
  1. Test with different milestone fields variations provided above in the MR description section.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #526608 (closed)

Edited by Alisa Frunza

Merge request reports

Loading