GitlabCI fetch dependencies in wrong order
<!---
Please read this!
Before opening a new issue, make sure to search for keywords in the issues
filtered by the "regression" or "bug" label.
For the Community Edition issue tracker:
- https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name%5B%5D=regression
- https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name%5B%5D=bug
For the Enterprise Edition issue tracker:
- https://gitlab.com/gitlab-org/gitlab-ee/issues?label_name%5B%5D=regression
- https://gitlab.com/gitlab-org/gitlab-ee/issues?label_name%5B%5D=bug
and verify the issue you're about to submit isn't a duplicate.
--->
### Summary
We use a list of dependencies in a build Job to fetch upstream changes. We thought, that the list of fetched dependencies is in Order, because it is a yaml array. It seems that this is not the case because the downloaded artifacts are applied out of order.
In our case it causes a problem because of build artifacts overriding each other in wrong order.
(I know this is a smell and I am working on a fix right now :smiley:)
### Steps to reproduce
Following gitlab ci configuration
```yml
build-installer:
stage: installer
retry: 2
script:
- echo "build installer"
dependencies:
- build
- reports
- package
```
results in following downloaded artifacts:
1. run
```
Downloading artifacts for package (57683)...
Downloading artifacts from coordinator... ok id=57683 responseStatus=200 OK token=kqihErhH
Downloading artifacts for build (57674)...
Downloading artifacts from coordinator... ok id=57674 responseStatus=200 OK token=kqihErhH
Downloading artifacts for reports (57677)...
Downloading artifacts from coordinator... ok id=57677 responseStatus=200 OK token=kqihErhH
```
2. run
```
Downloading artifacts for build (58398)...
Downloading artifacts from coordinator... ok id=58398 responseStatus=200 OK token=6uK1RE5M
Downloading artifacts for reports (58401)...
Downloading artifacts from coordinator... ok id=58401 responseStatus=200 OK token=6uK1RE5M
Downloading artifacts for package (58407)...
Downloading artifacts from coordinator... ok id=58407 responseStatus=200 OK token=6uK1RE5M
```
The order is different on every build.
### Example Project
Will try to setup a sample project later on.
### What is the current *bug* behavior?
see Steps to reproduce
### What is the expected *correct* behavior?
Two possibilities:
1. Apply the downloaded artifacts in order
1. Show a warn message if the downloaded artifacts override each other
### Relevant logs and/or screenshots
see Steps to reproduce
### Output of checks
Problem occurs on Gitlab Omnibus installation
#### Results of GitLab environment info
<details>
<summary>Expand for output related to GitLab environment info</summary>
<pre>
System information
System: Ubuntu 16.04
Proxy: no
Current User: git
Using RVM: no
Ruby Version: 2.5.3p105
Gem Version: 2.7.6
Bundler Version:1.16.6
Rake Version: 12.3.1
Redis Version: 3.2.12
Git Version: 2.18.1
Sidekiq Version:5.2.3
Go Version: go1.6.2 linux/amd64
GitLab information
Version: 11.6.3-ee
Revision: 76c33c6
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
DB Version: 9.6.8
URL: https://gitlab.ihr.infoniqa.local
HTTP Clone URL: https://gitlab.ihr.infoniqa.local/some-group/some-project.git
SSH Clone URL: git@gitlab.management.ihr.infoniqa.local:some-group/some-project.git
Elasticsearch: no
Geo: no
Using LDAP: yes
Using Omniauth: yes
Omniauth Providers: keycloak
GitLab Shell
Version: 8.4.3
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
</pre>
</details>
#### Results of GitLab application Check
<details>
<summary>Expand for output related to the GitLab application check</summary>
<pre>
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 8.4.3 ? ... OK (8.4.3)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... Server: ldapmain
LDAP authentication... Success
LDAP users with access to your GitLab server (only showing the first 100 results)
OMITTED
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory exists? ... yes
Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... 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: ...
4/3 ... yes
4/4 ... yes
3/5 ... yes
4/9 ... yes
4/11 ... yes
4/12 ... yes
4/14 ... yes
4/15 ... yes
4/18 ... yes
16/22 ... yes
3/25 ... yes
4/26 ... yes
4/27 ... yes
4/28 ... yes
4/29 ... yes
4/30 ... yes
16/33 ... yes
4/35 ... yes
4/36 ... yes
9/38 ... yes
4/40 ... yes
13/42 ... yes
4/43 ... yes
4/44 ... yes
4/45 ... yes
4/46 ... yes
4/48 ... yes
4/49 ... yes
4/50 ... yes
5/55 ... yes
4/56 ... yes
4/57 ... yes
4/58 ... yes
4/59 ... yes
4/60 ... yes
4/61 ... yes
4/62 ... yes
4/63 ... yes
4/64 ... yes
4/66 ... yes
4/69 ... yes
39/70 ... yes
4/73 ... yes
4/74 ... yes
4/75 ... yes
4/76 ... yes
4/77 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.5 ? ... yes (2.5.3)
Git version >= 2.18.0 ? ... yes (2.18.1)
Git user has default SSH configuration? ... yes
Active users: ... 17
Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
</pre>
</details>
### Possible fixes
issue