Parse all GLQL panel forms in Analyze with Duo

What does this MR do and why?

Analyze with Duo dropped GLQL panels that were written as frontmatter or as a bare query. withFilters parsed the panel as a single YAML document and required a query key, so those forms threw, were reported to Sentry, and never reached the agent. The GLQL parser and the GLQL API already accept all three forms.

withFilters now reads a query: block with yaml.parse, and reads frontmatter and bare queries with parseQueryTextWithFrontmatter, so only keys the panel set are kept (no invented default display). The dashboard filters are written back as a query: block. Invalid frontmatter is still left out and reported to Sentry.

This also fixes a crash in the shared GLQL parser: a map without a query key (title: x) was treated as a config, and parseQuery threw TypeError. parseYAML now uses the whole text as the query, matching ParserService#get_standard_yaml, so the compiler reports a syntax error instead.

References

Screenshots or screen recordings

Not applicable (context payload only; no UI change).

How to set up and validate locally

  1. Open an analytics dashboard that has Analyze with Duo enabled.
  2. Include a GLQL panel written as frontmatter (---\ntitle: x\n---\ntype = Issue) and one written as a bare query (type = Issue).
  3. Open Analyze with Duo and confirm both panels are in the agent context, with the dashboard scope written into a query: block.
  4. Existing block-form panels should still be scoped as before.
  5. A map without query (title: x) is shared as the query text (and the GLQL parser no longer throws TypeError on it). Invalid frontmatter is still dropped, with the error sent to Sentry.

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 Priyanshu Jha

Merge request reports

Loading
Loading