2018-12-23 12:14:25 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
module Gitlab
|
|
|
|
module Verify
|
|
|
|
class JobArtifacts < BatchVerifier
|
|
|
|
def name
|
|
|
|
'Job artifacts'
|
|
|
|
end
|
|
|
|
|
|
|
|
def describe(object)
|
|
|
|
"Job artifact: #{object.id}"
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
def all_relation
|
2018-05-09 12:01:36 +05:30
|
|
|
::Ci::JobArtifact.all
|
|
|
|
end
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
def local?(artifact)
|
|
|
|
artifact.local_store?
|
|
|
|
end
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
def expected_checksum(artifact)
|
|
|
|
artifact.file_sha256
|
|
|
|
end
|
|
|
|
|
|
|
|
def actual_checksum(artifact)
|
|
|
|
Digest::SHA256.file(artifact.file.path).hexdigest
|
|
|
|
end
|
2018-11-08 19:23:39 +05:30
|
|
|
|
|
|
|
def remote_object_exists?(artifact)
|
|
|
|
artifact.file.file.exists?
|
|
|
|
end
|
2018-05-09 12:01:36 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|