Ref syntax for looking up plugin parameters in buildkite-agent meta-data
- Dominant language
- Go
- Stars
- 1.1k
- Forks
- 378
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 74
Description
I’ve been writing a lot of CloudFormation lately and using the intrinsic functions. I’ve also been factoring some of my Buildkite command steps into plugins so I can write more self documenting argument name value pairs.
I just built a one off feature into one of my plugins that I thought might be more generally applicable: using CloudFormation like `{ Ref: tag }` syntax as a plugin parameter to lookup a value in the `buildkite-agent meta-data get` key space. This is passed down to the plugin which can [detect by checking whether the `${PLUGIN}_{KEY}_REF` environment variable](https://github.com/keithduncan/kanikoctl-buildkite-plugin/blob/261d24e5f25e01ba0ee8f2b406c5ff7c260d2cc5/hooks/command#L58-L75) exists.
This would be particularly useful to pass `block` or `input` keys into plugin parameters without having an intermediate `buildkite-agent pipeline upload` to interpolate them:
What I have now:

If I wanted to parameterise the tags (supported for this field in my plugin):

While my `{ Ref: key }` syntax could be implemented in the agent, YAML tag syntax `!Ref` is ignored today and the contents are passed down to the agent without the tag. I _think_ that would yield a backwards compatible way to implement this. While someone could already be using `Ref` keys in their plugin parameters key path `!Ref` doesn’t work or exist today.
Contributor guide
Research direction
Start with the buildkite-agent meta-data get entry point and the plugin parameter handling described in the issue, then compare the existing YAML tag behavior with the proposed Ref form. Review the linked plugin hook to understand the expected environment-variable signal. Done should define compatible Ref lookup behavior for plugin parameters without changing ordinary parameters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, yaml
- Domain
- ci-cd, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100