diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-10-22 08:09:40 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-10-22 08:09:40 +0000 |
commit | 44a9231d19f88c5551f7184917ddc4bba13e7d00 (patch) | |
tree | 8c519413eb3d9576d2a9179619cc102485a26e0e /app | |
parent | fbb0f71237fca77746e84ba4cea837472a178f4d (diff) | |
parent | 15cd91c71a57a0b84af620181a64b26d5aec8237 (diff) | |
download | gitlab-ce-44a9231d19f88c5551f7184917ddc4bba13e7d00.tar.gz |
Merge branch 'use-raw-file-format' into 'master'
Add RAW file format which is used to store security reports
Closes gitlab-ee#7996
See merge request gitlab-org/gitlab-ce!22365
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/job_artifact.rb | 17 | ||||
-rw-r--r-- | app/presenters/ci/build_runner_presenter.rb | 10 |
2 files changed, 16 insertions, 11 deletions
diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb index cb73fc74bb6..2b28b702b05 100644 --- a/app/models/ci/job_artifact.rb +++ b/app/models/ci/job_artifact.rb @@ -27,11 +27,15 @@ module Ci metadata: :gzip, trace: :raw, junit: :gzip, - codequality: :gzip, - sast: :gzip, - dependency_scanning: :gzip, - container_scanning: :gzip, - dast: :gzip + + # All these file formats use `raw` as we need to store them uncompressed + # for Frontend to fetch the files and do analysis + # When they will be only used by backend, they can be `gzipped`. + codequality: :raw, + sast: :raw, + dependency_scanning: :raw, + container_scanning: :raw, + dast: :raw }.freeze belongs_to :project @@ -100,7 +104,8 @@ module Ci } FILE_FORMAT_ADAPTERS = { - gzip: Gitlab::Ci::Build::Artifacts::GzipFileAdapter + gzip: Gitlab::Ci::Build::Artifacts::Adapters::GzipStream, + raw: Gitlab::Ci::Build::Artifacts::Adapters::RawStream }.freeze def valid_file_format? diff --git a/app/presenters/ci/build_runner_presenter.rb b/app/presenters/ci/build_runner_presenter.rb index 880218e2727..300f85e1e9d 100644 --- a/app/presenters/ci/build_runner_presenter.rb +++ b/app/presenters/ci/build_runner_presenter.rb @@ -30,12 +30,12 @@ module Ci def create_reports(reports, expire_in:) return unless reports&.any? - reports.map do |k, v| + reports.map do |report_type, report_paths| { - artifact_type: k.to_sym, - artifact_format: :gzip, - name: ::Ci::JobArtifact::DEFAULT_FILE_NAMES[k.to_sym], - paths: v, + artifact_type: report_type.to_sym, + artifact_format: ::Ci::JobArtifact::TYPE_AND_FORMAT_PAIRS.fetch(report_type.to_sym), + name: ::Ci::JobArtifact::DEFAULT_FILE_NAMES.fetch(report_type.to_sym), + paths: report_paths, when: 'always', expire_in: expire_in } |