Draft: Paginate GLQL analytics charts with a limit
What does this MR do and why?
Setting limit: on an analytics-mode chart or bar list used to fetch one page of that size with no way to reach the rest. It now shows Previous/Next controls and a range label (Showing 1 to 6 of 10), paging one limit-sized page at a time.
The three DAP Impact bar lists grouped by flow type adopt it: "Where credits went", "Sessions by activity" and "Users by activity". Flow types outnumber the six bars a list folds to, so their tails were rolling into Other (N) with no way to reach them. Their panels shrink to fit a page rather than a full list, and the Adoption view below "Users by activity" moves up to close the gap.
Prev replays the after cursor an earlier page used rather than sending before, which this connection pairs with first and resolves from the start of the result set.
Limitation: only charts grouped by one thing can page
One dimension means one bar per row, so a page is just fewer bars, each correct. Two dimensions means each bar sums several rows, so a page boundary can split one:
| Claude | GPT | |
|---|---|---|
| Everything | 1000 | 500 |
| Page 1 | 800 | – |
| Page 2 | 200 | 400 |
Claude appears twice at two wrong totals, both looking finished.
So those charts, plus stat and every heatMap, keep auto-pagination: full set, correct bars,
no controls.
That also fixes the same split on master today, where two dimensions plus a limit: renders one
partial page.
Follow-up: paginate analytics charts by dimension value rather than by result row proposes lifting this in the query layer, which is where it belongs rather than here.
References
- Closes https://gitlab.com/gitlab-org/gitlab/-/issues/629893
- Follow-up https://gitlab.com/gitlab-org/gitlab/-/issues/630429 proposes paging analytics charts by dimension value, which would lift the single-dimension restriction
- Follows !256013 (merged), which added auto-pagination for the no-
limit:case - !256168 (merged) gave dashboard panels their own
request queue and has since merged. This branch is rebased onto it, and paging shares the
same
fetchResult, so page turns run on the dashboard queue rather than the default one.
Screenshots or screen recordings
| Where credits went | Sessions by activity | Users by activity |
|---|---|---|
How to set up and validate locally
gitlab:duo_workflow:populate seeds only three workflow definitions, so widen workflow_definitions in ee/lib/tasks/gitlab/duo_workflow/duo_workflow.rake first, then run it and open the DAP Impact dashboard.
- Sessions by activity shows six bars,
Showing 1 to 6 of N, Previous disabled. - Next replaces the rows, enables Previous, and moves the range on.
- The last page disables Next. No
Otherrow appears on any page. - A single-page result renders no controls and no empty footer.
display: tablewith alimit:still shows Load more, unchanged.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.
The pipeline was skipped on push to save CI resources, so a full pipeline is needed before this can merge.