Allow group level and app level settings UI control for SHA setting

What does this MR do and why?

This MR adds UI controls in application settings and group settings to configure SHA requirement when calling the merge API and enforces the setting at the API level.

Previously, merge request settings were absent from CE as all preexisting settings were under EE. This MR also creates an MR settings section in CE to support the new setting

Group settings

The new setting is positioned under the existing Merge request settings.

Application settings

A new section for merge requests was created, and the setting was inserted there, in line with UX recommendations; see: https://gitlab.com/gitlab-org/gitlab/-/work_items/600428#note_3375178533.

References

https://gitlab.com/gitlab-org/gitlab/-/work_items/600428+

Follow-up tracking issue to port/reallign other settings: Consolidate application level merge request set... (#604820)

Screenshots or screen recordings

Group level setting

__Merge_requests

Locked group-level setting

UI_EVIDENCE

App level setting

UI_EVIDENCE

Before After

How to set up and validate locally

Verifying SHA requirement

  • Enable the setting (Either on the group or app level)
  • Create an MR
  • Attempt to merge the MR through the API without the SHA param Expectation: Merge blocked with message SHA must be provided when merging.
  • Attempt to merge the MR through the API with the SHA param Expectation: Merge successful with 2xx response

Verifying cascading settings behaviour

  • Lock the setting on the app level, Expectation: all groups confirm and disable modifications on the setting with the app value set
  • Lock the setting on an ancestor group level, Expectation: all descendant groups confirm and disable modifications on the setting with the ancestor value set

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Safwan Ahmed

Merge request reports

Loading