Rebuild approval rules on default branch change
Summary
We are adding branch_type
support to security policies (&9468 (closed)).
We need to react to default branch changes.
Implementation Plan
- backend Rebuild approval rules on default branch changes
diff --git ee/app/services/ee/projects/update_service.rb
@@ -98,6 +98,12 @@ def after_default_branch_change(previous_default_branch)
action: :custom,
custom_message: "Default branch changed from #{previous_default_branch} to #{project.default_branch}"
).for_project.security_event
+
+ project.all_security_orchestration_policy_configurations.each do |configuration|
+ ::Security::SecurityOrchestrationPolicies::SyncScanResultPoliciesProjectService
+ .new(configuration)
+ .execute(project.id)
+ end
end
Edited by Dominic Bauer