Class: GenericCommitStatus

Inherits:
CommitStatus show all
Defined in:
app/models/generic_commit_status.rb

Constant Summary collapse

EXTERNAL_STAGE_IDX =
1_000_000

Constants included from Ci::HasStatus

Ci::HasStatus::ACTIVE_STATUSES, Ci::HasStatus::AVAILABLE_STATUSES, Ci::HasStatus::BLOCKED_STATUS, Ci::HasStatus::COMPLETED_STATUSES, Ci::HasStatus::DEFAULT_STATUS, Ci::HasStatus::EXCLUDE_IGNORED_STATUSES, Ci::HasStatus::ORDERED_STATUSES, Ci::HasStatus::PASSED_WITH_WARNINGS_STATUSES, Ci::HasStatus::STARTED_STATUSES, Ci::HasStatus::STATUSES_ENUM, Ci::HasStatus::UnknownStatusError

Instance Attribute Summary

Attributes included from Importable

#imported, #importing

Instance Method Summary collapse

Methods inherited from CommitStatus

#all_met_to_become_pending?, #any_unmet_prerequisites?, #archived?, #auto_canceled?, #cancelable?, #duration, #failed_but_allowed?, #group_name, #has_trace?, #importing?, #latest?, #locking_enabled?, locking_enabled?, names, #playable?, #recoverable?, #requires_resource?, #retryable?, #sortable_name, #stuck?, update_as_processed!

Methods included from BulkInsertableAssociations

#bulk_insert_associations!, bulk_inserts_enabled?, with_bulk_insert

Methods included from Presentable

#present

Methods included from AfterCommitQueue

#run_after_commit, #run_after_commit_or_now

Methods included from Ci::HasStatus

#active?, #blocked?, #complete?, #started?

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

Instance Method Details

#detailed_status(current_user) ⇒ Object


26
27
28
29
30
# File 'app/models/generic_commit_status.rb', line 26

def detailed_status(current_user)
  Gitlab::Ci::Status::External::Factory
    .new(self, current_user)
    .fabricate!
end

#set_default_valuesObject


16
17
18
19
20
# File 'app/models/generic_commit_status.rb', line 16

def set_default_values
  self.context ||= 'default'
  self.stage ||= 'external'
  self.stage_idx ||= EXTERNAL_STAGE_IDX
end

#tagsObject


22
23
24
# File 'app/models/generic_commit_status.rb', line 22

def tags
  [:external]
end