Bug in Code Owners / MR Approvals widget?
Summary
I recently added a section [Docs Create]
with files to this project's CODEOWNERS
file so that MRs authors can easily spot who to assign for review.
- Problem 1: The MR Approvals widget shows the new
[Docs Create]
section but doesn't show who owns the file. - Problem 2: Code Owners is considering the group who owns
/doc/
instead of considering the owner to the file/doc/user/project/merge_requests/merge_request_approvals.md
. It's my understanding that the last rule listed prevails. Is this correct?
What we have in the CODEOWNERS
file:
What we have in the widget:
Shouldn't it only show the last rule?
/doc/user/project/merge_requests/merge_request_approvals.md @marcia
=> therefore, the widget should show only my username instead of the whole group for doc/
, no? That's how it works for /doc/development/
, for example.
Oh! Wait a min! Maybe the reason is that I'm the MR author (!39701 (merged)), therefore, I'm not an eligible approver. In that case, I guess we should hide the "Docs Create" section?
Steps to reproduce
- Add a dir to a CODEOWNERS section with a group as owner to the dir.
- Below the dir, add a new section with a file that belongs to this dir and a user as owner to the file.
- Change the file and submit a merge request.
- Open the MR Approvals widget to see who owns the file.
Example Project
https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/CODEOWNERS#L29 // !39701 (merged)
What is the current bug behavior?
- Code Owners considers the group set as owner to a high-level dir as code owner instead of a user set as owner to a file within the folder.
- Doesn't display the avatar of the file's code owner, only the Code Owner's section ("Docs Create") and the file name.
What is the expected correct behavior?
- Consider the last rule and only show the code owner to that file.
- Show the user's avatar.
Relevant logs and/or screenshots
Added above.
Output of checks
This bug happens on GitLab.com.
Results of GitLab environment info
Env info:
- GitLab.com
- https://gitlab.com/gitlab-org/gitlab/
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/CODEOWNERS
- macOS Catalina 10.15.6
- Chrome Version 84.0.4147.89 (Official Build) (64-bit) - zoom 100%
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
)(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)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)