Model changes for code owner approval rules
What does this MR do?
This is a first step in https://gitlab.com/gitlab-org/gitlab-ee/issues/4418 not all code is used in this MR, but it will be in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9293.
This adds a partial unique index for approval_merge_request_rules
, the name must be unique scoped to a merge request when code_owners = 't'
.
This is also enforced by validations. A helper method for creating/finding code owner rules avoiding race conditions.
This index is safe to add, as we already only create one code_owner
row in that table. Now the database will enforce this.
Does this MR meet the acceptance criteria?
- [-] Changelog entry added, if necessary
- [-] Documentation created/updated via this MR
- [-] Documentation reviewed by technical writer or follow-up review issue created
-
Tests added for this feature/bug - [-] Tested in all supported browsers
-
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
EE specific content should be in the top level /ee
folder -
For a paid feature, have we considered GitLab.com plans, how it works for groups, and is there a design for promoting it to users who aren't on the correct plan? -
Security reports checked/validated by reviewer
Merge request reports
Activity
changed milestone to %11.8
added 382 commits
-
b05b465f...cd803a62 - 380 commits from branch
gitlab-org:master
- a675de49 - Add unique index merge_request_approval_rules.name
- 080a94da - Model changes for code owner approval rules
-
b05b465f...cd803a62 - 380 commits from branch
- Resolved by Andreas Brandl
@oswaldo Would you mind taking a first look at the code here?
assigned to @oswaldo
marked the checklist item Conforms to the code review guidelines as completed
marked the checklist item Conforms to the code review guidelines as incomplete
added 19 commits
-
b4cddd3c...1c123259 - 17 commits from branch
gitlab-org:master
- 9fa9a7dc - Add unique index merge_request_approval_rules.name
- 2a1cd671 - Model changes for code owner approval rules
-
b4cddd3c...1c123259 - 17 commits from branch
- Resolved by Bob Van Landuyt
- Resolved by Bob Van Landuyt
- Resolved by Bob Van Landuyt
- Resolved by Bob Van Landuyt
@reprazent Nice work :) Code looks mostly good to me, just a few minor comments.
Sounds like we got a few conflicts though.
assigned to @reprazent
added 138 commits
-
63c5279a...6706a00c - 134 commits from branch
gitlab-org:master
- 66fdedef - Add unique index merge_request_approval_rules.name
- 23524ea9 - Don't create partial unique indexes on MySQL
- 44c5a0fa - Adds helper for `find_or_create_by` in transaction
- b853a47a - Model changes for code owner approval rules
Toggle commit list-
63c5279a...6706a00c - 134 commits from branch