Skip to content

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

What does this MR do and why?

Add a new GLQL logging service and update the query service to use it.

This is needed because we want the same logging and rate limiting logic for both the GraphQL and REST APIs.

For how the query service is being used, you can look at Draft: Create a new GLQL REST API for Duo integ... (!209517)

References

Related to #578342

References

Screenshots or screen recordings

See !211603 for UI screenshots.

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

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