Check policy scope before syncing with project

What does this MR do and why?

When a security policy is updated, we call Security::SyncPolicyWorker calls Security::SyncProjectPolicyWorker for all projects in the group for which the policy was linked to. If the policy's scope is configured to not include specific projects, Security::SyncProjectPolicyWorker calls SyncProjectApprovalPolicyRulesService to sync the approval rules. But it is not needed as the policy is not applicable to the project. This MR fixes it by doing an early return

References

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sashi Kumar Kumaresan

Merge request reports

Loading