Manual job does not block subsequent stages

I might be misunderstanding something or doing something incorrectly. I thought a manual job would block all the jobs in the subsequent stages as well.

I have this pipeline:

build:
    image: busybox:latest
    stage: build
    script: echo Build

manual:
    stage: test
    when: manual
    script:
      - echo Manual
      - sleep 60

deploy:
    stage: deploy
    script: echo Deploy

GitLab CI executed the build stage and the deploy stage even though the test stage is still waiting for my manual intervention to start the job.

The https://docs.gitlab.com/ee/ci/yaml/#when seems to indicate that it should wait for the succesfull execution of previous jobs.

But I think that there might be no order associated with the stages and you might need to add something like:

stages:
 - build
 - test
 - deploy

on top of the pipeline to indicate that order. See https://docs.gitlab.com/ee/ci/yaml/#stages

1 Like

I was pointed at the solution, one also needs to set allow_failure: false (it defaults to true)
A bit more info here

build:
    stage: build
    script: echo Build

test:
    stage: test
    when: manual
    allow_failure: false
    script: echo Test

deploy:
    stage: deploy
    script: echo Deploy

Thanks for the reply, but that’s not the case.
The stages are already ordered that way by the default, the problem was, as I was corrected in another channel, the allow_failure

1 Like