Refactor scan execution policy logic using pipeline context

What does this MR do and why?

We want to align scan execution policies with pipeline execution policies when it comes to the bypass of the policy jobs with skip ci directive. Currently, pipeline execution policies are always forced and skip ci is ignored. However, scan execution policies are skipped.

In Allow users to configure skip ci behavior for p... (!173480 - merged), we're adding a configuration option to set the behavior in the policy and to allow certain users to be excepted from the enforcement.

In order to add this functionality to scan execution policies, we need to refactor the logic first. The whole feature is split up into 3 MRs:

Refactor scan execution policy logic using pipeline context

  • Move logic from Processor into ScanExecutionPolicies::PipelineContext
  • Add object to represent scan execution policy config

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

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

Related to #482952 (closed)

Edited by Martin Cavoj

Merge request reports

Loading