Class: Gitlab::Triage::Action::WorkItem::Dry

Inherits:
WorkItem
  • Object
show all
Defined in:
lib/gitlab/triage/action/work_item.rb

Overview

The dry run must not touch the network. It prints the requested label names and assignee usernames rather than resolving them to ids, mirroring how Comment::Dry avoids network calls.

Instance Method Summary collapse

Instance Method Details

#actObject



29
30
31
32
33
# File 'lib/gitlab/triage/action/work_item.rb', line 29

def act
  puts "The following work items would be updated for the rule **#{policy.name}**:\n\n"

  super
end

#perform(resource) ⇒ Object (private)



37
38
39
40
41
42
# File 'lib/gitlab/triage/action/work_item.rb', line 37

def perform(resource)
  puts "# #{resource[:web_url]}"
  puts "Would add labels: #{requested_labels.join(', ')}" if requested_labels.any?
  puts "Would assign: #{requested_assignees.join(', ')}" if requested_assignees.any?
  puts "\n"
end