[default branch protection] Add new jsonb column to store settings for default branch protection
Background Context
Currently, the options for default branch protection at the instance and group level lag behind, and are not as fin 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 if not impossible 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
Proposal
A more detailed proposal can be seen in the epic [here](&10391
At a high level the proposal is to:
- 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
here
This issue
This issue is specifically for tracking the progress of adding the new columns to the database, as that work needs to be done first to unblock the rest of the proposed implementation