diff options
Diffstat (limited to 'app/models/ci/job_artifact.rb')
-rw-r--r-- | app/models/ci/job_artifact.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb index 3beb76ffc2b..0dbeab30498 100644 --- a/app/models/ci/job_artifact.rb +++ b/app/models/ci/job_artifact.rb @@ -26,10 +26,13 @@ module Ci metrics: 'metrics.txt' }.freeze - TYPE_AND_FORMAT_PAIRS = { + INTERNAL_TYPES = { archive: :zip, metadata: :gzip, - trace: :raw, + trace: :raw + }.freeze + + REPORT_TYPES = { junit: :gzip, metrics: :gzip, @@ -45,6 +48,8 @@ module Ci performance: :raw }.freeze + TYPE_AND_FORMAT_PAIRS = INTERNAL_TYPES.merge(REPORT_TYPES).freeze + belongs_to :project belongs_to :job, class_name: "Ci::Build", foreign_key: :job_id @@ -66,6 +71,10 @@ module Ci where(file_type: types) end + scope :with_reports, -> do + with_file_types(REPORT_TYPES.keys.map(&:to_s)) + end + scope :test_reports, -> do with_file_types(TEST_REPORT_FILE_TYPES) end |