Should there be a single MR state when turning off "Required" squash option
Here is the current behaviour:
Required
Scenario A
- Existing MR is unchecked
- Maintainer changes it to "Required" (checked)
- Go to edit MR, there is no squash option. Clicks "cancel" and does NOT save.
- Maintainer changes it to be "Encourage" (checked)
-
👉 Go to edit MR, squash commit will recover the latest saved state, which is the MR state, and displays unchecked
Scenario B
- Existing MR is unchecked
- Maintainer changes it to "Required" (checked)
- Go to edit MR, which is disabled and checked. Clicks "save".
- Maintainer changes it to be "Allow" (unchecked)
-
👉 Go to edit MR, squash commit will recover the latest saved state, which is that of the Project setting state, and displays checked
The Concern
If the MR state is unchecked. The maintainer changes it to "Required" (checked). What happens when the maintainer changes it to a non-read-only state (ie. Allow or Encouraged)? The current behaviour is it depends -- it depends if the user has saved the Required state. If the user has saved the Required state, it will override the original MR state. If it didn't, the original MR state will stay in its original state.
And that's the thing -- When the maintainer changes it to a non-read-only state (ie. Allow or Encouraged), we have two states. The MRs that have saved the Required state VS the MRs that haven't.
So here's the question -- Is that what we want? Is it confusing to have 2 states floating around. Or should all the MR state be automatically updated when the maintainers switch to the Required option?
Background Information
The following discussion from !33827 (merged) should be addressed:
-
@tkuah started a discussion: (+8 comments)
Required
Recovers what is saved last (The Required state can be saved and will override the original MR state)
I think we should definitely open a follow-up issue for this. Feels like a surprise but the frequency of it is not enough, I feel, to require us to come up with another solution right now.
Related Issue to also consider
Squash option for Existing MR when Allow and Encourage is selected > #226005