Add branch_type validations
What does this MR do and why?
This MR adds validation for the new branch_type
that we're adding in &9468 (closed).
The validation is only applied when the feature flag security_policies_branch_type
is enabled.
Screenshots or screen recordings
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- In rails console enable the feature flag
Feature.enable(:security_policies_branch_type)
- Go to Settings -> Repository -> Protected branches and unprotect the
main
branch - Add a new scan execution policy with the following yaml:
type: scan_execution_policy name: Pipeline / Protected Branches / Secret Detection description: '' enabled: true rules: - type: pipeline branch_type: protected actions: - scan: secret_detection
- Clicking on
Configure with a merge request
should give an errorBranch types don't match any existing branches.
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.
Related to #404777 (closed)
Edited by Martin Čavoj