Class: CommitStatus
Constant Summary
Ci::HasStatus::ACTIVE_STATUSES, Ci::HasStatus::ALIVE_STATUSES, Ci::HasStatus::AVAILABLE_STATUSES, Ci::HasStatus::BLOCKED_STATUS, Ci::HasStatus::CANCELABLE_STATUSES, Ci::HasStatus::COMPLETED_STATUSES, Ci::HasStatus::COMPLETED_WITH_MANUAL_STATUSES, Ci::HasStatus::DEFAULT_STATUS, Ci::HasStatus::EXECUTING_STATUSES, Ci::HasStatus::IGNORED_STATUSES, Ci::HasStatus::ORDERED_STATUSES, Ci::HasStatus::PASSED_WITH_WARNINGS_STATUSES, Ci::HasStatus::STARTED_STATUSES, Ci::HasStatus::STATUSES_ENUM, Ci::HasStatus::STOPPED_STATUSES, Ci::HasStatus::UnknownStatusError
ApplicationRecord::MAX_PLUCK
HasCheckConstraints::NOT_NULL_CHECK_PATTERN
ResetOnColumnErrors::MAX_RESET_PERIOD
Instance Attribute Summary
Attributes included from Importable
#importing, #user_contributions
Class Method Summary
collapse
Instance Method Summary
collapse
#bulk_insert_associations!, bulk_inserts_enabled?, with_bulk_insert
#present
#run_after_commit, #run_after_commit_or_now
#active?, #blocked?, #complete?, #complete_or_manual?, #incomplete?, #started?
registered_models
model_name, table_name_prefix
===, cached_column_list, #create_or_load_association, current_transaction, declarative_enum, default_select_columns, delete_all_returning, #deleted_from_database?, id_in, id_not_in, iid_in, nullable_column?, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order
#sharding_organization
#reset_on_union_error, #reset_on_unknown_attribute_error
#serializable_hash
Class Method Details
.locking_enabled? ⇒ Boolean
253
254
255
|
# File 'app/models/commit_status.rb', line 253
def self.locking_enabled?
false
end
|
.names ⇒ Object
242
243
244
|
# File 'app/models/commit_status.rb', line 242
def self.names
select(:name)
end
|
.update_as_processed! ⇒ Object
246
247
248
249
250
251
|
# File 'app/models/commit_status.rb', line 246
def self.update_as_processed!
update_all(processed: true)
end
|
Instance Method Details
#all_met_to_become_pending? ⇒ Boolean
315
316
317
|
# File 'app/models/commit_status.rb', line 315
def all_met_to_become_pending?
true
end
|
#archived? ⇒ Boolean
303
304
305
|
# File 'app/models/commit_status.rb', line 303
def archived?(...)
pipeline.archived?(...)
end
|
#auto_canceled? ⇒ Boolean
319
320
321
|
# File 'app/models/commit_status.rb', line 319
def auto_canceled?
canceled? && auto_canceled_by_id?
end
|
#cancelable? ⇒ Boolean
295
296
297
|
# File 'app/models/commit_status.rb', line 295
def cancelable?
false
end
|
#detailed_status(current_user) ⇒ Object
323
324
325
326
327
|
# File 'app/models/commit_status.rb', line 323
def detailed_status(current_user)
Gitlab::Ci::Status::Factory
.new(self, current_user)
.fabricate!
end
|
#duration ⇒ Object
274
275
276
|
# File 'app/models/commit_status.rb', line 274
def duration
calculate_duration(started_at, finished_at)
end
|
#exit_code=(value) ⇒ Object
362
|
# File 'app/models/commit_status.rb', line 362
def exit_code=(value); end
|
#expire_etag_cache! ⇒ Object
#force_cancelable? ⇒ Boolean
299
300
301
|
# File 'app/models/commit_status.rb', line 299
def force_cancelable?
false
end
|
#has_trace? ⇒ Boolean
311
312
313
|
# File 'app/models/commit_status.rb', line 311
def has_trace?
false
end
|
#latest? ⇒ Boolean
283
284
285
|
# File 'app/models/commit_status.rb', line 283
def latest?
!retried?
end
|
#locking_enabled? ⇒ Boolean
257
258
259
|
# File 'app/models/commit_status.rb', line 257
def locking_enabled?
will_save_change_to_status?
end
|
#playable? ⇒ Boolean
287
288
289
|
# File 'app/models/commit_status.rb', line 287
def playable?
false
end
|
#queued_duration ⇒ Object
Time spent in the pending state.
279
280
281
|
# File 'app/models/commit_status.rb', line 279
def queued_duration
calculate_duration(queued_at, started_at || finished_at)
end
|
#recoverable? ⇒ Boolean
335
336
337
|
# File 'app/models/commit_status.rb', line 335
def recoverable?
failed? && !unrecoverable_failure?
end
|
#resource_parent ⇒ Object
374
375
376
|
# File 'app/models/commit_status.rb', line 374
def resource_parent
project
end
|
#retryable? ⇒ Boolean
291
292
293
|
# File 'app/models/commit_status.rb', line 291
def retryable?
false
end
|
#sortable_name ⇒ Object
329
330
331
332
333
|
# File 'app/models/commit_status.rb', line 329
def sortable_name
name.to_s.split(/(\d+)/).map do |v|
/\d+/.match?(v) ? v.to_i : v
end
end
|
#stage_name ⇒ Object
Also known as:
stage
354
355
356
|
# File 'app/models/commit_status.rb', line 354
def stage_name
ci_stage&.name
end
|
#stuck? ⇒ Boolean
307
308
309
|
# File 'app/models/commit_status.rb', line 307
def stuck?
false
end
|
#supports_canceling? ⇒ Boolean
265
266
267
|
# File 'app/models/commit_status.rb', line 265
def supports_canceling?
false
end
|
#supports_force_cancel? ⇒ Boolean
269
270
271
|
# File 'app/models/commit_status.rb', line 269
def supports_force_cancel?
false
end
|
#test_suite_name ⇒ Object
369
370
371
|
# File 'app/models/commit_status.rb', line 369
def test_suite_name
nil
end
|
#to_ability_name ⇒ Object
365
366
367
|
# File 'app/models/commit_status.rb', line 365
def to_ability_name
'build'
end
|
#update_older_statuses_retried! ⇒ Object
339
340
341
342
343
344
345
346
|
# File 'app/models/commit_status.rb', line 339
def update_older_statuses_retried!
pipeline
.statuses
.latest
.where(name: name)
.where.not(id: id)
.update_all(retried: true, processed: true)
end
|