Add backend support for group MR settings (part 1)
This MR completes this issue and this epic at the same time: #372040 (closed) & &8704 (closed)
There are 3 settings that project maintainers can use to control when merges happen:
- only_allow_merge_if_pipeline_succeeds?
- allow_merge_on_skipped_pipeline?
- only_allow_merge_if_all_discussions_are_resolved?
Regulated customers want the ability to control these options at the group level setting (only accessible by Group Owners), that cannot be overridden by the project level setting.
In order to facilitate the code review, I divided it into these MRs:
-
part 1
: Add backend support for group MR settings -
part 2
: Add frontend support for group MR settings -
part 3
: Add MR settings support for group (EE backend) -
part 4
: Add MR settings support for group (EE frontend)
Screenshots or screen recordings
No UI changes.
these MRs
Final goal ofAdd Merge requests > Merge checks
settings support for group level.
What does this current MR do and why?
The changes revolve around these three configuration items:
only_allow_merge_if_pipeline_succeeds?
allow_merge_on_skipped_pipeline?
only_allow_merge_if_all_discussions_are_resolved?
- Backend: Add feature flag
support_group_level_merge_checks_setting
- Backend: Add two new methods,
[configuration]?(inherit_group_setting: bool)
and[configuration]_locked?
to theprojects
model for each configuration option.
-
only_allow_merge_if_pipeline_succeeds?:
- #only_allow_merge_if_pipeline_succeeds?(inherit_group_setting: bool)
- #only_allow_merge_if_pipeline_succeeds_locked?
-
allow_merge_on_skipped_pipeline?:
- #allow_merge_on_skipped_pipeline?(inherit_group_setting: bool)
- #allow_merge_on_skipped_pipeline_locked?
-
only_allow_merge_if_all_discussions_are_resolved?:
- #only_allow_merge_if_all_discussions_are_resolved?(inherit_group_setting: bool)
- #only_allow_merge_if_all_discussions_are_resolved_locked?
These methods will be extended to cascade configuration in
EE
.
- Backend: Update
mergeable_discussions_state?
and other methods to use[configuration]?(inherit_group_setting: bool)
instead of[configuration]
cc @prajnamas