Skip to content

Fix adding extra characters for pipeline execution policy

Artur Fedorov requested to merge 439346-yaml-editor-extra-characters into master

What does this MR do and why?

This MR fixes adding extra characters

Extra characters were added when yaml is parsed for scan execution policy for ci/cd action

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.

Description Video
Editing yaml in editor and loading from file Loom video

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Enable feature flag

Feature.enable(:compliance_pipeline_in_policies)
  1. Create a group

  2. Go to Settings -> General

  3. Toggle the Permissions and group features section

  4. Enable Run customized CI YAML file as security policy actions

  5. Go to Secure -> Policies

  6. Select New policy

  7. Select Scan execution policy

  8. Select Add new action

  9. Select Run CI/CD code

  10. Past the following code:

        test job:
            stage: test
  11. Observe that the YAML section on the right side contains:

    ci_configuration: |
      |-
        test job:
            stage: test

The correct YAML would be:

ci_configuration: |-
    test job:
        stage: test
  1. Create yaml file locally with same content
  2. Use load from file option and load content from created file

Related to #439346 (closed)

Edited by Artur Fedorov

Merge request reports

Loading