Codeowners approver list not showing correctly

Summary

Code owners with section is being used on a project, with all groups properly added as member. Occasionally when an MR is created, the approval list for one group does not show complete. It only shows limited amount of users, and it seems to duplicate the previous section approvers list.

Steps to reproduce

The issue behaves intermittently. Here are the steps to reproduce.

  • Have two groups with some overlapping members.
  • Add CODEOWNERS file with sections to the project
  • Modify a set of file that is covered by 2 sections in the CODEOWNERS file.
  • Create an MR
  • Wait for approvers to populate. The approver list might show incomplete an it will be the same as previous approver

Example Project

What is the current bug behavior?

The approvers list on the MR are not always fully/correctly populated

What is the expected correct behavior?

Approvers list should be properly as per group members

Relevant logs and/or screenshots

Normal approvers should look like this correct-approvers

When bug happens, approvers in the list are show as below wrong-approvers

There is some overlap on the members between both groups. See below.

Production team members. production_team_members

Tradeops team members. tradeos_team_members

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true) root@gitlab ~]# gitlab-rake gitlab:env:info

System information System: RedHatEnterpriseServer 7.9 Proxy: no Current User: git Using RVM: no Ruby Version: 2.7.2p137 Gem Version: 3.1.4 Bundler Version:2.1.4 Rake Version: 13.0.3 Redis Version: 6.0.10 Git Version: 2.29.0 Sidekiq Version:5.2.9 Go Version: unknown

GitLab information Version: 13.9.1-ee Revision: 8ae438629fa Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 12.5 URL: https://gitlab.pr.edgelp.net HTTP Clone URL: https://gitlab.pr.edgelp.net/some-group/some-project.git SSH Clone URL: git@gitlab.pr.edgelp.net:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: yes Omniauth Providers:

GitLab Shell Version: 13.16.1 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing) [root@gitlab ~]# gitlab-rake gitlab:check SANITIZE=true Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 13.16.1 ? ... OK (13.16.1) 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 ... 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: ... Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) User output sanitized. Found 100 users of 100 limit.

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes 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 Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 39/3 ... yes 39/8 ... yes 39/15 ... yes 12/23 ... yes 5/25 ... yes 12/28 ... yes 39/31 ... yes 39/32 ... yes 39/33 ... yes 39/34 ... yes 39/35 ... yes 39/37 ... yes 11/42 ... yes 11/43 ... yes 11/44 ... yes 11/45 ... yes 39/52 ... yes 12/55 ... yes 39/60 ... yes 39/61 ... yes 39/64 ... yes 12/65 ... yes 5/67 ... yes 39/69 ... yes 39/70 ... yes 39/72 ... yes 39/73 ... yes 12/76 ... yes 39/77 ... yes 12/78 ... yes 39/83 ... yes 39/87 ... yes 39/89 ... yes 32/90 ... yes 39/91 ... yes 34/92 ... yes 34/93 ... yes 34/94 ... yes 34/96 ... yes 34/97 ... yes 33/99 ... yes 39/106 ... yes 32/116 ... yes 33/117 ... yes 39/133 ... yes 12/136 ... yes 34/139 ... yes 11/142 ... yes 32/143 ... yes 34/145 ... yes 16/146 ... yes 37/147 ... yes 37/148 ... yes 12/149 ... yes 37/150 ... yes 37/151 ... yes 42/152 ... yes 39/153 ... yes 41/154 ... yes 21/155 ... yes 11/156 ... yes 11/157 ... yes 42/158 ... yes 33/159 ... yes 33/160 ... yes 42/161 ... yes 42/162 ... yes 43/163 ... yes 11/164 ... yes 31/165 ... yes 18/166 ... yes 41/167 ... yes 43/168 ... yes 43/169 ... yes 46/170 ... yes 46/171 ... yes 46/172 ... yes 46/173 ... yes 46/174 ... yes 46/175 ... yes 46/176 ... yes 39/177 ... yes 46/178 ... yes 47/179 ... yes 47/180 ... yes 47/181 ... yes 39/182 ... yes 5/183 ... yes 39/184 ... yes 39/185 ... yes 39/186 ... yes 39/187 ... yes 42/188 ... yes 47/189 ... yes 11/190 ... yes 51/191 ... yes 51/192 ... yes 48/193 ... yes 51/194 ... yes 42/195 ... yes 48/196 ... yes 12/197 ... yes 48/198 ... yes 47/199 ... yes 43/200 ... yes 55/201 ... yes 55/202 ... yes 56/203 ... yes 56/204 ... yes 57/205 ... yes 48/206 ... yes 51/207 ... yes 55/208 ... yes 56/209 ... yes 59/210 ... yes 60/211 ... yes 60/212 ... yes 56/213 ... yes 59/215 ... yes 56/216 ... yes 5/217 ... yes 56/218 ... yes 81/219 ... yes 81/221 ... yes 51/222 ... yes 48/223 ... yes 39/224 ... yes 5/225 ... yes 11/226 ... yes 51/227 ... yes 46/228 ... yes 81/229 ... yes 81/230 ... yes Redis version >= 4.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.2) Git version >= 2.29.0 ? ... yes (2.29.0) Git user has default SSH configuration? ... no Try fixing it: mkdir ~/gitlab-check-backup-1619620197 sudo mv /var/opt/gitlab/.ssh/id_rsa ~/gitlab-check-backup-1619620197 sudo mv /var/opt/gitlab/.ssh/id_rsa.pub ~/gitlab-check-backup-1619620197 For more information see: doc/ssh/README.md in section "SSH on the GitLab server" Please fix the error above and rerun the checks. Active users: ... 33 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 (6.4 - 6.x deprecated to be removed in 13.8)? ... skipped (elasticsearch is disabled)

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

Edited by Gerardo Gutierrez