Add ability to reference Maintainers or Developers from CODEOWNERS
What does this MR do and why?
Add the ability to reference any default role to a code owners file using an @@
prefix.
See the attached screen grab for the result.
Local migration output
Up
main: == [advisory_lock_connection] object_id: 128900, pg_backend_pid: 62084
main: == 20241002130409 AddRoleApproversToApprovalMergeRequestRules: migrating ======
main: -- add_column(:approval_merge_request_rules, :role_approvers, :integer, {:array=>true, :default=>[], :null=>false})
main: -> 0.0388s
main: == 20241002130409 AddRoleApproversToApprovalMergeRequestRules: migrated (0.0428s)
main: == [advisory_lock_connection] object_id: 128900, pg_backend_pid: 62084
Down
main: == [advisory_lock_connection] object_id: 128900, pg_backend_pid: 60837
main: == 20241002130409 AddRoleApproversToApprovalMergeRequestRules: reverting ======
main: -- remove_column(:approval_merge_request_rules, :role_approvers)
main: -> 0.0024s
main: == 20241002130409 AddRoleApproversToApprovalMergeRequestRules: reverted (0.0077s)
main: == [advisory_lock_connection] object_id: 128900, pg_backend_pid: 60837
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Reference_developers_from_codeowners_file_small
How to set up and validate locally
- Enable the
codeowner_role_approvers
feature flag. - Setup a local project with codeowners.
- In the codeowners file specify a file and a role. eg:
README.md @@developer
- Make an MR which changes the specified file and notice the list of recommended approvers are developers in the project.
Related to #282438
Spike issue #479928 (closed)
Edited by Gavin Hinfey