Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Pipelines: how to provide custom keys from YAML?

Radu Cristescu April 22, 2025

I'm developing a dynamic pipeline and I just noticed that the input request is filtered, and it doesn't include any custom keys.

What are some good ways for the bitbucket-pipelines.yml file of a repository to communicate some settings, needs, and desires to the dynamic pipeline function?

At the moment, for the `script:` key I can look for a special keyword (DSL), and replace it with one or more commands (e.g to wait for a db and initialise it, but without copying those commands to every repository that needs the database in the pipeline). If I see the database keyword, then I can also inject a database service in the `definitions:services:`.

I could use special keywords in `script:` for other things too, like running `npm` stuff for frontend projects.

But if I wanted the repository to communicate to me that it wants to do a cartesian product between several PHP versions and several Laravel versions, how would I do that without typing all the combinations into different steps - even if I were to then use DSL to expand the command list?

At the most extreme, I'd like to have no entries under `pipelines:` and populate them with stuff that was declared by other means.

I guess, lacking any other options, I could have a special step with just DSL in it, and in my pipeline I interpret it, remove it, and add the actual steps.

1 comment

Comment

Log in or Sign up to comment
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 22, 2025

Hello @Radu Cristescu

We only send recognised syntax to the Dynamic Pipelines provider (as in, we fully parse the configuration file and then send its serialised version), so all custom properties are indeed filtered out. There are a few reasons for this, so this is part of our contract.

However, there is a top-level labels property which is an arbitrary key-value storage and is passed as is. You might be able to utilise it for some of the customisations you mentioned. Unfortunately this is currently the only place for custom properties. We're considering extending this feature but it is not the top priority at the moment.

Hope this helps.

Cheers,
Daniil

Like Radu Cristescu likes this
Radu Cristescu April 22, 2025

Thanks. `labels` may be good enough for now. If I find myself needing custom annotations at certain points of the pipeline configuration, I could make a mirror structure in `labels` to provide this additional information, or something along those lines. Combined with some DSL processing, I should have quite a bit of power now.

Like Daniil Penkin likes this
TAGS
AUG Leaders

Atlassian Community Events