Step Dependencies and block

I bumped into an issue when I was working with the step dependencies. I have a pipeline that looks like this:

  - label: ':aws: Deploy'
    trigger: 'deploy'
    key: "dev-deploy"

  - block

  - label: ':docker: Test'
    depends_on: "dev-deploy"
    plugins:
      - docker-compose#v3.0.3:
          run: tesst
          command: ["run", "tests/index.js"]

I would expect that the pipeline will pause after the deploy step and will wait for human input, however, block was skipped and the pipeline just continues with the test step.

Looking back at the doc I realized that block was not treated as wait and this is somehow expected behaviour. However, I must say this is very counter-intuitive and would possibly lead to confusions and all that.

Regards,
Kai

Hi @xiaket!

Yeah, this is a bit tricky. Because you’ve added an explicit depends_on to that later step, it’s assuming that the step only depends on what you’ve listed. To get the desired behaviour, you’ll need to be explicit about all of your dependencies:

  - label: ':aws: Deploy'
    trigger: 'deploy'
    key: "dev-deploy"

  - block: "Deploy to Test"
    key: "block-test-deploy"
    depends_on: "dev-deploy"

  - label: ':docker: Test'
    key: "test-deploy"
    depends_on: "block-test-deploy"
    plugins:
      - docker-compose#v3.0.3:
          run: tesst
          command: ["run", "tests/index.js"]

Or, for this simple example, you could just switch back to implicit dependencies:

  - label: ':aws: Deploy'
    trigger: 'deploy'

  - block

  - label: ':docker: Test'
    plugins:
      - docker-compose#v3.0.3:
          run: tesst
          command: ["run", "tests/index.js"]

There’s some more information about implicit and explicit dependencies in the documentation here:

1 Like