buildkite / feedback

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

Blocked Pipeline Unblock Data #230

Closed jufemaiz closed 6 years ago

jufemaiz commented 7 years ago

Ref: https://github.com/buildkite/feedback/issues/213#issuecomment-275977898

As a buildkite-agent,
I want to have access to who unblocked a blocking step,
So I can use this information in the subsequent steps

Use cases include:

Obviously there's some issues with permissions (e.g. fail it, but the details are then in the branch if using pipeline.yml and hence they'll allow it on retry, though hopefully from a process perspective the failed build should raise eyebrows).

Current workaround recommended by @keithpitt:

The only way to find out at the moment is to figure out where the current job is in the pipeline using the BUILDKITE_JOB_ID env var, then work backwards until you find a block job, then inspect the unblocked_by on that.

keithpitt commented 7 years ago

Thanks for submitting this @jufemaiz! Those use cases sound like stuff we've bumped into ourselves before. Is one of those cases the problem you're trying to solve at the moment?

jufemaiz commented 7 years ago

@keithpitt we've just hit one area where I would like to ensure that there is an authorised list of users able to unblock (in our case it's infrastructure via terraform builds, but we will have another in the coming months which is around delivery of a complete platform for partners, which needs a commercial sign off so we don't want to have unauthorised users hitting go).

We'd also like to be able to use the details of the user who unblocked it to notify them directly, notify the head of product/infrastructure and notify myself that person X has unblocked a step.

keithpitt commented 7 years ago

@jufemaiz cool cool - thanks for explaining for me!

Is the work around working OK for the moment? (Even thought it's a little yucky)

jufemaiz commented 7 years ago

@keithpitt haven't quite implemented it yet, still designing it :)

keithpitt commented 7 years ago

No worries :) Lemme know how it goes!

ineffyble commented 7 years ago

This sounds pretty neat, we're starting to look at using Buildkite with Terraform and would definitely value this functionality.

toolmantim commented 6 years ago

We've just added the environment variables ​BUILDKITE_UNBLOCKER, BUILDKITE_UNBLOCKER_UUID and BUILDKITE_UNBLOCKER_TEAMS to build jobs after a block step 🎉 ​https://buildkite.com/docs/pipelines/environment-variables

SEAPUNK commented 5 years ago

I see it in the documentation, and I tried to use this, but it's not showing up? I unblock a step, but the environment variable doesn't show up in the job that comes after the block.

ticky commented 5 years ago

@SEAPUNK that’s odd, it should be there - do you want to shoot Support an email with a link to the build you’re seeing this happen in?

SEAPUNK commented 5 years ago

Yeah, I contacted support, and they fixed it. Thanks!