Skip to content

Make updates to query structure for author and approvedBy fields

What does this MR do and why?

Author Field Enhancements:

  • Added In operator support for Issues and Epics: authors in ("user1", @user2)
  • Added authors field alias in field mapping
  • ⚠️ Note: Author In operator not supported for Merge Requests at API level
  • ⚠️ Note: Author field does not support none/any wildcards at API level

ApprovedBy Field Enhancements:

  • Added wildcard support: approvedBy = any and approvedBy = none
  • Kept support for both quoted and unquoted syntax: approvedBy = "any" and approvedBy = any

README.md updates:

  • Added section where described steps to be able testing your changes end-to-end with Gitlab GDK.

How to set up and validate locally

In glql-rust project:

  1. Build the Rust code to WASM wasm-pack build --target web --out-dir pkg
  2. Build the npm package npm run build
  3. Copy the full path to the build echo "$(pwd)/npm/dist/main.js"

In gitlab gdk:

  1. In app/assets/javascripts/glql/core/parser.js and app/assets/javascripts/glql/core/transformer.js change from:
import { glql } from "@gitlab/query-language-rust";

to:

import { glql } from "build path from step 3 in glql-rust project";
  1. Now in GDK in any markdown field, you can test with the following GLQL queries:
display: table
fields: title, labels, assignee, labels
query: group = "gitlab-org" and author in (@root, "afrnz")
display: table
fields: title, labels, assignee, labels
query: group = "gitlab-org" and type = MergeRequest and approvedBy = none
display: table
fields: title, labels, assignee, labels
query: group = "gitlab-org" and type = MergeRequest and approvedBy = any

Relates to gitlab-org/gitlab#556400

Edited by Alisa Frunza

Merge request reports

Loading