Skip to content

Re-fix boolean and number input types

Avielle Wolfe requested to merge 434826-fix-number-and-boolean-inputs-2 into master

What does this MR do and why?

This MR re-adds the fix that prevents boolean and number types being cast to strings. The original fix caused an incident because it did not account for multiple interpolation blocks in a single node and was only interpolating the first block. This MR updates the interpolation logic to use scan instead of match so we interpolate all blocks.

Changelog: fixed

Issue: #434826 (closed)

Screenshots or screen recordings

Before After
Screenshot 2024-02-21 at 13.40.19.png Screenshot 2024-02-21 at 13.41.35.png

How to set up and validate locally

  1. Enable the ci_fix_input_types feature flag

  2. Create an included.yml file in the root directory of a project. Give it the following content

    spec:
      inputs:
        a:
        b:
        c:
    ---
    my-job:
      script: echo "$[[ inputs.a ]] $[[ inputs.b ]] $[[ inputs.c ]]"
  3. Put this content in the pipeline editor:

    include:
      - local: included.yml  
        inputs:
          a: 'a'
          b: 'b'
          c: 'c'
  4. See that the Full configuration tab shows the echo statement as echo "a b c"

Edited by Avielle Wolfe

Merge request reports