[go: up one dir, main page]

Artifacts not available / job "dependencies" ignored on separated builds

Hi,

Is the following a bug or a misunderstanding about artifacts that are supposed to be here "forever" by default?

Consider the following .gitlab-ci.yml:

stages:
  - step1
  - step2
  
job1:
  stage: step1
  only:
    - v1.0.0
  artifacts:
    paths:
      - .config
  script:
    - echo hello > .config
      
job2:
  stage: step2
  only:
    - v1.0.0
    - /.*-testing$/
  dependencies:
    - job1
  script:
    - cat .config

When I create tag v1.0.0, the 2 builds succeed:

Build 1 / Job 1 / Step 1:

gitlab-ci-multi-runner 1.2.0 (3a4fcd4)
Using Docker executor with image debian:jessie ...
Pulling docker image debian:jessie ...
Running on runner-607e97b1-project-673-concurrent-0 via 39714eb97060...
Cloning repository...
Cloning into '/builds/root/test-artifacts'...
Checking out 0a8b1fca as v1.0.0...
$ echo hello > .config
Uploading artifacts...
.config: found 1 matching files                    
Uploading artifacts to coordinator... ok            id=3907 responseStatus=201 Created token=Byt2z8Je

Build succeeded

Followed by Build 2 / Job 2 / step 2:

gitlab-ci-multi-runner 1.2.0 (3a4fcd4)
Using Docker executor with image debian:jessie ...
Pulling docker image debian:jessie ...
Running on runner-607e97b1-project-673-concurrent-0 via 39714eb97060...
Fetching changes...
Removing .config
HEAD is now at 0a8b1fc Update .gitlab-ci.yml
Checking out 0a8b1fca as v1.0.0...
Downloading artifacts for job1 (3907)...
Downloading artifacts from coordinator... ok        id=3907 responseStatus=200 OK token=Byt2z8Je
$ cat .config
hello

Build succeeded

Now if I create tag v1.0.1-testing, the only build supposed to run (job2) fails:

gitlab-ci-multi-runner 1.2.0 (3a4fcd4)
Using Docker executor with image debian:jessie ...
Pulling docker image debian:jessie ...
Running on runner-607e97b1-project-673-concurrent-0 via 39714eb97060...
Fetching changes...
Removing .config
HEAD is now at 0a8b1fc Update .gitlab-ci.yml
From https://git.int.krds.com/root/test-artifacts
 * [new tag]         v1.0.1-testing -> v1.0.1-testing
Checking out 0a8b1fca as v1.0.1-testing...
$ cat .config
cat: .config: No such file or directory

ERROR: Build failed: exit code 1
```

In the build log, the runner does not even try to download the artifacts and does not take into account the `dependencies` parameter set for the job at all.

I expect here the non-expiring artifacts of the `dependent` job to be downloaded and available in the build.

Let me know if this is a bug or a misuse of artifacts 

Rem: I do think this is a missing code case. In such case the runner should check for the artifacts of the latest "dependencies" builds run/available.

Let me know!

Thanks!