Pipeline is not "skipped" if using "needs"

Replace this template with your information

I am trying to implement pipeline with 3 stages, where 1st and 2nd stages are manual and 3rd is automatic. I want to use needs keyword to start job in 3rd stage as soon as possible.
This text will be hidden

The problem I’m facing is the following: when using needs parameter on 3rd job the pipeline is not considered as skipped and it is blocked until 1st and 2nd jobs are done.
Expected: jobs that declare needs on previous jobs which have when: manual should inherit “skipped” state if manual jobs hasn’t been started yet.
Actual: subsequent jobs with needs are treated as “created” or “running” and they keep pipeline “active”.

This is making impossible to have combination of when: manual with needs for jobs that run on merge requests since pipeline will always be blocking merge until all manuals with following needs jobs are resolved.

Is there a way to make pipeline skipped while using needs?

First example: using needs

Config:


stages:
    - build
    - deploy
    - postdeploy
    - another

build:
    stage: build
    script:
        - echo build
    when: manual

deploy:
    stage: deploy
    script:
        - echo deploy
    when: manual

postdeploy:
    stage: postdeploy
    script:
        - echo postdeploy
    needs:
        - deploy
    

And pipeline looks like “created”:

If only second job is manual then pipeline is stuck in “running” state even though second job is skipped and third job waits for it.

stages:
    - build
    - deploy
    - postdeploy
    - another

build:
    stage: build
    script:
        - echo build

deploy:
    stage: deploy
    script:
        - echo deploy
    when: manual

postdeploy:
    stage: postdeploy
    script:
        - echo postdeploy
    needs:
        - deploy
    


Even if 3rd job is marked as manual the pipeline still treated as “created”:

Config:

stages:
    - build
    - deploy
    - postdeploy
    - another

build:
    stage: build
    script:
        - echo build
    when: manual

deploy:
    stage: deploy
    script:
        - echo deploy
    when: manual

postdeploy:
    stage: postdeploy
    script:
        - echo postdeploy
    needs:
        - deploy
    when: manual
    


And the only way to make entire pipeline “skipped” is to remove needs and keep 3rd job when: manual:

stages:
    - build
    - deploy
    - postdeploy
    - another

build:
    stage: build
    script:
        - echo build
    when: manual

deploy:
    stage: deploy
    script:
        - echo deploy
    when: manual

postdeploy:
    stage: postdeploy
    script:
        - echo postdeploy
    when: manual

I have tried various combinations of rules, dependencies/needs and allow_failure. It doesn’t matter: as long as job has needs it keep pipeline “created” or “running” and not “skipped”.

  • *I am using gitlab.com
    • GitLab (Hint: /help): GitLab Enterprise Edition 13.4.0-pre 6698021aaa3
    • Runner (Hint: /admin/runners): N/A