lazylead 0.8.3 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.docker/docker-compose.yml +1 -1
- data/.rubocop.yml +1 -0
- data/Rakefile +1 -1
- data/bin/lazylead +3 -0
- data/lazylead.gemspec +5 -5
- data/lib/lazylead/log.rb +11 -0
- data/lib/lazylead/system/jira.rb +10 -7
- data/lib/lazylead/task/accuracy/accuracy.rb +4 -4
- data/lib/lazylead/task/assignment.rb +2 -4
- data/lib/lazylead/task/loading.rb +5 -1
- data/lib/lazylead/task/micromanager.rb +87 -0
- data/lib/lazylead/task/svn/diff.rb +3 -3
- data/lib/lazylead/version.rb +1 -1
- data/lib/messages/illegal_duedate_change.erb +120 -0
- data/lib/messages/loading.erb +6 -1
- data/test/lazylead/task/loading_test.rb +3 -2
- data/test/lazylead/task/micromanager_test.rb +54 -0
- metadata +13 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dd70c73ff657c4598583180a4c21a497e6b303f2eaf7e832aadf966957d363f
|
4
|
+
data.tar.gz: 4f5c7ef058b9861e9d17ffbc97aec9651f974fe808ab7a3ee4832c0800f1e50e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5419ceb30c1122db9afe8051f7587dbc2cfc78896c7c83312ee2160bf8a1556a305df1dee41839048cea736a1904373aa3e8a62cbeb345c293bbb146cbd2d7ed
|
7
|
+
data.tar.gz: 4fcdb20ab35edaf4f1530680ab19378ae751b8b5964e63b9061fad447ff210ff2f43548f6be3afa5e298c8800391e6fac5f07f124d21c59c509bce3579dfd329
|
data/.docker/docker-compose.yml
CHANGED
data/.rubocop.yml
CHANGED
data/Rakefile
CHANGED
@@ -45,7 +45,7 @@ def version
|
|
45
45
|
Gem::Specification.load(Dir["*.gemspec"].first).version
|
46
46
|
end
|
47
47
|
|
48
|
-
task default: %i[clean test
|
48
|
+
task default: %i[clean rubocop test sqlint xcop copyright docker]
|
49
49
|
|
50
50
|
require "rake/testtask"
|
51
51
|
desc "Run all unit tests"
|
data/bin/lazylead
CHANGED
@@ -70,6 +70,9 @@ Available options:"
|
|
70
70
|
o.bool "--testdata",
|
71
71
|
"Apply the database VCS migration with test data",
|
72
72
|
default: false
|
73
|
+
o.string "--log-file", "The path to the log file"
|
74
|
+
o.string "--rolling-age", "The maximum age (in seconds) of a log file before it is rolled. The age can also be given as 'daily', 'weekly', or 'monthly'"
|
75
|
+
o.string "--rolling-files", "The number of rolled log files to keep."
|
73
76
|
o.on "--verbose", "Enable extra logging information" do
|
74
77
|
log.verbose
|
75
78
|
end
|
data/lazylead.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.rubygems_version = "2.2"
|
33
33
|
s.required_ruby_version = ">=2.6.5"
|
34
34
|
s.name = "lazylead"
|
35
|
-
s.version = "0.
|
35
|
+
s.version = "0.9.0"
|
36
36
|
s.license = "MIT"
|
37
37
|
s.summary = "Eliminate the annoying work within bug-trackers."
|
38
38
|
s.description = "Ticketing systems (Github, Jira, etc.) are strongly
|
@@ -45,7 +45,7 @@ tasks instead of solving technical problems."
|
|
45
45
|
s.authors = ["Yurii Dubinka"]
|
46
46
|
s.email = "yurii.dubinka@gmail.com"
|
47
47
|
s.homepage = "http://github.com/dgroup/lazylead"
|
48
|
-
s.post_install_message = "Thanks for installing Lazylead v0.
|
48
|
+
s.post_install_message = "Thanks for installing Lazylead v0.9.0!
|
49
49
|
Read our blog posts: https://lazylead.org
|
50
50
|
Stay in touch with the community in Telegram: https://t.me/lazylead
|
51
51
|
Follow us on Twitter: https://twitter.com/lazylead
|
@@ -58,7 +58,7 @@ tasks instead of solving technical problems."
|
|
58
58
|
s.add_runtime_dependency "activerecord", "6.1.3"
|
59
59
|
s.add_runtime_dependency "backtrace", "0.3"
|
60
60
|
s.add_runtime_dependency "colorize", "0.8.1"
|
61
|
-
s.add_runtime_dependency "faraday", "1.
|
61
|
+
s.add_runtime_dependency "faraday", "1.4.1"
|
62
62
|
s.add_runtime_dependency "get_process_mem", "0.2.7"
|
63
63
|
s.add_runtime_dependency "inifile", "3.0.0"
|
64
64
|
s.add_runtime_dependency "jira-ruby", "2.1.5"
|
@@ -90,9 +90,9 @@ tasks instead of solving technical problems."
|
|
90
90
|
s.add_development_dependency "rake", "13.0.3"
|
91
91
|
s.add_development_dependency "random-port", "0.5.1"
|
92
92
|
s.add_development_dependency "rdoc", "6.3.0"
|
93
|
-
s.add_development_dependency "rubocop", "1.
|
93
|
+
s.add_development_dependency "rubocop", "1.13.0"
|
94
94
|
s.add_development_dependency "rubocop-minitest", "0.11.1"
|
95
|
-
s.add_development_dependency "rubocop-performance", "1.
|
95
|
+
s.add_development_dependency "rubocop-performance", "1.11.0"
|
96
96
|
s.add_development_dependency "rubocop-rake", "0.5.1"
|
97
97
|
s.add_development_dependency "rubocop-rspec", "2.2.0"
|
98
98
|
s.add_development_dependency "sqlint", "0.2.0"
|
data/lib/lazylead/log.rb
CHANGED
@@ -74,6 +74,15 @@ module Lazylead
|
|
74
74
|
)
|
75
75
|
)
|
76
76
|
|
77
|
+
if ARGV.include? "--log-file"
|
78
|
+
name = ARGV[ARGV.find_index("--log-file") + 1]
|
79
|
+
age = "daily"
|
80
|
+
age = ARGV[ARGV.find_index("--rolling-age") + 1] if ARGV.include? "--rolling-age"
|
81
|
+
files = 7
|
82
|
+
files = ARGV[ARGV.find_index("--rolling-files") + 1] if ARGV.include? "--rolling-files"
|
83
|
+
FILE_APPENDER = Logging.appenders.rolling_file("file", filename: name, age: age, keep: files)
|
84
|
+
end
|
85
|
+
|
77
86
|
# Nothing to log
|
78
87
|
NOTHING = Logging.logger["nothing"]
|
79
88
|
NOTHING.level = :off
|
@@ -83,12 +92,14 @@ module Lazylead
|
|
83
92
|
DEBUG = Logging.logger["debug"]
|
84
93
|
DEBUG.level = :debug
|
85
94
|
DEBUG.add_appenders "stdout"
|
95
|
+
DEBUG.add_appenders(FILE_APPENDER) if ARGV.include? "--log-file"
|
86
96
|
DEBUG.freeze
|
87
97
|
|
88
98
|
# Alerts/errors
|
89
99
|
ERRORS = Logging.logger["errors"]
|
90
100
|
ERRORS.level = :error
|
91
101
|
ERRORS.add_appenders "stdout"
|
102
|
+
ERRORS.add_appenders(FILE_APPENDER) if ARGV.include? "--log-file"
|
92
103
|
ERRORS.freeze
|
93
104
|
end
|
94
105
|
end
|
data/lib/lazylead/system/jira.rb
CHANGED
@@ -129,11 +129,7 @@ module Lazylead
|
|
129
129
|
end
|
130
130
|
|
131
131
|
def to_s
|
132
|
-
|
133
|
-
end
|
134
|
-
|
135
|
-
def inspect
|
136
|
-
"#{@opts['site']} (#{@opts['username']})"
|
132
|
+
"#{name} (#{id})"
|
137
133
|
end
|
138
134
|
end
|
139
135
|
|
@@ -257,13 +253,20 @@ module Lazylead
|
|
257
253
|
|
258
254
|
# Update the labels for a particular issue
|
259
255
|
def labels!(lbl)
|
260
|
-
|
261
|
-
save!("fields" => { "labels" => lbl.uniq })
|
256
|
+
save!("fields" => { "labels" => lbl.uniq }) unless lbl.empty?
|
262
257
|
end
|
263
258
|
|
264
259
|
def save!(opts)
|
265
260
|
@issue.save(opts)
|
266
261
|
end
|
262
|
+
|
263
|
+
def sprint(field = "customfield_10480")
|
264
|
+
@sprint ||= if fields[field].nil? || fields[field].empty?
|
265
|
+
""
|
266
|
+
else
|
267
|
+
fields[field].first.split(",").find { |text| text.starts_with? "name=" }[5..]
|
268
|
+
end
|
269
|
+
end
|
267
270
|
end
|
268
271
|
|
269
272
|
# The jira issue comments
|
@@ -139,11 +139,11 @@ module Lazylead
|
|
139
139
|
# If ticket created by some automatic/admin user account then reporter is the first non-system
|
140
140
|
# user account who modified the ticket.
|
141
141
|
def reporter
|
142
|
-
return @issue.reporter.id unless @opts.key? "system-users"
|
143
142
|
sys = @opts.slice("system-users", ",")
|
144
|
-
return @issue.reporter.id if sys.empty? || sys.none? { |susr| @issue.reporter.id
|
145
|
-
@issue.history
|
146
|
-
|
143
|
+
return @issue.reporter.id if sys.empty? || sys.none? { |susr| susr.eql? @issue.reporter.id }
|
144
|
+
first = @issue.history.find { |h| sys.none? { |susr| susr.eql? h["author"]["key"] } }
|
145
|
+
return @issue.reporter.id if first.nil?
|
146
|
+
first["author"]["key"]
|
147
147
|
end
|
148
148
|
end
|
149
149
|
end
|
@@ -67,10 +67,8 @@ module Lazylead
|
|
67
67
|
# Gives true when last change of "Assignee" field was done
|
68
68
|
# by not authorized person.
|
69
69
|
def illegal?
|
70
|
-
|
71
|
-
|
72
|
-
a == last["author"]["name"]
|
73
|
-
end
|
70
|
+
return false if last.nil? || @issue.assignee.id.eql?(last["author"]["name"])
|
71
|
+
@allowed.none? { |a| a.eql? last["author"]["name"] }
|
74
72
|
end
|
75
73
|
|
76
74
|
# Detect details about last change of "Assignee" to non-null value
|
@@ -36,7 +36,7 @@ module Lazylead
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def run(sys, postman, opts)
|
39
|
-
assignments = sys.issues(opts["jql"])
|
39
|
+
assignments = sys.issues(opts["jql"], opts.jira_defaults)
|
40
40
|
.group_by(&:assignee)
|
41
41
|
.map { |user, tasks| [user.id, Teammate.new(user, tasks)] }
|
42
42
|
.to_h
|
@@ -71,6 +71,10 @@ module Lazylead
|
|
71
71
|
def to_s
|
72
72
|
"#{id} has #{total} tasks"
|
73
73
|
end
|
74
|
+
|
75
|
+
def sprints
|
76
|
+
@tasks.group_by(&:sprint).sort
|
77
|
+
end
|
74
78
|
end
|
75
79
|
|
76
80
|
# The teammate without tasks.
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# The MIT License
|
4
|
+
#
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"),
|
9
|
+
# to deal in the Software without restriction, including without limitation
|
10
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
|
+
# and/or sell copies of the Software, and to permit persons to whom
|
12
|
+
# the Software is furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included
|
15
|
+
# in all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
22
|
+
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
23
|
+
# OR OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
|
25
|
+
require "date"
|
26
|
+
require_relative "../log"
|
27
|
+
require_relative "../opts"
|
28
|
+
require_relative "../system/jira"
|
29
|
+
|
30
|
+
module Lazylead
|
31
|
+
module Task
|
32
|
+
#
|
33
|
+
# Email alerts about due date modification by not-authorized persons.
|
34
|
+
#
|
35
|
+
# Author:: Yurii Dubinka (yurii.dubinka@gmail.com)
|
36
|
+
# Copyright:: Copyright (c) 2019-2020 Yurii Dubinka
|
37
|
+
# License:: MIT
|
38
|
+
class Micromanager
|
39
|
+
def initialize(log = Log.new)
|
40
|
+
@log = log
|
41
|
+
end
|
42
|
+
|
43
|
+
def run(sys, postman, opts)
|
44
|
+
allowed = opts.slice "allowed", ","
|
45
|
+
dues = sys.issues(opts["jql"], opts.jira_defaults.merge(expand: "changelog"))
|
46
|
+
.map { |i| Due.new(i, allowed) }
|
47
|
+
.select(&:illegal?)
|
48
|
+
return if dues.empty?
|
49
|
+
postman.send opts.merge(dues: dues)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# Instance of "Due" history item for the particular ticket.
|
54
|
+
class Due
|
55
|
+
attr_reader :issue, :when
|
56
|
+
|
57
|
+
def initialize(issue, allowed)
|
58
|
+
@issue = issue
|
59
|
+
@allowed = allowed
|
60
|
+
end
|
61
|
+
|
62
|
+
# Gives true when last change of "Due Date" field was done
|
63
|
+
# by not authorized person.
|
64
|
+
def illegal?
|
65
|
+
return false if @issue.assignee.id.eql?(last.id)
|
66
|
+
@allowed.none? { |a| a.eql? last.id }
|
67
|
+
end
|
68
|
+
|
69
|
+
# Detect details about last change of "Due Date" to non-null value
|
70
|
+
def last
|
71
|
+
@last ||= begin
|
72
|
+
dd = @issue.history
|
73
|
+
.reverse
|
74
|
+
.find { |h| h["items"].any? { |i| i["field"] == "duedate" } }
|
75
|
+
if dd.nil? && !@issue.duedate.nil?
|
76
|
+
@when = @issue["created"]
|
77
|
+
dd = @issue.reporter
|
78
|
+
else
|
79
|
+
@when = dd["created"].to_date
|
80
|
+
dd = Lazylead::User.new(dd["author"])
|
81
|
+
end
|
82
|
+
dd
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -50,6 +50,7 @@ module Lazylead
|
|
50
50
|
"-r#{opts['since_rev']}:HEAD #{opts['svn_url']}"
|
51
51
|
]
|
52
52
|
stdout = `#{cmd.join(" ")}`
|
53
|
+
stdout.scrub!
|
53
54
|
send_email postman, opts.merge(stdout: stdout) unless stdout.blank?
|
54
55
|
end
|
55
56
|
|
@@ -60,8 +61,7 @@ module Lazylead
|
|
60
61
|
Dir.mktmpdir do |dir|
|
61
62
|
name = "svn-log-#{Date.today.strftime('%d-%b-%Y')}.html"
|
62
63
|
begin
|
63
|
-
to_f(File.join(dir, name), opts)
|
64
|
-
postman.send opts.merge(attachments: [File.join(dir, name)])
|
64
|
+
postman.send opts.merge(attachments: [to_f(File.join(dir, name), opts)])
|
65
65
|
ensure
|
66
66
|
FileUtils.rm_rf("#{dir}/*")
|
67
67
|
end
|
@@ -91,7 +91,7 @@ module Lazylead
|
|
91
91
|
end
|
92
92
|
f.write body
|
93
93
|
f.close
|
94
|
-
f
|
94
|
+
f.path
|
95
95
|
end
|
96
96
|
end
|
97
97
|
end
|
data/lib/lazylead/version.rb
CHANGED
@@ -0,0 +1,120 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<style>
|
5
|
+
/* CSS styles taken from https://github.com/yegor256/tacit */
|
6
|
+
th {
|
7
|
+
font-weight: 600
|
8
|
+
}
|
9
|
+
|
10
|
+
table tr {
|
11
|
+
border-bottom-width: 2.16px
|
12
|
+
}
|
13
|
+
|
14
|
+
table tr th {
|
15
|
+
border-bottom-width: 2.16px
|
16
|
+
}
|
17
|
+
|
18
|
+
table tr td, table tr th {
|
19
|
+
overflow: hidden;
|
20
|
+
padding: 5.4px 3.6px
|
21
|
+
}
|
22
|
+
|
23
|
+
a {
|
24
|
+
color: #275a90;
|
25
|
+
text-decoration: none
|
26
|
+
}
|
27
|
+
|
28
|
+
a:hover {
|
29
|
+
text-decoration: underline
|
30
|
+
}
|
31
|
+
|
32
|
+
pre, code, kbd, samp, var, output {
|
33
|
+
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
34
|
+
font-size: 13px
|
35
|
+
}
|
36
|
+
|
37
|
+
pre code {
|
38
|
+
background: none;
|
39
|
+
border: 0;
|
40
|
+
line-height: 29.7px;
|
41
|
+
padding: 0
|
42
|
+
}
|
43
|
+
|
44
|
+
code, kbd {
|
45
|
+
background: #daf1e0;
|
46
|
+
border-radius: 3.6px;
|
47
|
+
color: #2a6f3b;
|
48
|
+
display: inline-block;
|
49
|
+
line-height: 18px;
|
50
|
+
padding: 3.6px 6.3px 2.7px
|
51
|
+
}
|
52
|
+
|
53
|
+
* {
|
54
|
+
border: 0;
|
55
|
+
border-collapse: separate;
|
56
|
+
border-spacing: 0;
|
57
|
+
box-sizing: border-box;
|
58
|
+
margin: 0;
|
59
|
+
max-width: 100%;
|
60
|
+
padding: 0;
|
61
|
+
vertical-align: baseline;
|
62
|
+
font-family: system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
63
|
+
font-size: 13px;
|
64
|
+
font-stretch: normal;
|
65
|
+
font-style: normal;
|
66
|
+
font-weight: 400;
|
67
|
+
line-height: 29.7px
|
68
|
+
}
|
69
|
+
|
70
|
+
html, body {
|
71
|
+
width: 100%
|
72
|
+
}
|
73
|
+
|
74
|
+
html {
|
75
|
+
height: 100%
|
76
|
+
}
|
77
|
+
|
78
|
+
body {
|
79
|
+
background: #fff;
|
80
|
+
color: #1a1919;
|
81
|
+
padding: 36px
|
82
|
+
}
|
83
|
+
</style>
|
84
|
+
<title>Not authorized "Assignee" change</title>
|
85
|
+
</head>
|
86
|
+
<body>
|
87
|
+
<p>Hi,</p>
|
88
|
+
|
89
|
+
<p>The <span style='font-weight:bold'>'Duedate'</span> for the following
|
90
|
+
ticket(s) changed by not authorized person(s):</p>
|
91
|
+
<table summary="ticket(s) where duedate changed">
|
92
|
+
<tr>
|
93
|
+
<th id="key">Key</th>
|
94
|
+
<th id="priority">Priority</th>
|
95
|
+
<th id="when">When</th>
|
96
|
+
<th id="who">Who</th>
|
97
|
+
<th id="to">To</th>
|
98
|
+
<th id="summary">Summary</th>
|
99
|
+
<th id="reporter">Reporter</th>
|
100
|
+
</tr>
|
101
|
+
<% dues.each do |d| %>
|
102
|
+
<tr>
|
103
|
+
<td><a href='<%= d.issue.url %>'><%= d.issue.key %></a></td>
|
104
|
+
<td><%= d.issue.priority %></td>
|
105
|
+
<td><%= d.when %></td>
|
106
|
+
<td><span style='color: red'><%= d.last.name %></span> (<%= d.last.id %>)</td>
|
107
|
+
<td><span style='color: red'><%= d.issue.duedate %></span></td>
|
108
|
+
<td><%= d.issue.summary %></td>
|
109
|
+
<td><%= d.issue.reporter.name %></td>
|
110
|
+
</tr>
|
111
|
+
<% end %>
|
112
|
+
</table>
|
113
|
+
|
114
|
+
<p>Authorized person(s) are: <code><%= allowed %></code>.</p>
|
115
|
+
|
116
|
+
<p>Posted by
|
117
|
+
<a href="https://github.com/dgroup/lazylead">lazylead v<%= version %></a>.
|
118
|
+
</p>
|
119
|
+
</body>
|
120
|
+
</html>
|
data/lib/messages/loading.erb
CHANGED
@@ -93,7 +93,12 @@
|
|
93
93
|
<% if assignment.free? %>
|
94
94
|
<span style="color: red">0</span>
|
95
95
|
<% else %>
|
96
|
-
|
96
|
+
<% assignment.sprints.each do |s| %>
|
97
|
+
<a href="<%= search_link %><%= CGI.escape("#{jql} and assignee=#{teammate}") %>">
|
98
|
+
<%= s.first.blank? ? "No sprint" : s.first %>: <%= s.last.size %>
|
99
|
+
</a>
|
100
|
+
<br/>
|
101
|
+
<% end %>
|
97
102
|
<% end %>
|
98
103
|
</div>
|
99
104
|
</td>
|
@@ -40,10 +40,11 @@ module Lazylead
|
|
40
40
|
Opts.new(
|
41
41
|
"to" => "lead@company.com",
|
42
42
|
"from" => "ll@company.com",
|
43
|
-
"jql" => "key
|
43
|
+
"jql" => "key in (STS-3599, XD-3739, XD-3744)",
|
44
44
|
"team" => "mclaren:Tom McLaren,milesparker:Mi Pa",
|
45
45
|
"user_link" => "https://user.com?id=",
|
46
|
-
"
|
46
|
+
"search_link" => "https://jira.spring.io/issues/?jql=",
|
47
|
+
"fields" => "assignee,duedate,customfield_10480",
|
47
48
|
"subject" => "[LL] Team loading",
|
48
49
|
"template" => "lib/messages/loading.erb"
|
49
50
|
)
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# The MIT License
|
4
|
+
#
|
5
|
+
# Copyright (c) 2019-2021 Yurii Dubinka
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"),
|
9
|
+
# to deal in the Software without restriction, including without limitation
|
10
|
+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
11
|
+
# and/or sell copies of the Software, and to permit persons to whom
|
12
|
+
# the Software is furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included
|
15
|
+
# in all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
22
|
+
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
23
|
+
# OR OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
|
25
|
+
require "mail"
|
26
|
+
|
27
|
+
require_relative "../../test"
|
28
|
+
require_relative "../../../lib/lazylead/smtp"
|
29
|
+
require_relative "../../../lib/lazylead/opts"
|
30
|
+
require_relative "../../../lib/lazylead/postman"
|
31
|
+
require_relative "../../../lib/lazylead/task/micromanager"
|
32
|
+
|
33
|
+
module Lazylead
|
34
|
+
class MicromanagerTest < Lazylead::Test
|
35
|
+
test "alert in case duedate changed by not authorized person" do
|
36
|
+
Lazylead::Smtp.new.enable
|
37
|
+
Task::Micromanager.new.run(
|
38
|
+
NoAuthJira.new("https://jira.spring.io"),
|
39
|
+
Postman.new,
|
40
|
+
Opts.new(
|
41
|
+
"to" => "lead@company.com",
|
42
|
+
"from" => "ll@company.com",
|
43
|
+
"jql" => "key in ('STS-3599','SPR-6541') and duedate is not empty",
|
44
|
+
"fields" => "assignee,duedate,priority,created,summary,reporter",
|
45
|
+
"allowed" => "tom,mike,bob",
|
46
|
+
"subject" => "DD: How dare you?",
|
47
|
+
"template" => "lib/messages/illegal_duedate_change.erb"
|
48
|
+
)
|
49
|
+
)
|
50
|
+
assert_email "DD: How dare you?",
|
51
|
+
%w[SPR-6541 Major (kdonald) 2009-12-10 Spring's\ Maven\ Central tom,mike,bob]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazylead
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yurii Dubinka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.4.1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.4.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: get_process_mem
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -506,14 +506,14 @@ dependencies:
|
|
506
506
|
requirements:
|
507
507
|
- - '='
|
508
508
|
- !ruby/object:Gem::Version
|
509
|
-
version: 1.
|
509
|
+
version: 1.13.0
|
510
510
|
type: :development
|
511
511
|
prerelease: false
|
512
512
|
version_requirements: !ruby/object:Gem::Requirement
|
513
513
|
requirements:
|
514
514
|
- - '='
|
515
515
|
- !ruby/object:Gem::Version
|
516
|
-
version: 1.
|
516
|
+
version: 1.13.0
|
517
517
|
- !ruby/object:Gem::Dependency
|
518
518
|
name: rubocop-minitest
|
519
519
|
requirement: !ruby/object:Gem::Requirement
|
@@ -534,14 +534,14 @@ dependencies:
|
|
534
534
|
requirements:
|
535
535
|
- - '='
|
536
536
|
- !ruby/object:Gem::Version
|
537
|
-
version: 1.
|
537
|
+
version: 1.11.0
|
538
538
|
type: :development
|
539
539
|
prerelease: false
|
540
540
|
version_requirements: !ruby/object:Gem::Requirement
|
541
541
|
requirements:
|
542
542
|
- - '='
|
543
543
|
- !ruby/object:Gem::Version
|
544
|
-
version: 1.
|
544
|
+
version: 1.11.0
|
545
545
|
- !ruby/object:Gem::Dependency
|
546
546
|
name: rubocop-rake
|
547
547
|
requirement: !ruby/object:Gem::Requirement
|
@@ -709,6 +709,7 @@ files:
|
|
709
709
|
- lib/lazylead/task/echo.rb
|
710
710
|
- lib/lazylead/task/fix_version.rb
|
711
711
|
- lib/lazylead/task/loading.rb
|
712
|
+
- lib/lazylead/task/micromanager.rb
|
712
713
|
- lib/lazylead/task/missing_comment.rb
|
713
714
|
- lib/lazylead/task/propagate_down.rb
|
714
715
|
- lib/lazylead/task/savepoint.rb
|
@@ -721,6 +722,7 @@ files:
|
|
721
722
|
- lib/messages/created_recently.erb
|
722
723
|
- lib/messages/due_date_expired.erb
|
723
724
|
- lib/messages/illegal_assignee_change.erb
|
725
|
+
- lib/messages/illegal_duedate_change.erb
|
724
726
|
- lib/messages/illegal_fixversion_change.erb
|
725
727
|
- lib/messages/loading.erb
|
726
728
|
- lib/messages/missing_comment.erb
|
@@ -767,6 +769,7 @@ files:
|
|
767
769
|
- test/lazylead/task/echo_test.rb
|
768
770
|
- test/lazylead/task/fix_version_test.rb
|
769
771
|
- test/lazylead/task/loading_test.rb
|
772
|
+
- test/lazylead/task/micromanager_test.rb
|
770
773
|
- test/lazylead/task/missing_comment_test.rb
|
771
774
|
- test/lazylead/task/propagate_down_test.rb
|
772
775
|
- test/lazylead/task/savepoint_test.rb
|
@@ -783,7 +786,7 @@ licenses:
|
|
783
786
|
- MIT
|
784
787
|
metadata: {}
|
785
788
|
post_install_message: |-
|
786
|
-
Thanks for installing Lazylead v0.
|
789
|
+
Thanks for installing Lazylead v0.9.0!
|
787
790
|
Read our blog posts: https://lazylead.org
|
788
791
|
Stay in touch with the community in Telegram: https://t.me/lazylead
|
789
792
|
Follow us on Twitter: https://twitter.com/lazylead
|
@@ -843,6 +846,7 @@ test_files:
|
|
843
846
|
- test/lazylead/task/echo_test.rb
|
844
847
|
- test/lazylead/task/fix_version_test.rb
|
845
848
|
- test/lazylead/task/loading_test.rb
|
849
|
+
- test/lazylead/task/micromanager_test.rb
|
846
850
|
- test/lazylead/task/missing_comment_test.rb
|
847
851
|
- test/lazylead/task/propagate_down_test.rb
|
848
852
|
- test/lazylead/task/savepoint_test.rb
|