[go: up one dir, main page]

Allow searching by iid and sort results

What does this MR do and why?

This MR updates the advanced search functionality for work items by adding two key features:

  1. Search by IID: Allows users to search for work items by their internal ID (iid) when using advanced search with Elasticsearch.
  2. Sorting capabilities: Implements comprehensive sorting options for work items (see related documenentation) in advanced search results, including:
    • Created date (asc/desc)
    • Updated date (asc/desc)
    • Weight (asc/desc)
    • Health status (asc/desc)
    • Closed date (asc/desc)
    • Due date (asc/desc)
    • Milestone due date (asc/desc)
    • Popularity (asc/desc)

Please note that title asc/desc is not included since we need to update the mappings to add title as keyword. Currently ES does not allow sorting by text fields.

If a sorting field is not supported, then we fallback to the postgres WorkItems finder without throwing any explicit errors.

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 feature flags in rails c:
=> Feature.enable(:glql_work_items)
=> Feature.enable(:glql_es_integration)
  1. Navigate to any issue comment or description field where Markdown is supported
  2. Add the following GLQL query into the field and try out sorting with various supported sorting options (https://docs.gitlab.com/user/glql/fields/#fields-to-sort-embedded-views-by):
```glql
display: table
fields: title, labels, milestone
query: group = "gitlab-org" and label = "group::knowledge"
sort: updated desc
```

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 #562593 (closed)

Edited by Alisa Frunza

Merge request reports

Loading