Skip to content

Add a new GLQL query service and update the base controller to use it

What does this MR do and why?

Add a new GLQL query service and update the base controller to use it

This is needed because we want the same logging and rate limiting logic for both the GraphQL and REST APIs. Logging is refined in Add a new GLQL logging service and update the q... (!211941).

This shouldn't change the existing API, rate limits, or logging outputs. It only moves them to a shared service. For how the service is being used, you can look at Draft: Create a new GLQL REST API for Duo integ... (!209517)

References

Related to #578342

Screenshots or screen recordings

Scenario Before After
Success Google_Chrome_Beta_2025-11-05_17.13.04 Google_Chrome_Beta_2025-11-05_17.13.04
Rate limited image image
Timed out Google_Chrome_Beta_2025-11-05_17.11.15 Google_Chrome_Beta_2025-11-05_17.11.15
Forbidden Google_Chrome_Beta_2025-11-05_17.11.57 Google_Chrome_Beta_2025-11-05_17.11.57
General error Google_Chrome_Beta_2025-11-05_17.12.46 Google_Chrome_Beta_2025-11-05_17.12.46

How to set up and validate locally

You may wish to run gdk cleanup to have clean logs before you test.

For verifying the UI still works:

  1. Open a markdown or description field, for instance, an issue comment.
  2. Add a GLQL query to the comment, e.g. (remove \):
    \`\`\`glql
    display: table
    fields: title, state, assignee, updated
    sort: updated desc
    query: project = "gitlab-duo/test" and type = Issue
    \`\`\`
  3. Verify that the GLQL query converts to an embedded view when previewing the comment or submitting to the issue.

For verifying logs still add glql_referer and glql_query_sha:

  1. Open <GITLAB_REPO_DIR>/log/development_json.log
  2. Find the log for the GLQL request
  3. Verify the values added to the log

MR acceptance checklist

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.

Edited by Robert Hunt

Merge request reports

Loading