Class: Ci::PipelineArtifact

Inherits:
ApplicationRecord show all
Extended by:
Gitlab::Ci::Model
Includes:
Artifactable, FileStoreMounter, Presentable, UpdateProjectStatistics
Defined in:
app/models/ci/pipeline_artifact.rb

Constant Summary collapse

FILE_STORE_SUPPORTED =
[
  ObjectStorage::Store::LOCAL,
  ObjectStorage::Store::REMOTE
].freeze
FILE_SIZE_LIMIT =
10.megabytes.freeze
EXPIRATION_DATE =
1.week.freeze
DEFAULT_FILE_NAMES =
{
  code_coverage: 'code_coverage.json'
}.freeze

Constants included from Artifactable

Artifactable::FILE_FORMAT_ADAPTERS, Artifactable::NotSupportedAdapterError

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::Ci::Model

model_name, table_name_prefix

Methods included from Artifactable

#each_blob

Methods included from AfterCommitQueue

#run_after_commit, #run_after_commit_or_now

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Class Method Details

.find_with_code_coverageObject


45
46
47
# File 'app/models/ci/pipeline_artifact.rb', line 45

def self.find_with_code_coverage
  find_by(file_type: :code_coverage)
end

.has_code_coverage?Boolean

Returns:

  • (Boolean)

41
42
43
# File 'app/models/ci/pipeline_artifact.rb', line 41

def self.has_code_coverage?
  where(file_type: :code_coverage).exists?
end

Instance Method Details

#presentObject


49
50
51
# File 'app/models/ci/pipeline_artifact.rb', line 49

def present
  super(presenter_class: "Ci::PipelineArtifacts::#{self.file_type.camelize}Presenter".constantize)
end