2021-02-22 17:27:13 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Releases
|
|
|
|
class CreateEvidenceWorker # rubocop:disable Scalability/IdempotentWorker
|
|
|
|
include ApplicationWorker
|
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
data_consistency :always
|
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
sidekiq_options retry: 3
|
|
|
|
|
2021-02-22 17:27:13 +05:30
|
|
|
feature_category :release_evidence
|
|
|
|
|
|
|
|
# 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
|