Skip to content

Sync approval rules for group policies when transferring a project

Martin Čavoj requested to merge 415925-fix-policies-for-project-transfer into master

What does this MR do and why?

This MR adds a sync of approval rules for inherited group policies when transferring a project. Before this fix, the approval project rules from inherited group policy wouldn't be deleted when project is being transferred outside of the hierarchy. This MR fixes it and also ensures that new group's policy rules (if any) are being created by enqueuing Security::ScanResultPolicies::SyncProjectWorker.

Recording

project_transfer

How to set up and validate locally

  1. Create two groups
  2. Create different policies in each group
  3. Create a project in one group
  4. Create MR which violates the policy
  5. Go to Settings -> General -> Advanced -> Transfer project to the second group
  6. Observe that MR rules correspond to the policy in the new group and the old rule is not enforced anymore

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #415925 (closed)

Edited by Martin Čavoj

Merge request reports