Merge requests count in the left navigation bar does not match the number of open Merge requests

Summary

Merge requests count in the left navigation bar does not match the number of open Merge requests

This is the same bug as Issues count in the left navigation bar does no... (#460742 - closed) • Heinrich Lee Yu • 17.6, but for Merge requests

Screenshot_2025-02-06_at_10.31.02_am

Steps to reproduce

Visit either of the following merge requests pages:

Example Project

https://gitlab.com/gitlab-org/security-products/ci-templates/-/merge_requests

What is the current bug behavior?

Merge requests count in the left navigation bar does not match the number of open Merge requests

What is the expected correct behavior?

Merge requests count in the left navigation bar matches the number of open Merge requests

Implementation

According to @engwan, the Merge requests count in the left navigation bar includes hidden merge requests from banned users, which should be excluded. This is the same fix as Exclude hidden issues in sidebar count (!172665 - merged) • Heinrich Lee Yu • 17.6, but for Merge requests.

/cc @timofurrer

Edited by François Rosé