Closed toolmantim closed 5 years ago
This would be a really cool feature, thanks @toolmantim
:+1: I'd love to be able to have checkboxes, and even tie the skip field of future steps to them.
I'd love to have this to choose the service I want to deploy from a pipeline !
👍 any chance of this happening? This would save us so much time when doing targeted deploys.
Any update on this, it's one thing that's really missing right now.
+1
This would be really useful for us
This would be huge for our team - in AWS we have collections of Lambdas that make up various services and frequently we only want to alter a few at a time during a deploy. We currently have a cascading system of bash scripts and manual selections in place that allow us to selectively deploy updates but the code is ugly and the manual process is ... annoying :)
Would really like to see this feature. Have migrated this to their feature request board on buildkite community in the hope of some traction there too. https://forum.buildkite.community/t/support-a-list-of-checkboxes-in-block-fields/470
Hey folks, we're still putting together the docs proper, but this feature just rolled out! 🥳
You can now add a multiple: true
attribute to your select
fields, and they will show up as a list of checkboxes! On the meta-data side, rather than having a numbered set of meta-data fields, we delimit with a single newline character, so it's always just one meta-data value for you to work with, in a single call, and can be iterated over pretty simply!
@ticky awesome thanks :+1: just trying this out now, how does it interact with the default
attribute? I'd like all of them to be selected by default
@DuBistKomisch you can submit multiple values like this (please judge it not by the extremely contrived example 😅):
steps:
- block: "Release"
prompt: "Fill out the details for release"
fields:
- select: "Type"
key: "release-type"
multiple: true
default:
- "alpha"
- "canary"
- "beta"
- "stable"
options:
- label: "Alpha"
value: "alpha"
- label: "Canary"
value: "canary"
- label: "Beta"
value: "beta"
- label: "Stable"
value: "stable"
- command: "buildkite-agent meta-data get release-type"
derp should have tried that, anyway can confirm it's all working as expected :clap:
except I notice the hint
doesn't seem to show up, despite the docs using it in an example, was this broken with this change? @ticky
At the moment, if you want people to choose from a list of items with custom block fields it's very difficult. The common way people are doing it is pre-filling a textarea, and then asking people to remove any lines from the text area. And then using that value, split on newline, as the chosen options. This is error prone and a bit clunky.
A better way might be a way for people to use an array of checkbox options in the block form…
If you we had a new checkbox option, and someone used the
key
field ofservers-to-deploy
, and someone unblocked it selecting 2 of the 10 available options, the meta-data keys/values could be:To use those values, you could iterate over them using bash:
If nothing is selected, then there should be no
servers-to-deploy-count
key.