Return early to avoid db queries checking for policy jobs

What does this MR do and why?

Return early to avoid db queries checking for policy jobs

This MR adds an early return in should_audit_security_policy_pipeline_failure? to avoid db queries and to improve code readability as suggested here.

References

Related to: !196628 (comment 2627496079)

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.

Merge request reports

Loading