summaryrefslogtreecommitdiff
path: root/lib/gitlab/verify/job_artifacts.rb
blob: 03500a610743088ba13590dde8b7624c81996f28 (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
module Gitlab
  module Verify
    class JobArtifacts < BatchVerifier
      def name
        'Job artifacts'
      end

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

      private

      def relation
        ::Ci::JobArtifact.all
      end

      def expected_checksum(artifact)
        artifact.file_sha256
      end

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