Module: Ci::HasStatus

Extended by:
ActiveSupport::Concern
Included in:
Pipeline, Stage, CommitStatus
Defined in:
app/models/concerns/ci/has_status.rb

Constant Summary collapse

DEFAULT_STATUS =
'created'
BLOCKED_STATUS =
%w[manual scheduled].freeze
AVAILABLE_STATUSES =
%w[created waiting_for_resource preparing pending running success failed canceled skipped manual scheduled].freeze
STARTED_STATUSES =
%w[running success failed skipped manual scheduled].freeze
ACTIVE_STATUSES =
%w[waiting_for_resource preparing pending running].freeze
COMPLETED_STATUSES =
%w[success failed canceled skipped].freeze
ORDERED_STATUSES =
%w[failed preparing pending running waiting_for_resource manual scheduled canceled success skipped created].freeze
PASSED_WITH_WARNINGS_STATUSES =
%w[failed canceled].to_set.freeze
EXCLUDE_IGNORED_STATUSES =
%w[manual failed canceled].to_set.freeze
STATUSES_ENUM =
{ created: 0, pending: 1, running: 2, success: 3,
failed: 4, canceled: 5, skipped: 6, manual: 7,
scheduled: 8, preparing: 9, waiting_for_resource: 10 }.freeze
UnknownStatusError =
Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)

96
97
98
# File 'app/models/concerns/ci/has_status.rb', line 96

def active?
  ACTIVE_STATUSES.include?(status)
end

#blocked?Boolean

Returns:

  • (Boolean)

104
105
106
# File 'app/models/concerns/ci/has_status.rb', line 104

def blocked?
  BLOCKED_STATUS.include?(status)
end

#complete?Boolean

Returns:

  • (Boolean)

100
101
102
# File 'app/models/concerns/ci/has_status.rb', line 100

def complete?
  COMPLETED_STATUSES.include?(status)
end

#started?Boolean

Returns:

  • (Boolean)

92
93
94
# File 'app/models/concerns/ci/has_status.rb', line 92

def started?
  STARTED_STATUSES.include?(status) && started_at
end