Skip to content

Render GLQL blocks into a simple list of issues

Himanshu Kapoor requested to merge 477304-glql-list-of-issues into master

What is GLQL?

See epic summary: &14767 for more details.

What does this MR do and why?

Render GLQL blocks into a simple list of issues

Include the @gitlab/query-language library and integrate it with render_gfm to render any GLQL blocks into a list of issue links.

This initial version supports 3 presentation options: display, limit and fields. The display option supports ordered and unordered lists.

This is a multi-MR effort to split !161632 (closed) into smaller MRs.

  1. Push feature flag :glql_integration to frontend (!161942 - merged)
  2. Render GLQL blocks into a simple list of issues (!162050 - merged) (👈 This MR)
  3. Render GLQL blocks into a table of issues (!162081 - merged)

Note: This MR is still large but it is mostly because of a lot of test coverage and snapshots added. It is quite difficult to create smaller MRs when releasing a new feature.

Not covered in this MR

If the query returns a compile error, or the resulting GraphQL query returns an error, there is no error state currently present to handle that.

MR acceptance checklist

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

Screenshots or screen recordings

Example of a GLQL query in Wiki text editor:

image

Example of how that GLQL query renders:

image

How to set up and validate locally

  1. Enable feature flag :glql_integration.
  2. In a project, assign yourself some issues.
  3. Create a wiki page with the following content:
```glql
---
fields: title, author, state
display: list
---
assignee = currentUser()
```
  1. Save the page

Presentation layer

The optional YAML front matter block above the query contains presentation options.

Currently supported options:

  • display: How to display the data. Currently supported options: list or orderedList. Default: list.
  • limit: How many items to display. Current default: 100. Max limit is also 100.
  • fields: A comma separated value of fields. If not provided, only title field is included by default.

Currently supported fields: iid, author, state, title. Other fields may work here, but are not officially supported or tested with this MR. Some fields like epic and labels are currently known to break, and are out of scope of this MR.

Examples of GLQL queries:

  • weight=1
  • assignee = currentUser()
  • label in ("devops::plan", "devops::create")
  • label != "backend" and author = currentUser() and weight = 1 and updated > today()
  • updated > today()

Supported areas

Rendering of GLQL blocks is supported behind a feature flag in the following areas:

  • Wikis (both group and project wikis)
  • Epics and epic comments
  • Issue and issue comments
  • Merge requests and merge request comments
  • Work items and work item comments

Related to #477304 (closed)

Edited by Himanshu Kapoor

Merge request reports

Loading