Skip to content

Ignore project CI when pipeline execution policy using `override_project_ci` strategy

What does this MR do and why?

This ignores project CI/CD config if a pipeline execution policy is using the override_project_ci strategy. This avoids pipeline failures if a project CI is invalid.

This MR is based on !159124 (merged) and should be merged after it.

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.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Create a group
  2. Create a project in the group
  3. Add a simple CI/CD config file to the project.
    # policy-ci.yml
    build:
      stage: .pipeline-policy-pre
      script:
        - echo "Do your build here"
  4. Go back to the group.
  5. On the projects left sidebar, select Security & Compliance and Policies.
  6. Select New Policy
  7. Select Pipeline execution policy
  8. Choose a name for the policy
  9. In the Actions section, choose Override and select the project and policy-ci.yml file you created in step 2. and 3.
  10. Select Update via Merge Request.
  11. Merge the MR.
  12. Go back to the group.
  13. Create a new project
  14. Add an invalid .gitlab-ci.yml:
    # .gitlab-ci.yml
    asdf
  15. Go to Build and Pipelines.
  16. Start a new pipeline.
  17. The pipeline should start without error and only contain the build job defined in the pipeline execution policy.

Related to #471726 (closed)

Edited by Andy Schoenen

Merge request reports

Loading