Manual jobs in 2 different stages with "needs" relation are skipped

Issue -
I have a job in stage 1 and one in stage 2
stage 2 is followed by stage 1 in stage ordering
stage 1 job is marked as “manual”
stage 2 job “needs” stage 1 job to complete
when the pipeline runs, i see stage 1 job can be started manually (there’s a gear icon)
however stage 2 job is skipped.
even after completion of stage 1 job, stage 2 job remains skipped, and can never be started.

Question - is it a limitation, bug or my expectations are not right

1 Like

Hi @sits
you need to define allow_failure: false for the manual job.
See this GitLab blog which explains the behavior.

Hi @balonik

Thanks for reply.
Setting allow_failure to false, will block the pipeline. Since these manual jobs are supposed to be optional, pipeline should show as passed. Here’s how my pipeline looks . pre-build is auto stage with one job, followed by build stage (all jobs manual), followed by deploy (which have needs relation with each of the build stage). setting allow_failure to deploy jobs won’t make difference anyway, and as i mentioned earlier, setting it to false for build jobs, will block pipeline. can we do anything about it ?


stages:
  - pre-build
  - build
  - deploy

PreBuild1:
  stage: pre-build
  script:
    - echo "PreBuild1"

Build1:
  interruptible: true
  stage: build
  needs:
    - PreBuild1
  rules:
    - if: '$CI_PIPELINE_SOURCE == "web" && $V1 == "t1"'
    - if: '$CI_COMMIT_REF_NAME == "d"'
    - if: '$CI_COMMIT_REF_NAME != "d"'
      when: manual
      allow_failure: true
  script:
    - echo "Build1"

Build2:
  interruptible: true
  rules:
    - if: '$CI_PIPELINE_SOURCE == "web" && $V1 == "t2"'
    - if: '$CI_COMMIT_REF_NAME == "d"'
    - if: '$CI_COMMIT_REF_NAME != "d"'
      when: manual
      allow_failure: true
  stage: build
  needs:
    - PreBuild1
  script:
    - echo "Build2"

Build3:
  interruptible: true
  stage: build
  needs:
    - PreBuild1
  rules:
    - if: '$CI_PIPELINE_SOURCE == "web" && $V1 == "t3"'
    - if: '$CI_COMMIT_REF_NAME == "m"'
    - if: '$CI_COMMIT_REF_NAME != "m"'
      when: manual
      allow_failure: true
  script:
    - echo "Build3"


Deploy1:
  stage: deploy
  script:
    - echo "Deploy1"
  needs:
    - Build1
  rules:
    - if: '$CI_PIPELINE_SOURCE == "web" && $V1 == "t1"'
    - if: '$CI_COMMIT_REF_NAME == "d"'
    - if: '$CI_COMMIT_REF_NAME != "d"'
      when: manual
      allow_failure: false

Deploy2:
  stage: deploy
  script:
    - echo "Deploy2"
  needs:
    - Build2
  rules:
    - if: '$CI_PIPELINE_SOURCE == "web" && $V1 == "t2"'
    - if: '$CI_COMMIT_REF_NAME == "d"'
    - if: '$CI_COMMIT_REF_NAME != "d"'
      when: manual
      allow_failure: false

Deploy3:
  stage: deploy
  script:
    - echo "Deploy3"
  needs:
    - Build3
  rules:
    - if: '$CI_PIPELINE_SOURCE == "web" && $V1 == "t3"'
    - if: '$CI_COMMIT_REF_NAME == "m"'
    - if: '$CI_COMMIT_REF_NAME != "m"'
      when: manual
      allow_failure: false

@sits I have about the same problem, did you find a solution?

1 Like