Comments (11)
I briefly discussed with @vtbassmatt and understand the scenario better now. Makes sense. I'll discuss further with Matt, so we can nail down the details in a spec somewhere (not strictly yaml; the core expression functions are available in other parts of the system too)
from azure-pipelines-yaml.
from azure-pipelines-yaml.
@ericsciple this seems like a decent addition to the expression language. Unless we already have something that will satisfy their scenario? (See the link above.)
from azure-pipelines-yaml.
/cc @RussKeldorph
from azure-pipelines-yaml.
@ericsciple Thank you for considering to add this feature!
Can't wait to have this in any form in the language and remove ugly workaround introduced by dotnet/coreclr#22173
from azure-pipelines-yaml.
@vtbassmatt @echesakovMSFT @sbomer @chcosta what do you think about this proposed behavior:
Join function
- Concatenates all elements in the right parameter array, separated by the left parameter string.
- Min parameters: 2. Max parameters: 2
- Each element in the array is converted to string. Complex objects are converted to empty string.
- If the right parameter is not an array, the result is empty string.
Or would this behavior be better:
- If the right parameter is not an array, the result is the right parameter converted to a string.
from azure-pipelines-yaml.
I like the second behavior for the right parameter. In this case, I can think about the function as the following two steps transformation:
- Convert the right parameter to an array of strings. If the original value is not an array, treat it as a singleton array (of one item).
- Join the resulting array of strings using the left parameter.
from azure-pipelines-yaml.
Yeah, now that you mention it, the silent conversion to an empty string would be confusing.
from azure-pipelines-yaml.
This will roll out with the m148 payload.
from azure-pipelines-yaml.
Is there any support to have an append to array. I see the support here converts an array to a string with a delimiter. However, the use case I'm looking for is to append to an array.
For example
- name: dependsOn
default:
- stage1
- stage2
- name: additionalDependsOn
default: stage0
result: ${{append(parameters.dependsOn, additionalDependsOn)}}
# where result is an array [stage1, stage2, stage0]
from azure-pipelines-yaml.
Is there any support to have an append to array. I see the support here converts an array to a string with a delimiter. However, the use case I'm looking for is to append to an array.
For example
- name: dependsOn default: - stage1 - stage2 - name: additionalDependsOn default: stage0 result: ${{append(parameters.dependsOn, additionalDependsOn)}} # where result is an array [stage1, stage2, stage0]
Update: I've added to feature requests here https://developercommunity.visualstudio.com/t/Function-to-append-to-a-yaml-Array/10166131?space=21&q=function+to+add+to+yaml+array&entry=myfeedback
from azure-pipelines-yaml.
Related Issues (20)
- How to use `Build.SourceVersionAuthor`? HOT 3
- by design there´s not available option in DeVops Service to create a new pipeline yaml for "existing" branch HOT 5
- deploy built artifacts in container uploads both checked out projects instead of right one HOT 2
- how to triger a build pipeline from powershell HOT 2
- Pipeline resource trigger documentation missing prerequisite HOT 1
- could find the branch error in azure yaml HOT 2
- python task ran successfull but pipeline is faiing with bash exit code 1 HOT 3
- Azure YAML Pipelines - Using template expression variables at non-global scope HOT 1
- Examples for resource pipeline and source inputs are not clear. HOT 9
- Hi Team While running my Azure pipeline.yaml I am getting following error: directive are not supported for the expression that are embedded within the string Directive are only supported when the entire value is an expression HOT 1
- This repo is missing important files
- It is possible to convert a json to variables/parameters YAML and iterate? HOT 3
- Support for conditions in templates? HOT 1
- Custom expression/function in Yaml HOT 1
- Azure DevOps YAML Template Powershell script file issue HOT 2
- Azure Pipelines Resource Trigger (branch filter) not working as expected. HOT 2
- GitHub Actions Build Error: Invalid App Path for Django-Celery-Beat Dockerfile HOT 3
- Error running pipeline after renaming default GitHub branch from 'master' to 'main' HOT 3
- Publishing artifacts from a failed step HOT 1
- Pass variables from Build pipeline to Release HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-pipelines-yaml.