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
- Create a group
- Create a project in the group
- Add a simple CI/CD config file to the project.
# policy-ci.yml build: stage: .pipeline-policy-pre script: - echo "Do your build here"
- Go back to the group.
- On the projects left sidebar, select Security & Compliance and Policies.
- Select New Policy
- Select Pipeline execution policy
- Choose a name for the policy
- In the Actions section, choose
Override
and select the project andpolicy-ci.yml
file you created in step 2. and 3. - Select Update via Merge Request.
- Merge the MR.
- Go back to the group.
- Create a new project
- Add an invalid
.gitlab-ci.yml
:# .gitlab-ci.yml asdf
- Go to Build and Pipelines.
- Start a new pipeline.
- 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