Add onlyAllowMergeIfAllStatusChecksPassed setting to MR object
What does this MR do and why?
This MR adds the onlyAllowMergeIfAllStatusChecksPassed
property to the MR object used by the MR widgets on the MR details page. It's added in 2 places, to the response for widget.json
, and to the response for the GraphQL call:
widget.json |
GraphQL call |
---|---|
![]() |
![]() |
The GraphQL call data is used when the merge_request_widget_graphql
feature flag is on (the default), and the widget.json
data is used when the feature flag is off. Note that the onlyAllowMergeIfAllStatusChecksPassed
property is only added if the externalStatusChecks
license feature is enabled (a GitLab Ultimate feature).
Note that this only adds the property to the data, but it's not used in this MR. A follow-up MR will use the data to show a message in the status checks MR widget when the MR can't be merged due to failing status checks.
How to set up and validate locally
-
Enable the
only_allow_merge_if_all_status_checks_passed
feature flag. -
Go to any project -> Settings -> Merge requests, then find the "Status checks must succeed" checkbox. Check it and save the change.
-
Create a MR or go to an existing MR. Verify that in the network tab,
widget.json
and thegetState
GraphQL call (usually the 2nd GraphQL call in the network list) has theonlyAllowMergeIfAllStatusChecksPassed
property set totrue
. -
Go back to the project settings, uncheck the "Status checks must succeed" checkbox, and save the change. Refresh the MR page and verify that the
onlyAllowMergeIfAllStatusChecksPassed
property is set tofalse
. -
Use the following command to delete all EE files to get GDK to act as if it's in FOSS mode. While there are other ways listed on how to get GDK to act as if it's FOSS, this is the only way I found that actually works:
rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb
- Restart your GDK, then go back to the MR details page. Verify that the
onlyAllowMergeIfAllStatusChecksPassed
property is not added to either response.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #369861 (closed)