2020-11-24 15:15:51 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Ci::BuildPendingState < ApplicationRecord
|
|
|
|
extend Gitlab::Ci::Model
|
|
|
|
|
|
|
|
belongs_to :build, class_name: 'Ci::Build', foreign_key: :build_id
|
|
|
|
|
|
|
|
enum state: Ci::Stage.statuses
|
|
|
|
enum failure_reason: CommitStatus.failure_reasons
|
|
|
|
|
|
|
|
validates :build, presence: true
|
2021-01-03 14:25:43 +05:30
|
|
|
|
|
|
|
def crc32
|
|
|
|
trace_checksum.try do |checksum|
|
|
|
|
checksum.to_s.split('crc32:').last.to_i(16)
|
|
|
|
end
|
|
|
|
end
|
2020-11-24 15:15:51 +05:30
|
|
|
end
|