Issue Totals in sidebar do not match the list tabs
Often the numbers listed in the tabs vs the sidebar are off. (In the case of gitlab-ce issues, a discrepency of ~200 at the moment.)
Similar issue to https://gitlab.com/gitlab-org/gitlab-ce/issues/34772, but now with the sidebar.
Customer reported this here: https://gitlab.zendesk.com/agent/tickets/83058
Requirements
- When caching issue counts, cache two different counts: the total including confidential issues, and the total excluding confidential issues.
- If the user can see all confidential issues on that project, use the confidential issue count. If they can't, use the count excluding confidential issues.
- This does mean that the count will still be wrong for people with guest access who have created or are assigned to confidential issues.
- No changes needed for merge requests.
- If we measure this and don't like the results, we can consider always using the count including confidential issues, instead.
Edited by Victor Wu