Pipeline Jobs With Identical Name Discarded

Summary

If you setup job 1 in a stage and define job 1, two jobs with the same name, in a subsequent stage, the first job get discarded.

Steps to reproduce

Use the following .gitlab-ci.yml in your project and see that the amount of jobs represented in the pipeline graph does not represent what is defined in the file.

What is the current bug behavior?

The first stage get 3 build, the last stage get 80, but test and package got nothing. But the file defines much more than that:

$ grep -c "stage: build" gitlab-ci.yml
83
$ grep -c "stage: test" gitlab-ci.yml
68
$ grep -c "stage: deploy" gitlab-ci.yml
80
$ grep -c "stage: package" gitlab-ci.yml
6

I know there's some weirdness in my gitlab-ci.yml but it is still valid (nothing told me otherwise).

It's probably not a UI bug because there's only 83 jobs that were created out of 230 something that are defined.

I suspect something didn't like that most job had the same name. In the deploy stage (the last stage defined in the file) you have from build 0 to build 79 and in the build stage you have build 80 to build 83. So basically, I got all my deploy jobs but all other jobs that had the same name are left out and since the only stage that has more jobs than deploy is build then you see the extra 3 jobs.

What is the expected correct behavior?

We should see a pipeline graph displaying the 230 something jobs defined in the file.

Relevant logs and/or screenshots

Screen_Shot_2017-04-19_at_5.54.48_PM

Results of GitLab environment info

# gitlab-rake gitlab:env:info

System information
System:     
Current User:   git
Using RVM:  no
Ruby Version:   2.3.3p222
Gem Version:    2.6.6
Bundler Version:1.13.7
Rake Version:   10.5.0
Redis Version:  3.2.5
Git Version:    2.10.2
Sidekiq Version:4.2.7

GitLab information
Version:    9.0.5
Revision:   a6b9899
Directory:  /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL:        http://gitlab.***.com
HTTP Clone URL: http://gitlab.***.com/some-group/some-project.git
SSH Clone URL:  git@gitlab.***.com:some-group/some-project.git
Using LDAP: no
Using Omniauth: no

GitLab Shell
Version:    5.0.0
Repository storage paths:
- default:  /var/opt/gitlab/git-data/repositories
Hooks:      /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git:        /opt/gitlab/embedded/bin/git

Results of GitLab application Check

# gitlab-rake gitlab:check SANITIZE=true
Checking GitLab Shell ...

GitLab Shell version >= 5.0.0 ? ... OK (5.0.0)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ... 
1/1 ... ok
1/2 ... ok
4/3 ... ok
4/4 ... ok
4/5 ... ok
4/6 ... ok
4/7 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Reply by email ...

Reply by email is disabled in config/gitlab.yml

Checking Reply by email ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ... 
1/1 ... yes
1/2 ... yes
4/3 ... yes
4/4 ... yes
4/5 ... yes
4/6 ... yes
4/7 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.3)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.10.2)
Active users: 3

Checking GitLab ... Finished

/cc @markglenfletcher @filipa

Assignee Loading
Time tracking Loading