Configurable defaults for "Squash commits" option
Issue #17613 (closed)
MR | Changes |
---|---|
Part 1 > !33099 (merged) | BE implementation |
|
FE implementation of squash option and MR form |
Part 3 > !34891 (merged) | FE implementation of squash option in MR widget |
Part 4 > !35081 (merged) | FE implementation of squash option tooltip |
Part 5 > !35111 (merged) | FE implementation of squash option message in MR form |
Part 6 > !35392 (merged) | Additional spec for testing edge case for part 2 |
Docs > !33930 (merged) | Documentation |
What does this MR do?
Add squash commits options to the general settings and updates the merge options checkbox to reflect the selected squash option.
Testing Case
This is hidden behind a feature flag, docs
rails c
Feature.enable(:squash_options)
General Settings
- Go to the Settings > General page > expand Merge requests
-
You will see the following squash options
Merge Request Form
- Go to New Merge Request
-
the Merge options will have the following depending on the selected squash options.
Squash options | Expectation | Screenshot |
---|---|---|
Do not allow | box unchecked, disabled | hidden  |
Allow (default) | box unchecked, enabled | |
Encourage | box checked, enabled | |
Require | box checked, disabled |
- Go to Edit Merge Request
If there is persisted data (meaning the user has personally selected the squash option), the rules will be as followed:
Squash options | Result |
---|---|
Do not allow | hidden |
Allow | MR setting if set, else go with Project setting |
Encourage | MR setting if set, else go with Project setting |
Require | Project setting, ignore MR setting |
Rules
Required
Recovers what is saved last (The "Required" state can be saved and will override the original MR state)
- 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
Do not allow
Recovers MR state (The "Do not allow" is never saved)
- Existing MR has checked
- Maintainer changes it to "Do not allow" (unchecked)
- Go to edit MR, there is no squash option. Clicks "save".
- Maintainer changes it to be "Allow" (uncheck)
- Go to edit MR, squash commit will recover the MR state and displays checked
Special Thanks
This MR is based on @enzuru's MR > !27833 (closed). Thank you for your contribution 🧡
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Closes #17613 (closed)