Your Location is: Home > Gitlab

Question about lines connecting jobs in graphic representation of GitLab CI pipeline

From: Greece View: 4339 Learner 

Question

Here is a screenshot showing part of my pipeline (censored):

enter image description here

It might be a stupid question, but why sometimes lines that are connecting the jobs are nice, like that:

enter image description here

and sometimes they are all tangled up, like here:

enter image description here

What does it depend on? All jobs in the stage "B" on the right have defined:

needs:
  - A1

so why job A1 is connected with B1, B2 and B3 but A2 is connected only with B1? What can I do to "untangle" those lines? That is, how to make A2 connected with nothing on the right side, or with everything - not only with B1.

Here is .gitlab-ci.yml (censored/anonymised)

stages:
  - A
  - B

A1:
  stage: A
  script:
    - something
  cache:
    paths:
      - some_cache
    policy: pull
  needs:
    - some_job_from_previous_stage_not_shown_here

A2:
  stage: A
  script:
    - something
  cache:
    paths:
      - some_cache
    policy: pull
  needs:
    - some_previous_job
  allow_failure: true

B1:
  stage: B
  script:
    - something
  cache:
    paths:
      - some_cache
    policy: pull
  needs:
    - A1

B2:
  stage: B
  script:
    - something
  cache:
    paths:
      - some_cache
    policy: pull
  needs:
    - A1

B3:
  stage: B
  script:
    - something
  cache:
    paths:
      - some_cache
    policy: pull
  needs:
    - A1

Best answer

This is currently as intended. GitLab have an Epic to resolve this, which you can follow here, along with the associated issues: