Skip to content

WIP: Do deep merges of external (include) files with .gitlab_ci.yml

King Chung Huang requested to merge (removed):5078-ci-include-deep-merge into master

What does this MR do?

Changes the behaviour of the include keyword on .gitlab-ci.yml to combine external CI files and .gitlab-ci.yml using deep_merge.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

GitLab EE 10.5 introduced include in GitLab CI files, which allows for CI configurations to be defined outside of a repository's .gitlab-ci.yml and merged in. However, there is no way to customize included jobs (for example) without duplicating the entire job.

@ayufan suggested that CI files be merged using deep merge. This recursively merges hashes, instead of completely replacing hash key-values at the root level.

Note that deep merging of hashes does not merge arrays/lists.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #5078 (closed)

Edited by Mayra Cabrera

Merge request reports