microsoft / azure-pipelines-yaml

Azure Pipelines YAML examples, templates, and community interaction
MIT License
1.19k stars 924 forks source link

Coalesce operator breaks iteration of objects in nested array #569

Open jadzdtc opened 2 years ago

jadzdtc commented 2 years ago

Following pipeline won't run

parameters:
- name: array
  type: object  
  default:
  - nestedArray: 
    - nestedArrayObject: foo
    - nestedArrayObject: bar
- name: otherArray
  type: object  
  default:
  - bar
  - baz

jobs:
- ${{ each item in parameters.array }}:
  - ${{ each nestedItem in coalesce(item.nestedArray, parameters.otherArray) }}: 
    - job: baz

yielding error: image

If coalesce operator is removed, pipeline works as expected (fails due to not unique job names). Also if nested array consist of simple types, there will be no type conversion issues.

Please fix this behavior cause it is not obvious why such a construct would not work.

vmapetr commented 2 years ago

@jadzdtc Thanks for reporting! We are working on more prioritized issues now but will get back to this one soon.