buildkite / feedback

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

It appears that a block step is also a wait step, can I change this? #407

Closed gerrywastaken closed 4 years ago

gerrywastaken commented 6 years ago

Given the following pipeline

steps:
  - command: echo "tests"
  - block: ":shipit: staging"
  - command: echo "staging deploy" && sleep 30 && exit 1
  - block: ":shipit: prod"
  - command: echo "blocked by staging deploy"

After all stages are unblocked we end up with the last command waiting for the second command to successfully exit, even though no wait step was specified.

block_step_also_waits

The docs for wait specify:

A wait step waits for all previous steps to have successfully completed before allowing following jobs to continue.

The docs for block:

A block step is used to pause the execution of a build and wait on a team member to unblock it via the web or the API.

But perhaps a more appropriate description is:

A block step is used to pause the execution of a build and wait for both a team member to unblock it via the web or the API; and for all previous steps to have successfully completed.

The docs do say this:

Once all steps before the block have completed, the pipeline will pause and wait for a team member to unblock it.

But that's not the same as saying it will cause a wait regardless of it's blocked state. This is also a problem because block does not support continue_on_failure.

Is there any way for block to only wait to be unblocked and not wait for success of previous steps?

andreitchaltsev commented 5 years ago

I bumped into exactly the same issue. Is there a solution to remove "wait" feature from "block" step?

nikskiz commented 4 years ago

After some trail and error I have managed to get a block step to work so it is not dependant on any other block steps:

steps:
  - block: " Test 1"
    depends_on: ~
    key: "test-1"

  - label: TEST 1
    commands:
      - echo "test 1"
    depends_on: "test-1"

  - block: " Test 2"
    depends_on: ~
    key: "test-2"

  - label: TEST 2
    commands:
      - echo "test 2"
    depends_on: "test-2"

  - block: ":amazon-rds: Test 3"
    depends_on: ~
    key: "test-3"

  - label: TEST 3
    commands:
      - echo "test 3"
    depends_on: "test-3"
harrietgrace commented 4 years ago

As well as using the depends_on attribute, there are also input steps available. They perform the same function as block steps, but without creating dependencies on other steps. Input steps will block your build from completing, but will not automatically block other steps from running unless they specifically depend upon it.

I'm going to close this issue, but if you run into any trouble getting dependencies or input steps working, please shoot through an email to us at support@buildkite.com and we can help you get it sorted! 🙏🏻

gerrywastaken commented 4 years ago

@harrietgrace It's been more than a year since I've used Buildkite, but from memory an input step didn't work in the same way as a block step and won't output something like [user] unblocked [step] (maybe I'm wrong). So this seems like a bit of a work around. I'm glad to see the docs have been updated though and I appreciate the response.