[default branch protection] Update settings API to accept a protected branches payload
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 updating the settings API to accept a payload that matches the protected branches update API
Ideally, we should re-use the same grape entities so that when there are updates to the protected branches API options, they are also available to the default branch settings API.
- the existing default branch protection user docs
- the existing branch protection api docs
- the payload should match the protected branch API