Skip to content

Array types in .spec.inputs of .gitlab-ci.yml are broken for locally included files, as well as CI/CD components

Summary

Arrays do not function as inputs to locally included YAML files, nor do they work for externally included CI/CD components.

Proposal

This feature should be functional. In the meantime, since this feature is broken, it should be removed from the current documentation.

Current Behavior

With external CI/CD component specified in the following fashion:

spec:
  inputs:
    tags:
      type: array
      default: 
        - default
        - value
---
# Rest of component...

And consumed by a different project like so:

include
  - component: gitlab-fqdn/.../component-name@main
    inputs:
      tags: 
        - test
        - example

The GitLab pipeline editor reports the error: : header:spec:inputs:workflowrules input type unknown value: array

@metabytewien reported in #457207 (closed) that this is also the same behavior when using a local YAML file.

Documentation

Links/References

#457207 (closed) originally identified the issue of arrays being non-functional as inputs. Unfortunately, the documentation was updated to add arrays as inputs in all places. This is misleading to users as arrays currently do not work as inputs.