CI report artifacts unavailable to subsequent CI stages/jobs
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
Report artifacts aren't made available to subsequent CI job runs like normal artifacts. This particular issue may land more on the feature request side of things (I'm happy to update this if that's the case), but I'm not sure so I'm starting here.
Steps to reproduce
Using SAST on a Python project I created
stages:
- test
- report
include:
- template: Security/SAST.gitlab-ci.yml
sast_report:
stage: report
image: python:3.8
script:
- ls -alhR
- ./parse-sast.py *.json
dependencies:
- bandit-sast
- eslint-sast
- secrets-sast
but none of the SAST reports are available to sast_report:
$ ls -alhR
.:
total 24K
drwxrwxrwx 5 root root 180 Sep 1 04:03 .
drwxrwxrwx 4 root root 48 Sep 1 04:03 ..
drwxrwxrwx 2 root root 24 Sep 1 04:03 .devcontainer
-rw-rw-rw- 1 root root 32 Sep 1 04:03 .dockerignore
drwxrwxrwx 6 root root 113 Sep 1 04:03 .git
-rw-rw-rw- 1 root root 17 Sep 1 04:03 .gitignore
-rw-rw-rw- 1 root root 1.2K Sep 1 04:03 .gitlab-ci.yml
-rw-rw-rw- 1 root root 208 Sep 1 04:03 Dockerfile
-rwxrwxrwx 1 root root 2.0K Sep 1 04:03 parse-sast.py
-rw-rw-rw- 1 root root 91 Sep 1 04:03 requirements.txt
drwxrwxrwx 2 root root 39 Sep 1 04:03 templates
./.devcontainer:
total 4K
drwxrwxrwx 2 root root 24 Sep 1 04:03 .
drwxrwxrwx 5 root root 180 Sep 1 04:03 ..
-rw-rw-rw- 1 root root 713 Sep 1 04:03 Dockerfile
./.git:
total 16K
drwxrwxrwx 6 root root 113 Sep 1 04:03 .
drwxrwxrwx 5 root root 180 Sep 1 04:03 ..
-rw-rw-rw- 1 root root 206 Sep 1 04:03 FETCH_HEAD
-rw-rw-rw- 1 root root 41 Sep 1 04:03 HEAD
-rw-rw-rw- 1 root root 277 Sep 1 04:03 config
-rw-rw-rw- 1 root root 809 Sep 1 04:03 index
drwxrwxrwx 3 root root 17 Sep 1 04:03 lfs
drwxrwxrwx 3 root root 30 Sep 1 04:03 logs
drwxrwxrwx 33 root root 320 Sep 1 04:03 objects
drwxrwxrwx 6 root root 63 Sep 1 04:03 refs
./.git/lfs:
total 0
drwxrwxrwx 3 root root 17 Sep 1 04:03 .
drwxrwxrwx 6 root root 113 Sep 1 04:03 ..
drwxrwxrwx 2 root root 6 Sep 1 04:03 tmp
./.git/lfs/tmp:
total 0
drwxrwxrwx 2 root root 6 Sep 1 04:03 .
drwxrwxrwx 3 root root 17 Sep 1 04:03 ..
./.git/logs:
total 4K
drwxrwxrwx 3 root root 30 Sep 1 04:03 .
drwxrwxrwx 6 root root 113 Sep 1 04:03 ..
-rw-rw-rw- 1 root root 237 Sep 1 04:03 HEAD
drwxrwxrwx 3 root root 21 Sep 1 04:03 refs
./.git/logs/refs:
total 0
drwxrwxrwx 3 root root 21 Sep 1 04:03 .
drwxrwxrwx 3 root root 30 Sep 1 04:03 ..
drwxrwxrwx 3 root root 20 Sep 1 04:03 remotes
./.git/logs/refs/remotes:
total 0
drwxrwxrwx 3 root root 20 Sep 1 04:03 .
drwxrwxrwx 3 root root 21 Sep 1 04:03 ..
drwxrwxrwx 2 root root 20 Sep 1 04:03 origin
./.git/logs/refs/remotes/origin:
total 4K
drwxrwxrwx 2 root root 20 Sep 1 04:03 .
drwxrwxrwx 3 root root 20 Sep 1 04:03 ..
-rw-rw-rw- 1 root root 305 Sep 1 04:03 master
./.git/objects:
total 0
drwxrwxrwx 33 root root 320 Sep 1 04:03 .
drwxrwxrwx 6 root root 113 Sep 1 04:03 ..
drwxrwxrwx 2 root root 52 Sep 1 04:03 0c
drwxrwxrwx 2 root root 52 Sep 1 04:03 24
drwxrwxrwx 2 root root 52 Sep 1 04:03 2c
drwxrwxrwx 2 root root 52 Sep 1 04:03 32
drwxrwxrwx 2 root root 52 Sep 1 04:03 36
drwxrwxrwx 2 root root 52 Sep 1 04:03 3c
drwxrwxrwx 2 root root 52 Sep 1 04:03 46
drwxrwxrwx 2 root root 52 Sep 1 04:03 53
drwxrwxrwx 2 root root 52 Sep 1 04:03 55
drwxrwxrwx 2 root root 52 Sep 1 04:03 5a
drwxrwxrwx 2 root root 52 Sep 1 04:03 5b
drwxrwxrwx 2 root root 52 Sep 1 04:03 5c
drwxrwxrwx 2 root root 52 Sep 1 04:03 65
drwxrwxrwx 2 root root 98 Sep 1 04:03 6a
drwxrwxrwx 2 root root 52 Sep 1 04:03 75
drwxrwxrwx 2 root root 52 Sep 1 04:03 86
drwxrwxrwx 2 root root 52 Sep 1 04:03 8c
drwxrwxrwx 2 root root 52 Sep 1 04:03 97
drwxrwxrwx 2 root root 52 Sep 1 04:03 9e
drwxrwxrwx 2 root root 52 Sep 1 04:03 9f
drwxrwxrwx 2 root root 52 Sep 1 04:03 a6
drwxrwxrwx 2 root root 52 Sep 1 04:03 aa
drwxrwxrwx 2 root root 52 Sep 1 04:03 c8
drwxrwxrwx 2 root root 52 Sep 1 04:03 c9
drwxrwxrwx 2 root root 52 Sep 1 04:03 cf
drwxrwxrwx 2 root root 52 Sep 1 04:03 e4
drwxrwxrwx 2 root root 52 Sep 1 04:03 f4
drwxrwxrwx 2 root root 52 Sep 1 04:03 f9
drwxrwxrwx 2 root root 52 Sep 1 04:03 fd
drwxrwxrwx 2 root root 6 Sep 1 04:03 info
drwxrwxrwx 2 root root 6 Sep 1 04:03 pack
./.git/objects/0c:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 897 Sep 1 04:03 3a4c39e597735bae09ed9c1a057332fe0fbb58
./.git/objects/24:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 306 Sep 1 04:03 121b5405c270121f4d02e7f325ff361b86c216
./.git/objects/2c:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 828 Sep 1 04:03 3f893b6c89c48a96068716dd657c6d3e3be415
./.git/objects/32:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 306 Sep 1 04:03 9006c1eaa146ce2c6fc7857e97c9d8bb849812
./.git/objects/36:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 306 Sep 1 04:03 242f6ecc6786e8764b014decfabdd34b01b98c
./.git/objects/3c:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 427 Sep 1 04:03 ffeec8fa3517f123c531764a600b2e2a98b9c5
./.git/objects/46:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 430 Sep 1 04:03 93b955c6e2735f05df6d237c79acea02787121
./.git/objects/53:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 307 Sep 1 04:03 bff8fe850cc2d4753e93e8c104b6255d1b2ae7
./.git/objects/55:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 391 Sep 1 04:03 25a1f09ee96155172ebce492fe9f2a239d0f0d
./.git/objects/5a:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 70 Sep 1 04:03 dec5997b1a3d59927d3f65e9f1e9820a236003
./.git/objects/5b:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 306 Sep 1 04:03 e58425e7a960d37aab4ee95da8b248f37a97c8
./.git/objects/5c:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 272 Sep 1 04:03 ea82fe4da648de53aaa25ab0e64d622eea3e3d
./.git/objects/65:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 462 Sep 1 04:03 ad58a5d6fee39fc9de4cae459a153f98c2993f
./.git/objects/6a:
total 8K
drwxrwxrwx 2 root root 98 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 33 Sep 1 04:03 2ec5fcc3cb28c481f4c9509c2fc820d1d4c78f
-r--r--r-- 1 root root 844 Sep 1 04:03 485b6966636c17b5b0b8104e05086c48752fa0
./.git/objects/75:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 306 Sep 1 04:03 4790863cd2bed2227db42a72a9a84905cf1ed2
./.git/objects/86:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 788 Sep 1 04:03 6581d96704e9854a3db2d01d873ac52a40122c
./.git/objects/8c:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 840 Sep 1 04:03 3b0bfcc4346f6f69122253d4ffb70e64d9665c
./.git/objects/97:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 98 Sep 1 04:03 367be25abb4b69d398cffab5e6d8b5ece187a8
./.git/objects/9e:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 434 Sep 1 04:03 e17e21a60c81d35b3a2a0b63605046c302811c
./.git/objects/9f:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 834 Sep 1 04:03 e5e55b13950acbf0d856777c4ea1e4063c8575
./.git/objects/a6:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 48 Sep 1 04:03 043b73518d271b7c0b08b4ffccb832c1d9c734
./.git/objects/aa:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 832 Sep 1 04:03 7633484dd7406997b893872435310f3f830226
./.git/objects/c8:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 313 Sep 1 04:03 581d5b697ac3787dc8235d76e4db7b38dd1bdc
./.git/objects/c9:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 168 Sep 1 04:03 0092d419a344e66ae80b4262c3c457c7f07ba5
./.git/objects/cf:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 452 Sep 1 04:03 57f5681aa23ea6f407c1419eb743c3f6672f9c
./.git/objects/e4:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 434 Sep 1 04:03 95f2e6353d3dbd9ac450005f023e1aa53cc861
./.git/objects/f4:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 55 Sep 1 04:03 b4ce718f74662884a29cef4b4f386f110e4031
./.git/objects/f9:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 306 Sep 1 04:03 580a490957f3371531642ff14bd096e723edad
./.git/objects/fd:
total 4K
drwxrwxrwx 2 root root 52 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
-r--r--r-- 1 root root 833 Sep 1 04:03 0a2069ceae75ee95c8054c92d53e98f60dfa92
./.git/objects/info:
total 0
drwxrwxrwx 2 root root 6 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
./.git/objects/pack:
total 0
drwxrwxrwx 2 root root 6 Sep 1 04:03 .
drwxrwxrwx 33 root root 320 Sep 1 04:03 ..
./.git/refs:
total 0
drwxrwxrwx 6 root root 63 Sep 1 04:03 .
drwxrwxrwx 6 root root 113 Sep 1 04:03 ..
drwxrwxrwx 2 root root 6 Sep 1 04:03 heads
drwxrwxrwx 2 root root 18 Sep 1 04:03 pipelines
drwxrwxrwx 3 root root 20 Sep 1 04:03 remotes
drwxrwxrwx 2 root root 6 Sep 1 04:03 tags
./.git/refs/heads:
total 0
drwxrwxrwx 2 root root 6 Sep 1 04:03 .
drwxrwxrwx 6 root root 63 Sep 1 04:03 ..
./.git/refs/pipelines:
total 4K
drwxrwxrwx 2 root root 18 Sep 1 04:03 .
drwxrwxrwx 6 root root 63 Sep 1 04:03 ..
-rw-rw-rw- 1 root root 41 Sep 1 04:03 4762
./.git/refs/remotes:
total 0
drwxrwxrwx 3 root root 20 Sep 1 04:03 .
drwxrwxrwx 6 root root 63 Sep 1 04:03 ..
drwxrwxrwx 2 root root 20 Sep 1 04:03 origin
./.git/refs/remotes/origin:
total 4K
drwxrwxrwx 2 root root 20 Sep 1 04:03 .
drwxrwxrwx 3 root root 20 Sep 1 04:03 ..
-rw-rw-rw- 1 root root 41 Sep 1 04:03 master
./.git/refs/tags:
total 0
drwxrwxrwx 2 root root 6 Sep 1 04:03 .
drwxrwxrwx 6 root root 63 Sep 1 04:03 ..
./templates:
total 4K
drwxrwxrwx 2 root root 39 Sep 1 04:03 .
drwxrwxrwx 5 root root 180 Sep 1 04:03 ..
-rw-rw-rw- 1 root root 1.1K Sep 1 04:03 vulnerability_summary.html
What is the current bug behavior?
The sast_report job will run, but the ls -alhR command doesn't show any json file artifacts available.
What is the expected correct behavior?
The artifacts generated by the SAST template will be available to jobs that list them as dependencies. From an end user perspective, the ability to make a report a dependency (e.g. JUnit output, Terraform plan, or all SAST report artifacts) without enumerating the dependent jobs is ideal.
Proposal
Change such that artifacts:reports also expose the artifact paths, without having to manually set artifacts:paths