Skip to content

Draft: Resolve "Support multiple artifacts generation per job"

What does this MR do?

artifacts:archives

artifacts:archives is used to create multiple artifact archives per job. All of the artifacts: syntax can be used with artifacts:archives, one time per archive, except for archives: or reports:. Each artifact is a single list (array) item under artifacts:archives. name: and path: are mandatory keywords, the rest are optional.

For example, use the example below to create the following multiple artifacts:

  • An archive named coverage that uploads /coverage/path-1.txt and /coverage/path-2.txt only on success.
  • An archive named failures that uploads /failure/file-1.txt only on failure.
  • Two artifacts:reports, for junit: rspec.xml and terraform: tfplan.json
artifacts:
  archives:
    - name: coverage
      untracked: false
      paths: 
        - /coverage/file-1.txt
        - /coverage/file-2.txt
      expose_as: test_coverage
      when: on_success
    - name: failures
      paths: 
        - /failure/file-1.txt
      when: on_failure
  reports:
    junit: rspec.xml
    terraform: tfplan.json
Limitations

In 13.7 artifacts specified in this way are only available for download via the artifacts dropdown in the project pipeline index at <path-to-project>/-/pipelines. Only the first archive specified by a given job will be passed to the next stages by default or when a job is specified as a dependency using dependencies.

Screenshots

View Screenshots
ci editor Screen_Shot_2020-11-20_at_5.06.27_PM
job logs Screen_Shot_2020-11-06_at_5.44.48_PM
pipeline view Screen_Shot_2020-11-20_at_11.52.34_AM

Database Lab output

exec DROP INDEX CONCURRENTLY index_ci_job_artifacts_on_job_id_and_file_type;
The query has been executed. Duration: 11.314 s (edited) 
exec CREATE UNIQUE INDEX CONCURRENTLY index_ci_job_artifacts_on_job_id_and_file_type ON ci_job_artifacts USING btree (job_id, file_type) WHERE (file_type <> 1);
The query has been executed. Duration: 33.481 min (edited) 

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Part of #18744

Edited by Allison Browne

Merge request reports