2020-09-10 05:08:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Ci::BuildPendingState < ApplicationRecord
|
|
|
|
extend Gitlab::Ci::Model
|
|
|
|
|
|
|
|
belongs_to :build, class_name: 'Ci::Build', foreign_key: :build_id
|
|
|
|
|
2020-09-15 14:09:43 -04:00
|
|
|
enum state: Ci::Stage.statuses
|
|
|
|
enum failure_reason: CommitStatus.failure_reasons
|
|
|
|
|
2020-09-10 05:08:27 -04:00
|
|
|
validates :build, presence: true
|
2020-09-29 14:09:52 -04:00
|
|
|
|
|
|
|
def crc32
|
|
|
|
trace_checksum.try do |checksum|
|
|
|
|
checksum.to_s.split('crc32:').last.to_i(16)
|
|
|
|
end
|
|
|
|
end
|
2020-09-10 05:08:27 -04:00
|
|
|
end
|