Class: Lazylead::Task::OnlyLL

Inherits:
Object
  • Object
show all
Defined in:
lib/lazylead/task/accuracy/onlyll.rb

Overview

Ensure that ticket accuracy evaluation labels are set only by LL, not by

some person.

The task supports the following features:

- fetch issues from remote ticketing system by query
- check the history of labels modification
- remove evaluation labels if they set not by LL

Instance Method Summary collapse

Constructor Details

#initialize(log = Log.new) ⇒ OnlyLL

Returns a new instance of OnlyLL.



39
40
41
# File 'lib/lazylead/task/accuracy/onlyll.rb', line 39

def initialize(log = Log.new)
  @log = log
end

Instance Method Details

#run(sys, postman, opts) ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/lazylead/task/accuracy/onlyll.rb', line 43

def run(sys, postman, opts)
  found = sys.issues(opts["jql"],
                     opts.jira_defaults.merge(expand: "changelog"))
             .map { |i| Labels.new(i, opts) }
             .select(&:exists?)
             .reject(&:valid?)
             .each(&:remove)
  postman.send opts.merge(tickets: found) unless found.empty?
end