Technical design doc for Code Owners
Scope
Develop a technical design document for CODEOWNERS in the pattern of Approval Rules.
Inheritance and Groups
The documentation should cover the effect of inheritance and groups &9733 (comment 1251955623)
Codeowner file precendence
Following this conversation, determine which order the codeowners file are applied in in the case there are multiple.
Choose the location where you want to specify Code Owners:
- In the root directory of the repository
- In the .gitlab/ directory
- In the docs/ directory
Update: Only the first file will be used if multiple are defined. Order is root, docs, .gitlab
# in ee/lib/gitlab/code_owners.rb
FILE_NAME = 'CODEOWNERS'
FILE_PATHS = [FILE_NAME, "docs/#{FILE_NAME}", ".gitlab/#{FILE_NAME}"].freeze
# in ee/app/models/ee/repository.rb
# method: Repository#code_owners_blob(ref:)
possible_code_owner_blobs = ::Gitlab::CodeOwners::FILE_PATHS.map { |path| [ref, path] }
blobs_at(possible_code_owner_blobs).compact.first
Document how the system deals with errors in CODEOWNERS file
Does is for instance ignore the requirement to require codeownwer approval all together?
Example MRs
Edited by Joe Woodward