Wait for manual stage finish and run dependent tasks

Hi, I created pipeline with 3 tasks:

  1. Test - always run
  2. Deploy - run manually
  3. After deploy - run after Deploy task is finished

I also created .gitlab-ci.yml for this using when and dependencies settings

stages:
  - test
  - deploy
  - after_deploy

test_task:
  stage: test
  image: alpine
  script:
    - echo test
  tags:
    - docker

waiting_for_interaction:
  stage: deploy
  image: alpine
  script:
    - echo run
  tags:
    - docker
  when: manual
  
after_interaction:
  stage: after_deploy
  image: alpine
  dependencies:
    - waiting_for_interaction
  script:
    - echo after
  tags:
   - docker

Task Deploy run only when I press Play button, but unfortunately After deploy doesn’t wait for Deploy, and run after Test stage. Can You please tell me, what is wrong with my configuration?

Manual actions are non-blocking by default. If you want to make manual action blocking, it is necessary to add allow_failure: false to the job’s definition in .gitlab-ci.yml.

https://docs.gitlab.com/ee/ci/yaml/#when-manual

This thread helped me to understand why users were allowed to click “Run/Play” on a manual job that was subsequent in the dependency tree even if the previous jobs had not been started. (they were all manual).

There appears to be now way to rectify this in the manual dependency job workflows.

Thanks, dude, that was in my case also the essence :slight_smile:
“allow_failure: false”!

A citation from the docs:

Additionally, if a manual job is defined as blocking by adding allow_failure: false , the next stages of the pipeline will not run until the manual job is triggered. This can be used as a way to have a defined list of users allowed to “approve” later pipeline stages by triggering the blocking manual job.