Skip to content

Fix error creating pipeline with external policy CI

What does this MR do and why?

This fixes an error when creating a pipeline with a pipeline execution policy and an external CI file.

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

Screenshot_2024-01-08_at_13.30.31

How to set up and validate locally

  1. Create a new Group.
  2. Navigate to Settings -> General.
  3. Expand the Permissions and group features section.
  4. Enable the "Run customized CI YAML file as security policy actions" experiment.
  5. Create a new project in the group.
  6. Add a new file called 'ci.yml' to the project with content:
    Security Policy CI Job:
      stage: test
      script:
        - echo "This defined in a scan execution policy"
  7. Create another project in the group with a simple ci file:
    Job From Project CI:
      stage: test
      script:
        - echo "Ci job"
  8. Select Secure -> Policies -> New policy .
  9. Select Scan execution policy.
  10. Choose a name.
  11. Select Add new action.
  12. Select Run CI/CD code.
  13. Select Run linked existing CI file.
  14. Select the ci.yml file from the first project you created.
  15. Select Configure with a merge request and merge the MR.
  16. Go back to the previous project and start a new pipeline.
  17. This should work successfully without showing "Undefined error"..

Related to #437642 (closed)

Edited by Andy Schoenen

Merge request reports