Skip to content

Refactor `MultiDocYaml` loader

Avielle Wolfe requested to merge 383375-improve-multi-doc-yaml into master

What does this MR do and why?

This MR makes several improvements to MultiDocYaml:

  1. It refactors MultiDocYaml to use Loader::Yaml to load each document instead of duplicating the logic in Loader::Yaml
  2. It updates MultiDocYaml to work for document separators with additional characters in the same line:
    version: 3.0.0
    --- !test/content
    job_x:
      script: ls
  3. It updates MultiDocYaml to ignore documents that only contain comments (some existing GitLab maintained CI templates include documents that only have comments):
    version: 3.0.0
    ---
    # This document will be ignored
    ---
    job_x:
      script: ls

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #383375 (closed)

Merge request reports

Loading