Class: NewMergeRequestWorker

Inherits:
Object
  • Object
show all
Includes:
ApplicationWorker, NewIssuable
Defined in:
app/workers/new_merge_request_worker.rb

Overview

rubocop:disable Scalability/IdempotentWorker

Constant Summary

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT

Constants included from WorkerAttributes

WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES

Instance Attribute Summary

Attributes included from NewIssuable

#issuable, #user

Instance Method Summary collapse

Methods included from NewIssuable

#log_error, #objects_found?, #set_issuable, #set_user

Methods included from Gitlab::SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Method Details

#issuable_classObject


24
25
26
# File 'app/workers/new_merge_request_worker.rb', line 24

def issuable_class
  MergeRequest
end

#perform(merge_request_id, user_id) ⇒ Object


16
17
18
19
20
21
22
# File 'app/workers/new_merge_request_worker.rb', line 16

def perform(merge_request_id, user_id)
  return unless objects_found?(merge_request_id, user_id)

  MergeRequests::AfterCreateService
    .new(project: issuable.target_project, current_user: user)
    .execute(issuable)
end