Introduce array index operator for CI/CD inputs

What does this MR do and why?

Introduce array index operator for CI/CD inputs

This change set introduces a new index operator [] for arrays when interpolating inputs.

For example (use it to try this out, too!):

spec:
  inputs:
    supported_versions:
      type: array
      default:
        - '2.0'
        - '1.0'
        - '0.1'
---

job:
  script:
    # Outputs: 'Latest version is 2.0'
    - echo 'Latest version is $[[ inputs.supported_versions[0] ]]'

It also supports the index operator on nested array values.

Changes are behind the ci_inputs_array_index_operator feature flag.

References

Refs Support array index operator `[]` for CI/CD inp... (#587657)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Timo Furrer

Merge request reports

Loading