diff options
Diffstat (limited to 'app/models/ci/pipeline_artifact.rb')
-rw-r--r-- | app/models/ci/pipeline_artifact.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/app/models/ci/pipeline_artifact.rb b/app/models/ci/pipeline_artifact.rb index b6db8cad667..46a60914342 100644 --- a/app/models/ci/pipeline_artifact.rb +++ b/app/models/ci/pipeline_artifact.rb @@ -14,7 +14,8 @@ module Ci EXPIRATION_DATE = 1.week.freeze DEFAULT_FILE_NAMES = { - code_coverage: 'code_coverage.json' + code_coverage: 'code_coverage.json', + code_quality_mr_diff: 'code_quality_mr_diff.json' }.freeze belongs_to :project, class_name: "Project", inverse_of: :pipeline_artifacts @@ -30,15 +31,18 @@ module Ci update_project_statistics project_statistics_name: :pipeline_artifacts_size enum file_type: { - code_coverage: 1 + code_coverage: 1, + code_quality_mr_diff: 2 } - def self.has_code_coverage? - where(file_type: :code_coverage).exists? - end + class << self + def has_report?(file_type) + where(file_type: file_type).exists? + end - def self.find_with_code_coverage - find_by(file_type: :code_coverage) + def find_by_file_type(file_type) + find_by(file_type: file_type) + end end def present |