Welcome to mirror list, hosted at ThFree Co, Russian Federation.

create_evidence_worker.rb « releases « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5aed543500f14fe39478edc60b918b5afe3a8d25 (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
# frozen_string_literal: true

module Releases
  class CreateEvidenceWorker # rubocop:disable Scalability/IdempotentWorker
    include ApplicationWorker

    data_consistency :always

    sidekiq_options retry: 3

    feature_category :release_evidence
    tags :exclude_from_kubernetes

    # pipeline_id is optional for backward compatibility with existing jobs
    # caller should always try to provide the pipeline and pass nil only
    # if pipeline is absent
    def perform(release_id, pipeline_id = nil)
      release = Release.find_by_id(release_id)

      return unless release

      pipeline = Ci::Pipeline.find_by_id(pipeline_id)

      ::Releases::CreateEvidenceService.new(release, pipeline: pipeline).execute
    end
  end
end