Add namespace setting to allow MR approval by author
What does this MR do?
This MR adds a namespace setting to allow merge request approvals from author. This setting is currently not integrated at the project level.
This feature is behind a feature flag :group_merge_request_approval_settings_feature_flag
⚙ Implementation
- Add a new field
allow_merge_request_author_approval
to existing payload ofGET /groups/:id
- Allow update via existing endpoint:
PUT /groups/:id
- Update permissions:
Admin
orOwner
role - EE License:
:group_merge_requess_approval_settings
(GitLab Premium)
🐘 Database
Migrate
rake db:migrate:up VERSION=20201215022636
== 20201215022636 AddAllowMergeRequestAuthorApprovalToNamespaceSettings: migrating
-- add_column(:namespace_settings, :allow_merge_request_author_approval, :boolean, {:default=>true, :null=>false})
-> 0.0042s
== 20201215022636 AddAllowMergeRequestAuthorApprovalToNamespaceSettings: migrated (0.0132s)
Revert
rake db:migrate:down VERSION=20201215022636
== 20201215022636 AddAllowMergeRequestAuthorApprovalToNamespaceSettings: reverting
-- remove_column(:namespace_settings, :allow_merge_request_author_approval)
-> 0.0017s
== 20201215022636 AddAllowMergeRequestAuthorApprovalToNamespaceSettings: reverted (0.0102s)
Currently, there is about 9,408,734
records in namespace_settings
table that will be impacted by this migration.
gitlabhq_production=> select count(*) from namespace_settings;
count
---------
9408734
(1 row)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Related to #273544 (closed)
Edited by Tan Le