buildkite / feedback

Got feedback? Please let us know!
https://buildkite.com
25 stars 24 forks source link

Support a list of checkboxes in block fields #280

Closed toolmantim closed 5 years ago

toolmantim commented 6 years ago

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 of servers-to-deploy, and someone unblocked it selecting 2 of the 10 available options, the meta-data keys/values could be:

servers-to-deploy-count=2
servers-to-deploy-1=The First Server
servers-to-deploy-2=The Second Server

To use those values, you could iterate over them using bash:

if buildkite-agent meta-data exists "servers-to-deploy-count"; then
  for i in `seq 1 $(buildkite-agent meta-data get "servers-to-deploy-count")`; do
    echo "Deploying server $(buildkite-agent meta-data get "servers-to-deploy-${i}")..."
  done
fi

If nothing is selected, then there should be no servers-to-deploy-count key.

lucasteligioridis commented 6 years ago

This would be a really cool feature, thanks @toolmantim

DuBistKomisch commented 6 years ago

:+1: I'd love to be able to have checkboxes, and even tie the skip field of future steps to them.

nhuray commented 6 years ago

I'd love to have this to choose the service I want to deploy from a pipeline !

mcchas commented 6 years ago

👍 any chance of this happening? This would save us so much time when doing targeted deploys.

Ardesco commented 6 years ago

Any update on this, it's one thing that's really missing right now.

monemihir commented 5 years ago

+1

dkua commented 5 years ago

This would be really useful for us

JacobBarba commented 5 years ago

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 :)

ghost commented 5 years ago

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

ticky commented 5 years ago

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!

DuBistKomisch commented 5 years ago

@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

ticky commented 5 years ago

@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"

image

DuBistKomisch commented 5 years ago

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