Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Use .asArray/.asString syntax for scenarios and helixQueues #22173

Merged
merged 1 commit into from
Jan 24, 2019
Merged

Use .asArray/.asString syntax for scenarios and helixQueues #22173

merged 1 commit into from
Jan 24, 2019

Conversation

echesakov
Copy link

@echesakov echesakov commented Jan 24, 2019

As far as I know, there is no way in Yaml to convert between comma-separated strings and arrays (i.e. neither String.Join(",", items) nor str.Split(',') are available). As an unfortunate workaround, I propose to use the .asString/.as Array syntax for properties that are needed in both formats.

As an example, right now we are using scenarios and helixQueues* properties only as an MSBuild input (i.e. comma-separated string passed as MSBuild properties).

For the purpose of enabling test publishing to Azure DevOps using officially supported task we would need to iterate over Helix queues and scenarios to call the task multiple times so we would those to be array values.

@echesakov
Copy link
Author

@vtbassmatt @chcosta Matt Chris can you please confirm that there is no better way of doing this?

What I need is a function like String.Join(",", items) that I can call on array items and get comma-separated string of items values during template evaluation time.

@echesakov
Copy link
Author

echesakov commented Jan 24, 2019

I opened issue microsoft/azure-pipelines-yaml#90 asking this question a month ago - but not sure if was a right repo for asking though

@vtbassmatt
Copy link

I don't think we have anything that'll do it right now. Implicit casting might get you part of the way there (and even that, I'm not sure about) but it would include a bunch of quotation marks and brackets that you don't want.

Copy link
Member

@sbomer sbomer left a comment

Choose a reason for hiding this comment

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

I noticed one missing helix queue. Other than that LGTM. Thanks!

eng/platform-matrix.yml Show resolved Hide resolved
@echesakov echesakov merged commit 9ba6f7b into dotnet:master Jan 24, 2019
@echesakov echesakov deleted the UseAsArrayAsStringSyntax branch January 24, 2019 18:25
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants