Manual job depending on another manual job: Dependency is ignored

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

We have a testing and a deploy job which should run for scheduled (nightly) builds only. However, to be able to trigger them manually as well (in case you are interested for a specific branch), we also have them as manual job.

The deployment job should depend on the testing job, i.e. it should not be possible to deploy something which was not tested. However, the manual deployment job ignores the state of the testing job.

I have a CI yaml similar to this one:

stages:
  - build
  - test
  - deploy

BuildJob:
  stage: build
  tags:
    - docker
  script:
    - echo "building"
    
#
# Test stage
#
TestJob-manual:
  extends: .TestJob-template
  when: manual

TestJob-scheduled:
  extends: .TestJob-template
  only:
    - schedules

.TestJob-template:
  stage: test
  tags:
    - docker
  script:
    - echo "testing"
    
#
# Deploy stage
#
DeployJob-manual:
  extends: .DeployJob-template
  when: manual
  dependencies:
    - TestJob-manual

DeployJob-scheduled:
  extends: .DeployJob-template
  only:
    - schedules
  dependencies:
    - TestJob-scheduled
    
.DeployJob-template:
  stage: deploy
  tags:
    - docker
  script:
    - echo "deploying"

When pressing on play on the deployment job, I got no "dependency missing" error but the job just ran through image

What is the current bug behavior?

The deployment job runs trough without the testing job being called

What is the expected correct behavior?

When pressing "Play" for the deployment job, either

A) The deployment job fails with a "dependencies missing" error

or (the preferred way):

B) The testing job is triggered and then the deployment runs

When pressing "Play" for the test job,

  1. The test job should run
  2. When it is finished, the deploy job should start
Edited Jun 09, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading