Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
parameters:
- name: AdditionalParameters
type: object
- name: DependsOn
type: object
default: null
Copy link
Copy Markdown
Member

@weshaggard weshaggard Mar 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is null a valid value? I don't see it mentioned anywhere at https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops. Should we just leave this as empty instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The challenge I'm having is that leaving it empty marks it as a required parameter, but defaulting it to [] means my ${{ if ... }} conditional won't work. Perhaps there's a better way?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you just set it to '' and then compare against that string in your condition?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But to your main question, it does work when empty. My understanding is it's a yaml object type, which I assume is a JSON object type, for which null is a valid field.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as it works in your testing I'm fine with this approach I just haven't seen it before and couldn't find any reference to null in the docs.

- name: CloudConfig
type: object
default: {}
Expand Down Expand Up @@ -37,6 +40,8 @@ jobs:
name: ${{ parameters.Pool }}
vmImage: ${{ parameters.OsVmImage }}
displayName: Generate Job Matrix
${{ if parameters.DependsOn }}:
dependsOn: ${{ parameters.DependsOn }}
steps:
# Skip sparse checkout for the `azure-sdk-for-<lang>-pr` private mirrored repositories
# as we require the github service connection to be loaded.
Expand Down