summaryrefslogtreecommitdiff
path: root/lib/gitlab/verify/job_artifacts.rb
blob: dbadfbde9e38118e53031f1f1cbdc716fe6c5d07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module Gitlab
  module Verify
    class JobArtifacts < BatchVerifier
      def name
        'Job artifacts'
      end

      def describe(object)
        "Job artifact: #{object.id}"
      end

      private

      def all_relation
        ::Ci::JobArtifact.all
      end

      def local?(artifact)
        artifact.local_store?
      end

      def expected_checksum(artifact)
        artifact.file_sha256
      end

      def actual_checksum(artifact)
        Digest::SHA256.file(artifact.file.path).hexdigest
      end

      def remote_object_exists?(artifact)
        artifact.file.file.exists?
      end
    end
  end
end