Refactor pipeline policy context to be more generic

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 pipeline policy context to be more generic:

  • Add ExecutionPolicies module in addition to PipelineExecutionPolicies that can be later used to encapsulate logic for ScanExecutionPolicies
  • Delegate existing methods to PipelineExecutionPolicies

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