debian-mirror-gitlab/app/models/ci/build_pending_state.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
480 B
Ruby
Raw Normal View History

2020-11-24 15:15:51 +05:30
# frozen_string_literal: true
2021-10-27 15:23:28 +05:30
class Ci::BuildPendingState < Ci::ApplicationRecord
2023-03-04 22:38:38 +05:30
include Ci::Partitionable
2023-05-27 22:25:52 +05:30
belongs_to :build, class_name: 'Ci::Build', foreign_key: :build_id, inverse_of: :pending_state
2020-11-24 15:15:51 +05:30
2023-03-04 22:38:38 +05:30
partitionable scope: :build
2020-11-24 15:15:51 +05:30
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