2018-03-06 13:46:36 -05:00
|
|
|
module Gitlab
|
|
|
|
module Verify
|
|
|
|
class JobArtifacts < BatchVerifier
|
|
|
|
def name
|
|
|
|
'Job artifacts'
|
|
|
|
end
|
|
|
|
|
|
|
|
def describe(object)
|
|
|
|
"Job artifact: #{object.id}"
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2018-06-13 13:11:43 -04:00
|
|
|
def all_relation
|
2018-03-06 13:46:36 -05:00
|
|
|
::Ci::JobArtifact.all
|
|
|
|
end
|
|
|
|
|
2018-06-13 13:11:43 -04:00
|
|
|
def local?(artifact)
|
|
|
|
artifact.local_store?
|
|
|
|
end
|
|
|
|
|
2018-03-06 13:46:36 -05:00
|
|
|
def expected_checksum(artifact)
|
|
|
|
artifact.file_sha256
|
|
|
|
end
|
|
|
|
|
|
|
|
def actual_checksum(artifact)
|
|
|
|
Digest::SHA256.file(artifact.file.path).hexdigest
|
|
|
|
end
|
2018-06-13 13:11:43 -04:00
|
|
|
|
|
|
|
def remote_object_exists?(artifact)
|
|
|
|
artifact.file.file.exists?
|
|
|
|
end
|
2018-03-06 13:46:36 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|