Skip to content

Danger: Fix CiJobsDependencyValidation when YAML cannot be retrieved

Peter Leitzen requested to merge pl-danger-ci-validation into master

What does this MR do and why?

In case of an API error, merged YAML should be an empty Hash and not empty Array. This API error can occur on forks because we cannot lint CI config on forks.

Refs !157028 (comment 1970735327) and !156716 (diffs, comment 1970737568)

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.

How to verify in CI?

See 💚 https://gitlab.com/gitlab-org/gitlab/-/jobs/7203325594

Initializing 912 jobs from master ci config...
no implicit conversion of nil into String
Initializing 0 jobs from pl-danger-ci-validation-test ci config...

Different error but that's fine.

Edited by Peter Leitzen

Merge request reports