Render a dash for null metric cells in GLQL tables

What does this MR do and why?

GLQL tables now render — for a null metric cell instead of an italic "None".

lib/gitlab/database/aggregation/authorization.rb prunes a metric the user may not read, such as creditsUsed, which needs read_agent_artifacts. The metric returns null with no error when other metrics are requested. In table.vue, every null went through FieldPresenter, which picks NullPresenter and renders "None". For a metric, that reads as zero credits. The stat and barList presenters already render — for a null metric.

This MR renders — (the shared NO_VALUE) for null metric cells. Dimension cells are unchanged, because a null dimension such as a session with no project is genuinely "None". It adds jest coverage in spec/frontend/glql/components/presenters/table_spec.js.

Found during DAP Impact UAT. The Adoption tab "Group and project comparison" showed "None" in the Credits column for a Developer on gitlab-org.

References

Screenshots or screen recordings

The Adoption tab comparison table for a Developer, before and after the change.

Before: production data as a Developer. prod-adoption-comparison-none-credits

After: the Credits column shows a dash. after-adoption-comparison-dash-credits

Verified on GDK at master with the patch applied against live production responses: the Credits column renders a dash and the Project column keeps "None" for sessions without a project. spec/frontend/glql/components/presenters/table_spec.js passes with 66 examples including the two new ones.

How to set up and validate locally

  1. Sign in as a group member without read_agent_artifacts, for example a Developer.
  2. Open the DAP Impact dashboard and select the Adoption tab.
  3. Check that the Credits column in "Group and project comparison" shows —.
  4. Run yarn jest spec/frontend/glql/components/presenters/table_spec.js.

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.

Edited by Chandra Saripaka

Merge request reports

Loading
Loading