Fetch issues / MRs / epics count in the sidebar with GraphQL
What does this MR do and why?
This MR is the frontend part of the fix for the bug where visiting a group with many subgroups/issues/epics (less than 1k as when it's more we cache) may cause a timeout issue when trying to render the Issues/MR count.
When the flag asyncSidebarCounts
is enabled, we will fetch the issues / MRs / epics count in the sidebar with GraphQL.
References
Please include cross links to any resources that are relevant to this MR This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
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.
Screenshots or screen recordings
No UI changes. UI should work the same and have no regressions.
How to set up and validate locally
With the flag async_sidebar_counts
disabled or enabled, expect no regressions or UI changes. The only change is where we fetch data from.
- Enable the flag
async_sidebar_counts
- Check any
group
and `project routes. For example:
http://localhost:3000/:group
-
http://localhost:3000/groups/:group/-/issues
and mrs, epics http://localhost:3000/:group/:project
-
http://localhost:3000/:group/:project/-/issues
and mrs
- expect that
getAsyncSuperSidebarData
graphQL is queried and the count for these items is rendered properly - expect that for thousands and higher numbers, we continue to shorten them (eg.
81523
displays81.5k
)
Related to #501679 (closed)