Name of incorrect Merge Request Approval Policy displayed on MR when approval required

Summary

On a merge request with multiple merge request approval policies, in the "eligible approvers" section the policy name displayed is not from the correct policy (e.g., approval is required from "Policy 2" but the UI shows the policy name as "Policy 1" - the displayed approvers are correct.)

See attached screenshot

Steps to reproduce

Reproduced On Omnibus v17.11.1 EE reported on GET v17.10.4 EE

  1. Create a new project & add members to Maintainer and Owner roles.
  2. Add a Merge Request Approval Policy named "General" to require approval from Maintainers for all MRs targeting the default branch.
  3. Add a Merge Request Approval Policy named "Security" to require approval from Owners for all MRs targeting the default branch with new security detections.
  4. Create MR for a change that will not introduce a security finding.
  5. Examine the MR "eligible approvers" section. Note that the approvals for "General" are listed under "Security".

Example Project

Could Not Reproduce On GitLab.com

What is the current bug behavior?

The incorrect policy name displays next to the list of users capable of approving the MR per a policy.

What is the expected correct behavior?

The policy name and approvers should be consistent across the row so

Relevant logs and/or screenshots

Screen_Shot_2025-04-30_at_11.58.21_AM

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

sudo gitlab-rake gitlab:env:info

System information
System:         Ubuntu 24.04
Proxy:          no
Current User:   git
Using RVM:      no
Ruby Version:   3.2.5
Gem Version:    3.6.6
Bundler Version:2.6.5
Rake Version:   13.0.6
Redis Version:  7.2.7
Sidekiq Version:7.3.9
Go Version:     unknown

GitLab information
Version:        17.11.1-ee
Revision:       cd4c186e8bc
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     16.8
URL:            https://current.jdsandbox.net
HTTP Clone URL: https://current.jdsandbox.net/some-group/some-project.git
SSH Clone URL:  git@current.jdsandbox.net:some-group/some-project.git
Elasticsearch:  no
Geo:            no
Using LDAP:     no
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version:        14.41.0
Repository storages:
- default:      unix:/var/opt/gitlab/gitaly/gitaly.socket
GitLab Shell path:              /opt/gitlab/embedded/service/gitlab-shell

Gitaly
- default Address:      unix:/var/opt/gitlab/gitaly/gitaly.socket
- default Version:      17.11.1
- default Git Version:  2.49.0.gl1

Results of GitLab application Check

Expand for output related to the GitLab application check

sudo gitlab-rake gitlab:check SANITIZE=true Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 14.41.0 ? ... OK (14.41.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes (cluster/worker) ... 1/1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Database config exists? ... yes Tables are truncated? ... skipped All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Cable config exists? ... yes Resque config exists? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units) Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units) Projects have namespace: ... 2/1 ... yes 25/2 ... yes 25/3 ... yes 26/4 ... yes 26/5 ... yes 26/6 ... yes 26/7 ... yes 27/8 ... yes 27/9 ... yes 27/10 ... yes 27/11 ... yes 27/12 ... yes 27/13 ... yes 27/14 ... yes 27/15 ... yes 27/16 ... yes 43/17 ... yes 43/20 ... yes 43/21 ... yes 49/22 ... yes 49/23 ... yes 55/24 ... yes 55/25 ... yes 58/26 ... yes 58/27 ... yes 63/28 ... yes 63/29 ... yes 63/30 ... yes 63/31 ... yes 63/32 ... yes 63/33 ... yes 63/34 ... yes 63/35 ... yes 63/36 ... yes 63/37 ... yes 63/38 ... yes 63/39 ... yes 63/40 ... yes 63/41 ... yes 63/42 ... yes 63/43 ... yes 63/44 ... yes 63/45 ... yes 63/46 ... yes 63/47 ... yes 63/48 ... yes 63/49 ... yes 63/50 ... yes 63/51 ... yes 63/52 ... yes 63/53 ... yes 63/54 ... yes 63/55 ... yes 63/56 ... yes 63/57 ... yes 63/58 ... yes 63/59 ... yes 63/60 ... yes 63/61 ... yes 63/62 ... yes 63/63 ... yes 63/64 ... yes 63/65 ... yes 63/66 ... yes 63/67 ... yes 63/68 ... yes 63/69 ... yes 63/70 ... yes 63/71 ... yes 63/72 ... yes 63/73 ... yes 63/74 ... yes 63/75 ... yes 63/76 ... yes 63/77 ... yes 63/78 ... yes 63/79 ... yes 63/80 ... yes 117/81 ... yes 117/82 ... yes 117/83 ... yes 55/84 ... yes 127/85 ... yes 129/86 ... yes 129/87 ... yes 134/88 ... yes 134/89 ... yes 134/90 ... yes 138/91 ... yes 129/92 ... yes Redis version >= 6.2.14? ... yes Ruby version >= 3.0.6 ? ... yes (3.2.5) Git user has default SSH configuration? ... yes Active users: ... 25 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes Elasticsearch version 7.x-8.x or OpenSearch version 1.x ... skipped (Advanced Search is disabled) All migrations must be finished before doing a major upgrade ... skipped (Advanced Search is disabled)

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes