"Approve" button missing on merge requests where approval is optional

Summary

When creating a new merge request using GitLab 15.6.1, the merge request approval widget does not contain an "Approve" button when approval is optional:

image

Approval via API works as expected, and doing so will produce the expected "Revoke approval" button in the merge request widget; however, if you click the "Revoke approval" button then you will have to use the API to approve the merge request again.

My organization uses group permissions for maintaining our projects and does not have any custom approval rules.

Steps to reproduce

I'm not sure if these steps are adequate since I don't know the root cause.

  1. Create a merge request on a project with optional approval.
  2. Observe the "Approve" button is missing.

What is the expected correct behavior?

The "Approve" button should appear to the left of the "Approval is optional" text.

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:		Ubuntu 22.04
Proxy:		no
Current User:	git
Using RVM:	no
Ruby Version:	2.7.6p219
Gem Version:	3.1.6
Bundler Version:2.3.15
Rake Version:	13.0.6
Redis Version:	6.2.7
Sidekiq Version:6.5.7
Go Version:	unknown

GitLab information
Version:	15.6.1-ee
Revision:	fe39c71ac74
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	13.8
Elasticsearch:	no
Geo:		no
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: 

GitLab Shell
Version:	14.13.0
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell

Results of GitLab application Check

Expand for output related to the GitLab application check
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 14.13.0 ? ... OK (14.13.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/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: ... Checking Reply by email ...

IMAP server credentials are correct? ... yes Mailroom enabled? ... skipped MailRoom running? ... skipped

Checking Reply by email ... Finished

Checking Incoming Email ... Finished

Checking LDAP ...

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

Checking LDAP ... Finished

Checking GitLab App ...

Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... 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? ... yes 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: ... 21/1 ... yes 21/2 ... yes 21/3 ... yes 5/4 ... yes 5/5 ... yes 5/6 ... yes 5/7 ... yes 5/8 ... yes 5/9 ... yes 5/10 ... yes 5/11 ... yes 5/12 ... yes 5/13 ... yes 7/14 ... yes 5/15 ... yes 5/16 ... yes 5/17 ... yes 5/18 ... yes 5/19 ... yes 5/20 ... yes 5/21 ... yes 5/22 ... yes 5/23 ... yes 5/24 ... yes 5/25 ... yes 5/26 ... yes 5/27 ... yes 5/28 ... yes 5/29 ... yes 5/30 ... yes 5/31 ... yes 9/32 ... yes 5/33 ... yes 5/34 ... yes 5/35 ... yes 5/36 ... yes 5/37 ... yes 5/38 ... yes 21/39 ... yes 21/40 ... yes 21/41 ... yes 21/42 ... yes 21/43 ... yes 21/44 ... yes 21/45 ... yes 21/46 ... yes 21/47 ... yes 21/48 ... yes 21/49 ... yes 8/50 ... yes 21/51 ... yes 21/52 ... yes 21/53 ... yes 21/54 ... yes 21/55 ... yes 21/56 ... yes 21/57 ... yes 21/58 ... yes 21/59 ... yes 21/60 ... yes 21/61 ... yes 21/62 ... yes 21/63 ... yes 21/64 ... yes 7/65 ... yes 21/66 ... yes 21/67 ... yes 21/68 ... yes 21/69 ... yes 21/70 ... yes 21/71 ... yes 21/72 ... yes 21/73 ... yes 21/74 ... yes 21/75 ... yes 21/76 ... yes 21/77 ... yes 21/78 ... yes 5/79 ... yes 21/80 ... yes 21/81 ... yes 21/82 ... yes 21/83 ... yes 7/84 ... yes 8/85 ... yes 21/86 ... yes 21/87 ... yes 7/88 ... yes 21/89 ... yes 21/90 ... yes 21/91 ... yes 21/92 ... yes 21/93 ... yes 7/94 ... yes 21/95 ... yes 21/96 ... yes 7/97 ... yes 21/98 ... yes 21/99 ... yes 21/100 ... yes 21/101 ... yes 21/102 ... yes 21/103 ... yes 7/104 ... yes 5/105 ... yes 9/106 ... yes 9/107 ... yes 9/108 ... yes 8/109 ... yes 7/110 ... yes 8/111 ... yes 7/112 ... yes 8/113 ... yes 7/114 ... yes 8/115 ... yes 5/116 ... yes 9/117 ... yes 9/118 ... yes 7/119 ... yes 8/120 ... yes 7/121 ... yes 7/122 ... yes 7/123 ... yes 5/124 ... yes 7/125 ... yes 5/126 ... yes 7/127 ... yes 8/129 ... yes 8/130 ... yes 7/131 ... yes 7/133 ... yes 21/134 ... yes 21/135 ... yes 21/137 ... yes 21/138 ... yes 21/139 ... yes 21/140 ... yes 21/141 ... yes 21/142 ... yes 21/143 ... yes 21/144 ... yes 21/145 ... yes 21/146 ... yes 21/147 ... yes 21/148 ... yes 21/149 ... yes 21/151 ... yes 21/152 ... yes 21/153 ... yes 21/154 ... yes 21/155 ... yes 21/156 ... yes 21/157 ... yes 21/158 ... yes 21/161 ... yes 21/162 ... yes 21/163 ... yes 2/164 ... yes 7/165 ... yes 21/166 ... yes 21/167 ... yes 21/168 ... yes 21/169 ... yes 21/170 ... yes 21/171 ... yes 21/172 ... yes 21/173 ... yes 21/174 ... yes 18/175 ... yes 7/176 ... yes 7/177 ... yes 7/178 ... yes 21/179 ... yes 21/180 ... yes 21/182 ... yes 21/183 ... yes 21/184 ... yes 21/185 ... yes 21/186 ... yes 21/187 ... yes 21/188 ... yes 21/189 ... yes 7/190 ... yes 21/191 ... yes 21/192 ... yes 21/193 ... yes 21/196 ... yes 21/197 ... yes 7/198 ... yes 7/199 ... yes 21/200 ... yes 21/201 ... yes 21/203 ... yes 21/204 ... yes 21/205 ... yes 21/206 ... yes 21/207 ... yes 21/208 ... yes 7/209 ... yes 21/210 ... yes 21/211 ... yes 21/212 ... yes 21/213 ... yes 21/214 ... yes 21/215 ... yes 21/216 ... yes 21/217 ... yes 21/218 ... yes 7/219 ... yes 7/220 ... yes 21/221 ... yes 21/222 ... yes 21/223 ... yes 21/224 ... yes 21/225 ... yes 21/226 ... yes 21/227 ... yes 21/228 ... yes 21/229 ... yes 21/230 ... yes 21/231 ... yes 7/232 ... yes 7/233 ... yes 21/234 ... yes 21/235 ... yes 21/237 ... yes 21/238 ... yes 21/239 ... yes 7/240 ... yes 21/241 ... yes 21/242 ... yes 21/243 ... yes 7/244 ... yes 21/245 ... yes 7/246 ... yes 21/247 ... yes 21/248 ... yes 21/249 ... yes 21/250 ... yes 7/251 ... yes 7/252 ... yes 7/253 ... yes 21/254 ... yes 21/255 ... yes 21/256 ... yes 21/257 ... yes 21/258 ... yes 21/259 ... yes 21/260 ... yes 7/261 ... yes 21/262 ... yes 21/263 ... yes 21/264 ... yes 21/265 ... yes 21/266 ... yes 21/267 ... yes 21/268 ... yes 21/269 ... yes 21/270 ... yes 21/271 ... yes 21/272 ... yes 21/273 ... yes 21/274 ... yes 21/275 ... yes 21/276 ... yes 21/277 ... yes 21/278 ... yes 21/279 ... yes 21/280 ... yes 21/281 ... yes 21/282 ... yes 21/283 ... yes 21/284 ... yes 21/285 ... yes 21/286 ... yes 21/287 ... yes 21/288 ... yes 21/289 ... yes 21/290 ... yes 21/292 ... yes 21/294 ... yes 21/295 ... yes 21/296 ... yes 21/297 ... yes 21/298 ... yes 21/299 ... yes 21/300 ... yes 21/301 ... yes 21/302 ... yes 21/303 ... yes 21/304 ... yes 21/305 ... yes 21/306 ... yes 21/307 ... yes 21/308 ... yes 21/309 ... yes 21/310 ... yes 21/311 ... yes 21/312 ... yes 21/313 ... yes 21/314 ... yes 21/315 ... yes 21/316 ... yes 21/317 ... yes 21/318 ... yes 7/319 ... yes 21/320 ... yes 21/321 ... yes 21/322 ... yes 21/323 ... yes 21/324 ... yes 21/325 ... yes 21/326 ... yes 21/327 ... yes 21/328 ... yes 21/329 ... yes 21/330 ... yes 21/331 ... yes 21/332 ... yes 21/333 ... yes 21/334 ... yes 21/335 ... yes 21/337 ... yes 21/338 ... yes 21/339 ... yes 21/340 ... yes 21/341 ... yes 21/342 ... yes 21/343 ... yes 21/344 ... yes 21/345 ... yes 21/346 ... yes 21/347 ... yes 7/348 ... yes 21/349 ... yes 7/350 ... yes 21/351 ... yes 21/352 ... yes 21/353 ... yes 21/354 ... yes 21/355 ... yes 21/356 ... yes 21/357 ... yes 21/358 ... yes 21/359 ... yes 21/360 ... yes 21/361 ... yes 21/362 ... yes 21/363 ... yes 7/364 ... yes 21/365 ... yes 21/366 ... yes 21/367 ... yes 21/368 ... yes 21/369 ... yes 21/370 ... yes 21/371 ... yes 21/372 ... yes 21/373 ... yes 21/374 ... yes 21/375 ... yes 21/376 ... yes 21/377 ... yes 21/378 ... yes 21/379 ... yes 21/380 ... yes 21/381 ... yes 21/382 ... yes 21/383 ... yes 21/384 ... yes 21/385 ... yes 21/386 ... yes 21/387 ... yes 21/388 ... yes 21/389 ... yes 21/390 ... yes 7/391 ... yes 21/392 ... yes 21/393 ... yes 21/394 ... yes 21/395 ... yes 21/396 ... yes 21/397 ... yes 21/398 ... yes 21/399 ... yes 21/400 ... yes 21/401 ... yes 21/402 ... yes 21/403 ... yes 7/404 ... yes 21/405 ... yes 21/406 ... yes 21/407 ... yes 21/408 ... yes 21/409 ... yes 21/410 ... yes 21/411 ... yes 21/412 ... yes 21/413 ... yes 21/414 ... yes 21/415 ... yes 21/416 ... yes 21/417 ... yes 21/418 ... yes 21/419 ... yes 21/420 ... yes 21/421 ... yes 21/422 ... yes 21/423 ... yes 21/424 ... yes 21/425 ... yes 21/426 ... yes 21/427 ... yes 21/428 ... yes 21/429 ... yes 21/430 ... yes 21/431 ... yes 21/432 ... yes 21/433 ... yes 21/434 ... yes 21/435 ... yes Redis version >= 6.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.6) Git user has default SSH configuration? ... yes Active users: ... 4 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)

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished