Add new jsonb column to store settings for default branch protection
What does this MR do and why?
Currently, the options for default branch protection at the instance and group level lag behind, and are not as fine-grained, as the options available from the Protected Branches feature
The branch defaults lag behind because the current implementation uses an integer column to store the default settings, which becomes difficult to expand as new options and finer detail controls are added to the protected branches feature
at a high-ish level the existing feature is implemented as:
- there are integer columns on the database tables (application level and group level)
- these integers are mapped to a subset of protected branch settings
- these mappings defined in access.rb
- mappings are used here via
BranchProtection
helper
- when creating a default branch, those settings are passed into the protected branch service
To offer better support of protected branches features on the default branch, we can:
- use a jsonb column rather than an integer
- update the settings API to accept a payload the matches the protected branches API
- Pass those settings into the ProtecteBrancheService
This commit performs step 1, by adding a new jsonb
column
resolves: #408150 (closed) Changelog: added
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
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.