lazylead 0.11.1 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -0
- data/.docker/docker-compose.yml +9 -10
- data/.docs/accuracy.sql +35 -0
- data/.rubocop.yml +6 -1
- data/Rakefile +1 -1
- data/lazylead.gemspec +19 -16
- data/lib/lazylead/confluence.rb +3 -2
- data/lib/lazylead/model.rb +2 -1
- data/lib/lazylead/postman.rb +61 -0
- data/lib/lazylead/schedule.rb +4 -8
- data/lib/lazylead/system/allocations.md +24 -0
- data/lib/lazylead/system/jira.rb +2 -2
- data/lib/lazylead/task/accuracy/accuracy.rb +11 -6
- data/lib/lazylead/task/accuracy/records.rb +10 -3
- data/lib/lazylead/task/accuracy/screenshots.rb +1 -1
- data/lib/lazylead/task/echo.rb +1 -1
- data/lib/lazylead/task/git/git.rb +82 -0
- data/lib/lazylead/task/loading.rb +1 -2
- data/lib/lazylead/task/propagate_down.rb +2 -2
- data/lib/lazylead/task/savepoint.rb +1 -1
- data/lib/lazylead/version.rb +1 -1
- data/readme.md +33 -35
- data/test/lazylead/file_postman_test.rb +47 -0
- data/test/lazylead/retry_test.rb +11 -0
- data/test/lazylead/stdout_postman_test.rb +48 -0
- data/test/lazylead/task/accuracy/accuracy_test.rb +25 -0
- data/test/lazylead/task/accuracy/records_test.rb +43 -5
- metadata +68 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43563f79f164a2094eda0d74d373eaa3e90d564b1d653e49adb8c1c588d049d8
|
4
|
+
data.tar.gz: 3d7491056be166fed7667721827723dce02ddc7d529a4ac08c690d871e2df8d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2417a507a95b490d518c875635588c7eaedde588dd7c62c359f445d227afadae0625f52e05f998db69d45aa8c92f33910337f278b01ef42ea1904110ed01b7f
|
7
|
+
data.tar.gz: a8bb2a796784644fffdde7de78fe3726a4a718f0f769a19d030316f0dcaa6b57fbb6ff32e0e19a98d833a85dc246afadb1170a6c4c392761e0ada75918780c21
|
data/.circleci/config.yml
CHANGED
data/.docker/docker-compose.yml
CHANGED
@@ -5,19 +5,18 @@ services:
|
|
5
5
|
|
6
6
|
lazylead:
|
7
7
|
image: dgroup/lazylead:latest
|
8
|
-
container_name:
|
8
|
+
container_name: ll
|
9
9
|
mem_limit: 128m
|
10
10
|
build:
|
11
11
|
context: ../
|
12
12
|
dockerfile: .docker/Dockerfile
|
13
13
|
args:
|
14
|
-
release_tags: "latest 0.1.
|
15
|
-
version: "0.1.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
- 1282:1282 # JMX connection for jvisualvm debug
|
14
|
+
release_tags: "latest 0.1.x"
|
15
|
+
version: "0.1.x"
|
16
|
+
environment:
|
17
|
+
jira_url: https://jira.spring.io
|
18
|
+
file_postman_dir: "logs"
|
20
19
|
volumes:
|
21
|
-
- .local
|
22
|
-
- .local
|
23
|
-
entrypoint: bin/lazylead --trace --verbose --log-file /lazylead/logs/ll{{.%Y-%m-%dT%H:%M:%S}}.log
|
20
|
+
- .local:/lazylead/db
|
21
|
+
- .local:/lazylead/logs
|
22
|
+
entrypoint: bin/lazylead --trace --verbose --log-file /lazylead/logs/ll{{.%Y-%m-%dT%H:%M:%S}}.log --sqlite db/ll.db
|
data/.docs/accuracy.sql
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
insert into teams (id, name, properties)
|
2
|
+
values (1, 'Dream team with lazylead', '{}');
|
3
|
+
insert into systems(id, properties)
|
4
|
+
values (1, '{"type":"Lazylead::Jira", "site":"${jira_url}", "context_path":""}');
|
5
|
+
insert into tasks (name, schedule, enabled, id, system, team_id, action, properties)
|
6
|
+
values ('Expired due dates',
|
7
|
+
'cron:* * * * *',
|
8
|
+
'true',
|
9
|
+
1, 1, 1,
|
10
|
+
'Lazylead::Task::AssigneeAlert',
|
11
|
+
'{
|
12
|
+
"sql": "resolution = unresolved and due < startOfDay()",
|
13
|
+
"cc": "their@lead.com",
|
14
|
+
"subject": "[LL] Expired due dates",
|
15
|
+
"template": "lib/messages/due_date_expired.erb",
|
16
|
+
"postman": "Lazylead::FilePostman"
|
17
|
+
}');
|
18
|
+
insert into tasks (name, schedule, enabled, id, system, team_id, action, properties)
|
19
|
+
values ('Reporter''s ticket score in Spring Data MongoDB',
|
20
|
+
'cron:* * * * *',
|
21
|
+
'true',
|
22
|
+
2, 1, 1,
|
23
|
+
'Lazylead::Task::Accuracy',
|
24
|
+
'{
|
25
|
+
"from": "ll@fake.com",
|
26
|
+
"to": "lead@fake.com",
|
27
|
+
"rules": "Lazylead::Stacktrace,Lazylead::Testcase",
|
28
|
+
"fields": "attachment,description,environment,components,versions,reporter,labels,priority,duedate,summary",
|
29
|
+
"colors": "{\"0\":\"#FF4F33\",\"30\":\"#FEC15E\",\"50\":\"#19DD1E\"}",
|
30
|
+
"jql": "type=Bug and project =''Spring Data MongoDB'' and key >= DATAMONGO-1530 and key <= DATAMONGO-1600",
|
31
|
+
"silent": "true",
|
32
|
+
"subject": "[LL] Reporter''s ticket score in Spring Data MongoDB",
|
33
|
+
"template": "lib/messages/accuracy.erb",
|
34
|
+
"postman":"Lazylead::FilePostman"
|
35
|
+
}');
|
data/.rubocop.yml
CHANGED
@@ -89,6 +89,9 @@ Style/FormatStringToken:
|
|
89
89
|
- "lib/lazylead/task/accuracy/accuracy.rb"
|
90
90
|
Style/IfWithBooleanLiteralBranches: # (new in 1.9)
|
91
91
|
Enabled: true
|
92
|
+
# @todo #/DEV Enable Style/OpenStructUse rule, for now its disabled due to rubocop upgrade
|
93
|
+
Style/OpenStructUse:
|
94
|
+
Enabled: false
|
92
95
|
Lint/RaiseException:
|
93
96
|
Enabled: true
|
94
97
|
Lint/StructNewOverride:
|
@@ -208,4 +211,6 @@ Performance/RedundantEqualityComparisonBlock: # (new in 1.10)
|
|
208
211
|
Performance/RedundantSplitRegexpArgument: # (new in 1.10)
|
209
212
|
Enabled: true
|
210
213
|
Gemspec/DateAssignment: # (new in 1.10)
|
211
|
-
Enabled: true
|
214
|
+
Enabled: true
|
215
|
+
Gemspec/RequireMFA:
|
216
|
+
Enabled: false
|
data/Rakefile
CHANGED
@@ -94,7 +94,7 @@ desc "Validate all XML/XSL/XSD/HTML files for formatting"
|
|
94
94
|
Xcop::RakeTask.new :xcop do |task|
|
95
95
|
task.license = "license.txt"
|
96
96
|
task.includes = %w[**/*.xml **/*.xsl **/*.xsd **/*.html]
|
97
|
-
task.excludes = %w[target/**/* coverage/**/* wp/**/*]
|
97
|
+
task.excludes = %w[target/**/* coverage/**/* wp/**/* test/resources/*]
|
98
98
|
end
|
99
99
|
|
100
100
|
# @todo #/DEV Enable rule "Checks SQL against the ANSI syntax" fully.
|
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.12.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.12.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,11 +58,11 @@ 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", "2.1.0"
|
62
62
|
s.add_runtime_dependency "get_process_mem", "0.2.7"
|
63
63
|
s.add_runtime_dependency "inifile", "3.0.0"
|
64
|
-
s.add_runtime_dependency "jira-ruby", "2.
|
65
|
-
s.add_runtime_dependency "json", "2.
|
64
|
+
s.add_runtime_dependency "jira-ruby", "2.2.0"
|
65
|
+
s.add_runtime_dependency "json", "2.6.1"
|
66
66
|
s.add_runtime_dependency "logging", "2.3.0"
|
67
67
|
s.add_runtime_dependency "mail", "2.7.1"
|
68
68
|
s.add_runtime_dependency "memory_profiler", "1.0.0"
|
@@ -71,32 +71,35 @@ tasks instead of solving technical problems."
|
|
71
71
|
s.add_runtime_dependency "railties", "6.1.3"
|
72
72
|
s.add_runtime_dependency "require_all", "3.0.0"
|
73
73
|
s.add_runtime_dependency "rubyzip", "2.3.2"
|
74
|
-
s.add_runtime_dependency "rufus-scheduler", "3.8.
|
74
|
+
s.add_runtime_dependency "rufus-scheduler", "3.8.1"
|
75
75
|
s.add_runtime_dependency "slop", "4.9.1"
|
76
76
|
s.add_runtime_dependency "sqlite3", "1.4.2"
|
77
|
-
s.add_runtime_dependency "tempfile", "0.1.
|
77
|
+
s.add_runtime_dependency "tempfile", "0.1.2"
|
78
78
|
s.add_runtime_dependency "tilt", "2.0.10"
|
79
79
|
s.add_runtime_dependency "tzinfo", "2.0.4"
|
80
|
-
s.add_runtime_dependency "tzinfo-data", "1.2021.
|
80
|
+
s.add_runtime_dependency "tzinfo-data", "1.2021.5"
|
81
81
|
s.add_runtime_dependency "vcs4sql", "0.1.1"
|
82
82
|
s.add_runtime_dependency "viewpoint", "1.1.1"
|
83
|
+
s.add_runtime_dependency "zaru", "0.3.0"
|
83
84
|
s.add_development_dependency "codecov", "0.6.0"
|
84
85
|
s.add_development_dependency "guard", "2.18.0"
|
85
86
|
s.add_development_dependency "guard-minitest", "2.4.6"
|
86
|
-
s.add_development_dependency "minitest", "5.
|
87
|
+
s.add_development_dependency "minitest", "5.15.0"
|
87
88
|
s.add_development_dependency "minitest-fail-fast", "0.1.0"
|
88
89
|
s.add_development_dependency "minitest-hooks", "1.5.0"
|
89
|
-
s.add_development_dependency "minitest-reporters", "1.
|
90
|
+
s.add_development_dependency "minitest-reporters", "1.5.0"
|
90
91
|
s.add_development_dependency "net-ping", "2.0.8"
|
91
92
|
s.add_development_dependency "rake", "13.0.6"
|
92
93
|
s.add_development_dependency "random-port", "0.5.1"
|
93
|
-
s.add_development_dependency "rdoc", "6.
|
94
|
-
s.add_development_dependency "rubocop", "1.
|
95
|
-
s.add_development_dependency "rubocop-minitest", "0.
|
96
|
-
s.add_development_dependency "rubocop-performance", "1.
|
94
|
+
s.add_development_dependency "rdoc", "6.4.0"
|
95
|
+
s.add_development_dependency "rubocop", "1.24.1"
|
96
|
+
s.add_development_dependency "rubocop-minitest", "0.17.0"
|
97
|
+
s.add_development_dependency "rubocop-performance", "1.13.1"
|
97
98
|
s.add_development_dependency "rubocop-rake", "0.6.0"
|
98
|
-
s.add_development_dependency "rubocop-rspec", "2.
|
99
|
+
s.add_development_dependency "rubocop-rspec", "2.7.0"
|
100
|
+
s.add_development_dependency "ruby-prof", "1.4.3"
|
99
101
|
s.add_development_dependency "sqlint", "0.2.0"
|
100
|
-
s.add_development_dependency "tempfile", "0.1.
|
102
|
+
s.add_development_dependency "tempfile", "0.1.2"
|
101
103
|
s.add_development_dependency "xcop", "0.6.3"
|
104
|
+
s.metadata = { "rubygems_mfa_required" => "false" }
|
102
105
|
end
|
data/lib/lazylead/confluence.rb
CHANGED
@@ -34,8 +34,9 @@ module Lazylead
|
|
34
34
|
class Confluence
|
35
35
|
def initialize(conf)
|
36
36
|
@conf = conf
|
37
|
-
@http = Faraday.new(url: @conf.url)
|
38
|
-
|
37
|
+
@http = Faraday.new(url: @conf.url) do |conn|
|
38
|
+
conn.request :authorization, :basic, @conf.user, @conf.pass
|
39
|
+
end
|
39
40
|
end
|
40
41
|
|
41
42
|
# Confluence instance url like
|
data/lib/lazylead/model.rb
CHANGED
@@ -217,9 +217,10 @@ module Lazylead
|
|
217
217
|
retries ||= 0
|
218
218
|
@orig.exec
|
219
219
|
@orig
|
220
|
-
rescue StandardError
|
220
|
+
rescue StandardError => e
|
221
221
|
sleep(props.fetch("attempt_wait", 0).to_f) if props.key? "attempt_wait"
|
222
222
|
retry if (retries += 1) < props.fetch("attempt", 0).to_i
|
223
|
+
raise e if props.key? "rethrow"
|
223
224
|
@orig
|
224
225
|
end
|
225
226
|
end
|
data/lib/lazylead/postman.rb
CHANGED
@@ -22,6 +22,8 @@
|
|
22
22
|
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
23
23
|
# OR OTHER DEALINGS IN THE SOFTWARE.
|
24
24
|
|
25
|
+
require "zaru"
|
26
|
+
require "colorize"
|
25
27
|
require_relative "log"
|
26
28
|
require_relative "email"
|
27
29
|
require_relative "version"
|
@@ -76,4 +78,63 @@ module Lazylead
|
|
76
78
|
mail
|
77
79
|
end
|
78
80
|
end
|
81
|
+
|
82
|
+
#
|
83
|
+
# A postman that sends emails to the std out.
|
84
|
+
#
|
85
|
+
class StdoutPostman
|
86
|
+
def initialize(log = Log.new)
|
87
|
+
@log = log
|
88
|
+
end
|
89
|
+
|
90
|
+
# Send an email.
|
91
|
+
# :opts :: the mail configuration like to, from, cc, subject, template.
|
92
|
+
def send(opts)
|
93
|
+
if opts.msg_to.empty?
|
94
|
+
p "Email can't be sent as 'to' is empty, more: '#{opts}'"
|
95
|
+
else
|
96
|
+
p "to=#{opts.msg_to}, from=#{opts.msg_from}, cc=#{opts.msg_cc}, " \
|
97
|
+
"subject=#{opts['subject']}, attachments=#{opts.msg_attachments}, body=#{opts.msg_body}"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
#
|
103
|
+
# A postman that sends emails to the html file.
|
104
|
+
# Use ENV['file_postman_dir'] to set a root directory.
|
105
|
+
# By default
|
106
|
+
# ENV['file_postman_dir'] = "."
|
107
|
+
#
|
108
|
+
class FilePostman
|
109
|
+
def initialize(log = Log.new, env = ENV.to_h)
|
110
|
+
@log = log
|
111
|
+
@env = env
|
112
|
+
end
|
113
|
+
|
114
|
+
# Send an email.
|
115
|
+
# :opts :: the mail configuration like to, from, cc, subject, template.
|
116
|
+
def send(opts)
|
117
|
+
if opts.msg_to.empty?
|
118
|
+
@log.warn "ll-015: Email can't be sent as 'to' is empty, more: '#{opts}'"
|
119
|
+
""
|
120
|
+
else
|
121
|
+
file = filename(opts)
|
122
|
+
File.open(file, "w") do |f|
|
123
|
+
f.write "<!-- to=#{opts.msg_to}, from=#{opts.msg_from}, cc=#{opts.msg_cc}, " \
|
124
|
+
"subject=#{opts['subject']}, attachments=#{opts.msg_attachments} -->"
|
125
|
+
f.write opts.msg_body
|
126
|
+
end
|
127
|
+
@log.debug "Mail '#{opts['subject']}' for #{opts.msg_to} sent to " \
|
128
|
+
"'#{file.to_s.colorize(:light_blue)}'"
|
129
|
+
file
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
# Assemble file name where email to be print
|
134
|
+
def filename(opts)
|
135
|
+
dir = @env.fetch("file_postman_dir", ".")
|
136
|
+
FileUtils.mkdir_p(dir) unless File.exist?(dir)
|
137
|
+
File.join(dir, Zaru.sanitize!("#{Time.now.nsec}-#{opts['subject']}.html"))
|
138
|
+
end
|
139
|
+
end
|
79
140
|
end
|
data/lib/lazylead/schedule.rb
CHANGED
@@ -47,14 +47,10 @@ module Lazylead
|
|
47
47
|
raise "ll-002: task can't be a null" if task.nil?
|
48
48
|
@trigger.method(task.type).call(task.unit) do
|
49
49
|
ActiveRecord::Base.connection_pool.with_connection do
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
ORM::Retry.new(task, @log),
|
55
|
-
@log
|
56
|
-
).exec
|
57
|
-
end
|
50
|
+
t = task
|
51
|
+
t = ORM::Verbose.new(t, @log) unless t.props.key? "no_logs"
|
52
|
+
t = ORM::Retry.new(t, @log)
|
53
|
+
t.exec
|
58
54
|
end
|
59
55
|
end
|
60
56
|
@log.debug "Task scheduled: #{task}"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
## Enable profiler
|
2
|
+
https://ruby-prof.github.io
|
3
|
+
```ruby
|
4
|
+
require 'ruby-prof'
|
5
|
+
alloc = RubyProf.profile(:track_allocations => true) do
|
6
|
+
# code
|
7
|
+
end
|
8
|
+
printer = RubyProf::MultiPrinter.new(alloc)
|
9
|
+
printer.print(:path => ".", :profile => "alloc")
|
10
|
+
```
|
11
|
+
|
12
|
+
## Jira allocation memory
|
13
|
+
Fields: `assignee,summary,priority,duedate,reporter`
|
14
|
+
|
15
|
+
| Tickets | Bytes | KB | MB |
|
16
|
+
| ------------- | :-------: | :-------: | :-------: |
|
17
|
+
| 1 | 40 | 0.03 | 0,00003 |
|
18
|
+
| 157 | 6280 | 6.13 | 0.59 |
|
19
|
+
| 4315 | 172600 | 168.55 | 0.16 |
|
20
|
+
| 10379 | 415160 | 405.42 | 0.39 |
|
21
|
+
|~10000 | ~400000 | ~390.625 | ~0.38 |
|
22
|
+
|
23
|
+
## GitHub allocation memory
|
24
|
+
TBD
|
data/lib/lazylead/system/jira.rb
CHANGED
@@ -349,7 +349,7 @@ module Lazylead
|
|
349
349
|
extend Forwardable
|
350
350
|
def_delegators :@jira, :issues, :raw, :max_results, :limit
|
351
351
|
|
352
|
-
def initialize(url, path = "", log = Log.new)
|
352
|
+
def initialize(url, salt = NoSalt.new, path = "", log = Log.new)
|
353
353
|
@jira = Jira.new(
|
354
354
|
{
|
355
355
|
username: nil,
|
@@ -357,7 +357,7 @@ module Lazylead
|
|
357
357
|
site: url,
|
358
358
|
context_path: path
|
359
359
|
},
|
360
|
-
|
360
|
+
salt,
|
361
361
|
log
|
362
362
|
)
|
363
363
|
end
|
@@ -46,11 +46,16 @@ module Lazylead
|
|
46
46
|
|
47
47
|
def run(sys, postman, opts)
|
48
48
|
init_rules(opts)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
49
|
+
tasks = sys.issues(opts["jql"], opts.jira_defaults.merge(expand: "changelog"))
|
50
|
+
.map { |i| Score.new(i, opts) }
|
51
|
+
.each do |s|
|
52
|
+
s.evaluate
|
53
|
+
s.post
|
54
|
+
end
|
55
|
+
unless tasks.empty? && tasks.size <= opts.fetch(:limit, 300).to_i
|
56
|
+
opts[:tickets] = tasks
|
57
|
+
postman.send(opts)
|
58
|
+
end
|
54
59
|
opts
|
55
60
|
end
|
56
61
|
|
@@ -77,7 +82,7 @@ module Lazylead
|
|
77
82
|
# Accuracy is a percentage between current score and maximum possible value.
|
78
83
|
def evaluate(digits = 2)
|
79
84
|
@score = @opts[:rules].select { |r| r.passed(@issue) }.sum(&:score)
|
80
|
-
@accuracy = (score / @opts[:total] * 100).round(digits)
|
85
|
+
@accuracy = (@score.to_f / @opts[:total] * 100).round(digits)
|
81
86
|
self
|
82
87
|
end
|
83
88
|
|
@@ -27,21 +27,28 @@ require_relative "attachment"
|
|
27
27
|
module Lazylead
|
28
28
|
# Check that ticket has video record(s) with reproducing results.
|
29
29
|
class Records < Lazylead::Attachment
|
30
|
-
|
30
|
+
# @param ext
|
31
|
+
# The list of video records file extensions.
|
32
|
+
# @param size
|
33
|
+
# The minimum size of video records in bytes.
|
34
|
+
# Default value is 5KB.
|
35
|
+
def initialize(ext = [], size = 5 * 1024)
|
31
36
|
super("Internal reproducing results (video)", 5, "Attachments")
|
32
37
|
@ext = ext
|
38
|
+
@size = size
|
33
39
|
return unless @ext.empty?
|
34
40
|
@ext = %w[.webm .mkv .flv .flv .vob .ogv .ogg .drc .gif .gifv .mng .avi
|
35
41
|
.mts .m2ts .ts .mov .qt .wmv .yuv .rm .rmvb .viv .asf .amv .mp4
|
36
42
|
.m4p .m4v .mpg .mp2 .mpeg .mpe .mpv .mpg .mpeg .m2v .m4v .svi
|
37
|
-
.3gp .3g2 .mxf .roq .nsv .flv .f4v .f4p .f4a .f4b .
|
43
|
+
.3gp .3g2 .mxf .roq .nsv .flv .f4v .f4p .f4a .f4b .wrf]
|
38
44
|
end
|
39
45
|
|
40
46
|
# Ensure that ticket has an attachment with video-file extension
|
41
47
|
def matches?(attach)
|
48
|
+
return false if attach.attrs["size"].to_i < @size
|
42
49
|
return true if @ext.any? { |e| e.eql? File.extname(attach.attrs["filename"]).downcase }
|
43
50
|
return false if attach.attrs["mimeType"].nil?
|
44
|
-
@ext.any? { |e| attach.attrs["mimeType"].
|
51
|
+
@ext.any? { |e| attach.attrs["mimeType"].end_with? "/#{e[1..]}" }
|
45
52
|
end
|
46
53
|
end
|
47
54
|
end
|
@@ -51,7 +51,7 @@ module Lazylead
|
|
51
51
|
.to_enum(:scan, /!.+!/)
|
52
52
|
.map { Regexp.last_match }
|
53
53
|
.map(&:to_s)
|
54
|
-
.
|
54
|
+
.grep_v(%r{(http|https)://.*/images/icons/link_attachment.*.gif})
|
55
55
|
end
|
56
56
|
|
57
57
|
# Detect all pictures in ticket attachments and returns an array with file names.
|
data/lib/lazylead/task/echo.rb
CHANGED
@@ -0,0 +1,82 @@
|
|
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 "forwardable"
|
26
|
+
|
27
|
+
module Lazylead
|
28
|
+
# @todo #533/DEV Git `grep` command is required like Lazylead::SVN::Grep
|
29
|
+
#
|
30
|
+
# @todo #533/DEV Git `touch` command is required like Lazylead::SVN::Touch
|
31
|
+
#
|
32
|
+
# @todo #533/DEV Git `diff` command is required like Lazylead::SVN::Diff
|
33
|
+
module Git
|
34
|
+
#
|
35
|
+
# SVN commit built from command-line stdout (OS#run).
|
36
|
+
#
|
37
|
+
class Commit
|
38
|
+
def initialize(raw)
|
39
|
+
@raw = raw
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_s
|
43
|
+
"#{id} #{msg}"
|
44
|
+
end
|
45
|
+
|
46
|
+
# @todo #/DEV Git Commit#id implementation is required based on `git` ruby gem
|
47
|
+
def id; end
|
48
|
+
|
49
|
+
# @todo #/DEV Git Commit#author implementation is required based on `git` ruby gem
|
50
|
+
def author; end
|
51
|
+
|
52
|
+
# @todo #/DEV Git Commit#time implementation is required based on `git` ruby gem
|
53
|
+
def time; end
|
54
|
+
|
55
|
+
# @todo #/DEV Git Commit#msg implementation is required based on `git` ruby gem
|
56
|
+
def msg; end
|
57
|
+
|
58
|
+
# @todo #/DEV Git Commit#lines implementation is required based on `git` ruby gem
|
59
|
+
def lines; end
|
60
|
+
|
61
|
+
# @todo #/DEV Git Commit#header implementation is required based on `git` ruby gem
|
62
|
+
def header; end
|
63
|
+
|
64
|
+
# The modified lines contains expected text
|
65
|
+
# @todo #/DEV Git Commit#includes? implementation is required based on `git` ruby gem
|
66
|
+
def includes?(text); end
|
67
|
+
end
|
68
|
+
|
69
|
+
#
|
70
|
+
# Git commits built from command-line stdout (OS#run).
|
71
|
+
#
|
72
|
+
# @todo #/DEV Git Commits implementation is required based on `git` ruby gem
|
73
|
+
class Commits
|
74
|
+
extend Forwardable
|
75
|
+
def_delegators :@all, :each, :map, :select, :empty?
|
76
|
+
|
77
|
+
def initialize(stdout)
|
78
|
+
@stdout = stdout
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -38,8 +38,7 @@ module Lazylead
|
|
38
38
|
def run(sys, postman, opts)
|
39
39
|
assignments = sys.issues(opts["jql"], opts.jira_defaults)
|
40
40
|
.group_by(&:assignee)
|
41
|
-
.
|
42
|
-
.to_h
|
41
|
+
.to_h { |user, tasks| [user.id, Teammate.new(user, tasks)] }
|
43
42
|
opts.slice("team", ",")
|
44
43
|
.map { |m| m.split(":") }
|
45
44
|
.each { |id, name| assignments[id] = Free.new(id, name) unless assignments.key? id }
|
@@ -87,9 +87,9 @@ module Lazylead
|
|
87
87
|
# Fill pre-defined fields for sub-tasks from parent ticket
|
88
88
|
# and post comment to ticket with clarification.
|
89
89
|
def propagate
|
90
|
-
expected = @fields.
|
90
|
+
expected = @fields.to_h { |f| [f, @issue.fields[f]] }
|
91
91
|
@subtasks.each do |subtask|
|
92
|
-
actual = @fields.
|
92
|
+
actual = @fields.to_h { |f| [f, subtask.fields[f]] }
|
93
93
|
diff = diff(expected, actual)
|
94
94
|
next if diff.empty?
|
95
95
|
subtask.save(fields: diff)
|
data/lib/lazylead/version.rb
CHANGED
data/readme.md
CHANGED
@@ -19,8 +19,6 @@
|
|
19
19
|
[![DevOps By Rultor.com](http://www.rultor.com/b/dgroup/lazylead)](http://www.rultor.com/p/dgroup/lazylead)
|
20
20
|
[![EO badge](http://www.elegantobjects.org/badge.svg)](http://www.elegantobjects.org/#principles)
|
21
21
|
|
22
|
-
⚠️ We're still in a very early alpha version, the API may change frequently until we release version `1.0`.
|
23
|
-
|
24
22
|
### Overview
|
25
23
|
Ticketing systems (Github, Jira, etc.) are strongly integrated into our processes and everyone understands their necessity. As soon as a developer becomes a lead/technical manager, he or she faces a set of routine tasks that are related to ticketing work. On large projects this becomes a problem, more and more you spend time running around on dashboards and tickets, looking for incorrect deviations in tickets and performing routine tasks instead of solving technical problems.
|
26
24
|
|
@@ -28,35 +26,35 @@ The idea of automatic management is not new, for example [Zerocracy](https://www
|
|
28
26
|
I like this idea, but large companies/projects are not ready yet for such a decisive breakthrough and need step-by-step solutions such as [lazylead](https://github.com/dgroup/lazylead).
|
29
27
|
I think you remember how [static code analysis](https://en.wikipedia.org/wiki/Static_program_analysis) treated at in the past; today we have a huge toolkit (pmd, checkstyle, qulice, rubocop, peon, etc) for each language that allows you to avoid routine issues and remove from the code reviewer the unnecessary load.
|
30
28
|
|
31
|
-
Join our telegram
|
32
|
-
|
33
|
-
| Daily annoying task | Jira | Github | Trello | SVN |
|
34
|
-
| :---------------------------------------------------------------------------------- | :---: | :----: | :----: | :----: |
|
35
|
-
| [Notify ticket's assignee](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ | ❌ |
|
36
|
-
| [Notify ticket's reporter](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ | ❌ |
|
37
|
-
| [Notify ticket's manager](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ | ❌ |
|
38
|
-
| [Notify about illegal "Fix Version" modification](lib/lazylead/task/fix_version.rb) | ✅ | ❌ | ❌ | ❌ |
|
39
|
-
| [Expected comment in ticket is missing](lib/lazylead/task/missing_comment.rb) | ✅ | ⌛ | ⌛ | ❌ |
|
40
|
-
| [Propagate some fields from parent ticket into sub-tasks](.docs/propagate_down.md) | ✅ | ❌ | ❌ | ❌ |
|
41
|
-
| [Evaluate the ticket formatting accuracy](.docs/accuracy.md) | ✅ | ⌛ | ⌛ | ❌ |
|
42
|
-
| Print the current capacity of team into newly created tasks | ⌛ | ⌛ | ⌛ | ❌ |
|
43
|
-
| Create/retrofit the defect automatically into latest release | ⌛ | ⌛ | ❌ | ❌ |
|
44
|
-
| [Notify about expired(ing) due dates](.docs/duedate_expired.md) | ✅ | ❌ | ⌛ | ❌ |
|
45
|
-
| Notify about absent original estimations | ⌛ | ⌛ | ⌛ | ❌ |
|
46
|
-
| Notify about 'Hot potato' tickets | ⌛ | ⌛ | ⌛ | ❌ |
|
47
|
-
| Notify about long live tickets (aging) | ⌛ | ⌛ | ⌛ | ❌ |
|
48
|
-
| Create a meeting(s) automatically in case some tickets appeared (group by assignee/reporters/component/ticket type/etc) | ⌛ | ⌛ | ⌛ | ❌ |
|
49
|
-
| Propogate fields from parent tickets to sub-tasks | ✅ | ⌛ | ⌛ | ❌ |
|
50
|
-
| Notify about tickets without comments with expected text | ✅ | ⌛ | ⌛ | ❌ |
|
51
|
-
| [Notify about team loading (no tasks on teammates)](lib/lazylead/task/loading.rb) | ✅ | ⌛ | ⌛ | ❌ |
|
52
|
-
| Notify about tickets matches predefined multiple conditions | ✅ | ⌛ | ⌛ | ❌ |
|
53
|
-
| Link automatically the ticket and Confluence page if link found in ticket's comments/description | ✅ | ⌛ | ⌛ | ❌ |
|
54
|
-
| Notify about tickets assigned to your team members not by effective managers| ✅ | ⌛ | ⌛ | ❌ |
|
55
|
-
| Notify about modifications of important files in VCS | ❌ | ⌛ | ❌ | ✅ |
|
56
|
-
| Notify about diff changes for past X period in VCS | ❌ | ⌛ | ❌ | ✅ |
|
57
|
-
| Notify about changes with some text for past X period in VCS | ❌ | ⌛ | ❌ | ✅ |
|
58
|
-
| [Notify when someone outside of your team changed the due date on tickets for your team](lib/lazylead/task/micromanager.rb)| ✅ | ⌛ | ❌ | ❌ |
|
59
|
-
| [Notify when someone outside of your team assigned a ticket directly to the developer](lib/lazylead/task/assignment.rb)| ✅ | ⌛ | ❌ | ❌ |
|
29
|
+
Join our telegram chat [lazylead](https://t.me/lazyleads) for discussions.
|
30
|
+
|
31
|
+
| Daily annoying task | Jira | Github | Trello | SVN | Git |
|
32
|
+
| :---------------------------------------------------------------------------------- | :---: | :----: | :----: | :----: | :----: |
|
33
|
+
| [Notify ticket's assignee](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ | ❌ | ❌ |
|
34
|
+
| [Notify ticket's reporter](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ | ❌ | ❌ |
|
35
|
+
| [Notify ticket's manager](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ | ❌ | ❌ |
|
36
|
+
| [Notify about illegal "Fix Version" modification](lib/lazylead/task/fix_version.rb) | ✅ | ❌ | ❌ | ❌ | ❌ |
|
37
|
+
| [Expected comment in ticket is missing](lib/lazylead/task/missing_comment.rb) | ✅ | ⌛ | ⌛ | ❌ | ❌ |
|
38
|
+
| [Propagate some fields from parent ticket into sub-tasks](.docs/propagate_down.md) | ✅ | ❌ | ❌ | ❌ | ❌ |
|
39
|
+
| [Evaluate the ticket formatting accuracy](.docs/accuracy.md) | ✅ | ⌛ | ⌛ | ❌ | ❌ |
|
40
|
+
| Print the current capacity of team into newly created tasks | ⌛ | ⌛ | ⌛ | ❌ | ❌ |
|
41
|
+
| Create/retrofit the defect automatically into latest release | ⌛ | ⌛ | ❌ | ❌ | ❌ |
|
42
|
+
| [Notify about expired(ing) due dates](.docs/duedate_expired.md) | ✅ | ❌ | ⌛ | ❌ | ❌ |
|
43
|
+
| Notify about absent original estimations | ⌛ | ⌛ | ⌛ | ❌ | ❌ |
|
44
|
+
| Notify about 'Hot potato' tickets | ⌛ | ⌛ | ⌛ | ❌ | ❌ |
|
45
|
+
| Notify about long live tickets (aging) | ⌛ | ⌛ | ⌛ | ❌ | ❌ |
|
46
|
+
| Create a meeting(s) automatically in case some tickets appeared (group by assignee/reporters/component/ticket type/etc) | ⌛ | ⌛ | ⌛ | ❌ | ❌ |
|
47
|
+
| Propogate fields from parent tickets to sub-tasks | ✅ | ⌛ | ⌛ | ❌ | ❌ |
|
48
|
+
| Notify about tickets without comments with expected text | ✅ | ⌛ | ⌛ | ❌ | ❌ |
|
49
|
+
| [Notify about team loading (no tasks on teammates)](lib/lazylead/task/loading.rb) | ✅ | ⌛ | ⌛ | ❌ | ❌ |
|
50
|
+
| Notify about tickets matches predefined multiple conditions | ✅ | ⌛ | ⌛ | ❌ | ❌ |
|
51
|
+
| Link automatically the ticket and Confluence page if link found in ticket's comments/description | ✅ | ⌛ | ⌛ | ❌ | ❌ |
|
52
|
+
| Notify about tickets assigned to your team members not by effective managers| ✅ | ⌛ | ⌛ | ❌ | ❌ |
|
53
|
+
| Notify about modifications of important files in VCS | ❌ | ⌛ | ❌ | ✅ | 🚴 |
|
54
|
+
| Notify about diff changes for past X period in VCS | ❌ | ⌛ | ❌ | ✅ | 🚴 |
|
55
|
+
| Notify about changes with some text for past X period in VCS | ❌ | ⌛ | ❌ | ✅ | 🚴 |
|
56
|
+
| [Notify when someone outside of your team changed the due date on tickets for your team](lib/lazylead/task/micromanager.rb)| ✅ | ⌛ | ❌ | ❌ | ❌ |
|
57
|
+
| [Notify when someone outside of your team assigned a ticket directly to the developer](lib/lazylead/task/assignment.rb)| ✅ | ⌛ | ❌ | ❌ | ❌ |
|
60
58
|
|
61
59
|
| Integration | Type | Status |
|
62
60
|
| :---------------------------------------------------- | :-----------: | :----: |
|
@@ -66,8 +64,11 @@ Join our telegram group [lazylead.org](https://t.me/lazyleads) for discussions.
|
|
66
64
|
| [mail.google.com](lib/lazylead/postman.rb) | Emails | 🌵 |
|
67
65
|
| calendar.google.com | Calendar | ⌛ |
|
68
66
|
| slack.com | Notifications | ⌛ |
|
67
|
+
| GitHub | VCS + CI/CD | ⌛ |
|
68
|
+
| GitLab | VCS + CI/CD | ⌛ |
|
69
|
+
| BitBucket | VCS + CI/CD | ⌛ |
|
69
70
|
|
70
|
-
|
71
|
+
🚴🏽 - in-progress, ⌛ - planned, ✅ - implemented, 🌵 - implemented, but not tested, ❌ - not supported/planned.
|
71
72
|
|
72
73
|
New ideas, bugs, suggestions or questions are welcome [via GitHub issues](https://github.com/dgroup/lazylead/issues/new)!
|
73
74
|
|
@@ -183,6 +184,3 @@ For simplicity, we are using [docker-compose](https://docs.docker.com/compose/):
|
|
183
184
|
rake -A
|
184
185
|
```
|
185
186
|
Everyone interacting in this project’s codebases, issue trackers, chat rooms is expected to follow the [code of conduct](.github/CODE_OF_CONDUCT.md).
|
186
|
-
|
187
|
-
Contributors:
|
188
|
-
* [dgroup](https://github.com/dgroup) as Yurii Dubinka ([yurii.dubinka@gmail.com](mailto:yurii.dubinka@gmail.com))
|
@@ -0,0 +1,47 @@
|
|
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_relative "../test"
|
26
|
+
require_relative "../../lib/lazylead/log"
|
27
|
+
require_relative "../../lib/lazylead/opts"
|
28
|
+
require_relative "../../lib/lazylead/salt"
|
29
|
+
require_relative "../../lib/lazylead/smtp"
|
30
|
+
require_relative "../../lib/lazylead/postman"
|
31
|
+
|
32
|
+
module Lazylead
|
33
|
+
class FilePostmanTest < Lazylead::Test
|
34
|
+
test "send email to html file" do
|
35
|
+
assert_path_exists FilePostman.new(Log.new, "file_postman_dir" => "test/resources")
|
36
|
+
.send(
|
37
|
+
Opts.new(
|
38
|
+
"to" => "to@email.com",
|
39
|
+
"from" => "from@email.com",
|
40
|
+
"attachments" => ["readme.md"],
|
41
|
+
"subject" => "[LL] FilePostmanTest attachment",
|
42
|
+
"template" => "lib/messages/savepoint.erb"
|
43
|
+
)
|
44
|
+
)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/test/lazylead/retry_test.rb
CHANGED
@@ -81,5 +81,16 @@ module Lazylead
|
|
81
81
|
)
|
82
82
|
).exec.attempts
|
83
83
|
end
|
84
|
+
|
85
|
+
test "throw error" do
|
86
|
+
assert_raises(RuntimeError, "network issue") do
|
87
|
+
ORM::Retry.new(
|
88
|
+
FakeTask.new(
|
89
|
+
proc { raise "network issue" },
|
90
|
+
{ "rethrow" => "true" }
|
91
|
+
)
|
92
|
+
).exec
|
93
|
+
end
|
94
|
+
end
|
84
95
|
end
|
85
96
|
end
|
@@ -0,0 +1,48 @@
|
|
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_relative "../test"
|
26
|
+
require_relative "../../lib/lazylead/log"
|
27
|
+
require_relative "../../lib/lazylead/opts"
|
28
|
+
require_relative "../../lib/lazylead/salt"
|
29
|
+
require_relative "../../lib/lazylead/smtp"
|
30
|
+
require_relative "../../lib/lazylead/postman"
|
31
|
+
|
32
|
+
module Lazylead
|
33
|
+
class StdoutPostmanTest < Lazylead::Test
|
34
|
+
# @todo #495/DEV Find way to capture the STDOUT in order to test the email sending.
|
35
|
+
# Right now its just visual verification.
|
36
|
+
test "send email to stdout" do
|
37
|
+
StdoutPostman.new.send(
|
38
|
+
Opts.new(
|
39
|
+
"to" => "to@email.com",
|
40
|
+
"from" => "from@email.com",
|
41
|
+
"attachments" => ["readme.md"],
|
42
|
+
"subject" => "[LL] Attachments",
|
43
|
+
"template" => "lib/messages/savepoint.erb"
|
44
|
+
)
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -97,5 +97,30 @@ module Lazylead
|
|
97
97
|
)
|
98
98
|
)[:tickets].size
|
99
99
|
end
|
100
|
+
|
101
|
+
test "score is correct" do
|
102
|
+
Lazylead::Smtp.new.enable
|
103
|
+
Task::Accuracy.new.run(
|
104
|
+
NoAuthJira.new("https://jira.spring.io"),
|
105
|
+
Postman.new,
|
106
|
+
Opts.new(
|
107
|
+
"from" => "ll@fake.com",
|
108
|
+
"to" => "lead@fake.com",
|
109
|
+
"rules" => "Lazylead::Stacktrace,Lazylead::Testcase",
|
110
|
+
"fields" => "attachment,description,reporter,priority,duedate,summary",
|
111
|
+
"colors" => {
|
112
|
+
"0" => "#FF4F33",
|
113
|
+
"30" => "#FEC15E",
|
114
|
+
"50" => "#19DD1E"
|
115
|
+
}.to_json.to_s,
|
116
|
+
"jql" => "key=DATAMONGO-1532",
|
117
|
+
"silent" => "true",
|
118
|
+
"subject" => "[LL] Check DATAMONGO-1532",
|
119
|
+
"template" => "lib/messages/accuracy.erb"
|
120
|
+
)
|
121
|
+
)
|
122
|
+
assert_email "[LL] Check DATAMONGO-1532",
|
123
|
+
"DATAMONGO-1532", "3", "42.86%"
|
124
|
+
end
|
100
125
|
end
|
101
126
|
end
|
@@ -32,7 +32,10 @@ module Lazylead
|
|
32
32
|
assert Records.new.passed(
|
33
33
|
OpenStruct.new(
|
34
34
|
attachments: [
|
35
|
-
OpenStruct.new(attrs: {
|
35
|
+
OpenStruct.new(attrs: {
|
36
|
+
"filename" => "failed case 1.mp4",
|
37
|
+
"size" => 6 * 1024
|
38
|
+
})
|
36
39
|
]
|
37
40
|
)
|
38
41
|
)
|
@@ -42,7 +45,10 @@ module Lazylead
|
|
42
45
|
assert Records.new.passed(
|
43
46
|
OpenStruct.new(
|
44
47
|
attachments: [
|
45
|
-
OpenStruct.new(attrs: {
|
48
|
+
OpenStruct.new(attrs: {
|
49
|
+
"filename" => "failed case 2.avi",
|
50
|
+
"size" => 6 * 1024
|
51
|
+
})
|
46
52
|
]
|
47
53
|
)
|
48
54
|
)
|
@@ -52,7 +58,10 @@ module Lazylead
|
|
52
58
|
refute Records.new.passed(
|
53
59
|
OpenStruct.new(
|
54
60
|
attachments: [
|
55
|
-
OpenStruct.new(attrs: {
|
61
|
+
OpenStruct.new(attrs: {
|
62
|
+
"filename" => "failed case 2.txt",
|
63
|
+
"size" => 6 * 1024
|
64
|
+
})
|
56
65
|
]
|
57
66
|
)
|
58
67
|
)
|
@@ -60,12 +69,41 @@ module Lazylead
|
|
60
69
|
|
61
70
|
test "mime type has .gif despite on ext" do
|
62
71
|
assert Records.new.passed(
|
72
|
+
OpenStruct.new(
|
73
|
+
attachments: [
|
74
|
+
OpenStruct.new(attrs: {
|
75
|
+
"filename" => "snapshot.png",
|
76
|
+
"mimeType" => "image/gif",
|
77
|
+
"size" => 6 * 1024
|
78
|
+
})
|
79
|
+
]
|
80
|
+
)
|
81
|
+
)
|
82
|
+
end
|
83
|
+
|
84
|
+
test "mime type is xlsx" do
|
85
|
+
refute Records.new.passed(
|
86
|
+
OpenStruct.new(
|
87
|
+
attachments: [
|
88
|
+
OpenStruct.new(attrs: {
|
89
|
+
"filename" => "snapshot.xlsx",
|
90
|
+
"mimeType" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
91
|
+
"size" => 6 * 1024
|
92
|
+
})
|
93
|
+
]
|
94
|
+
)
|
95
|
+
)
|
96
|
+
end
|
97
|
+
|
98
|
+
test "empty gif" do
|
99
|
+
refute Records.new.passed(
|
63
100
|
OpenStruct.new(
|
64
101
|
attachments: [
|
65
102
|
OpenStruct.new(
|
66
103
|
attrs: {
|
67
|
-
"filename" => "
|
68
|
-
"mimeType" => "image/gif"
|
104
|
+
"filename" => "steps.gif",
|
105
|
+
"mimeType" => "image/gif",
|
106
|
+
"size" => "0"
|
69
107
|
}
|
70
108
|
)
|
71
109
|
]
|
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.12.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:
|
11
|
+
date: 2022-01-17 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: 2.1.0
|
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: 2.1.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: get_process_mem
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,28 +100,28 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - '='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 2.
|
103
|
+
version: 2.2.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 2.
|
110
|
+
version: 2.2.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: json
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - '='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 2.
|
117
|
+
version: 2.6.1
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - '='
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 2.
|
124
|
+
version: 2.6.1
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: logging
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,14 +240,14 @@ dependencies:
|
|
240
240
|
requirements:
|
241
241
|
- - '='
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version: 3.8.
|
243
|
+
version: 3.8.1
|
244
244
|
type: :runtime
|
245
245
|
prerelease: false
|
246
246
|
version_requirements: !ruby/object:Gem::Requirement
|
247
247
|
requirements:
|
248
248
|
- - '='
|
249
249
|
- !ruby/object:Gem::Version
|
250
|
-
version: 3.8.
|
250
|
+
version: 3.8.1
|
251
251
|
- !ruby/object:Gem::Dependency
|
252
252
|
name: slop
|
253
253
|
requirement: !ruby/object:Gem::Requirement
|
@@ -282,14 +282,14 @@ dependencies:
|
|
282
282
|
requirements:
|
283
283
|
- - '='
|
284
284
|
- !ruby/object:Gem::Version
|
285
|
-
version: 0.1.
|
285
|
+
version: 0.1.2
|
286
286
|
type: :runtime
|
287
287
|
prerelease: false
|
288
288
|
version_requirements: !ruby/object:Gem::Requirement
|
289
289
|
requirements:
|
290
290
|
- - '='
|
291
291
|
- !ruby/object:Gem::Version
|
292
|
-
version: 0.1.
|
292
|
+
version: 0.1.2
|
293
293
|
- !ruby/object:Gem::Dependency
|
294
294
|
name: tilt
|
295
295
|
requirement: !ruby/object:Gem::Requirement
|
@@ -324,14 +324,14 @@ dependencies:
|
|
324
324
|
requirements:
|
325
325
|
- - '='
|
326
326
|
- !ruby/object:Gem::Version
|
327
|
-
version: 1.2021.
|
327
|
+
version: 1.2021.5
|
328
328
|
type: :runtime
|
329
329
|
prerelease: false
|
330
330
|
version_requirements: !ruby/object:Gem::Requirement
|
331
331
|
requirements:
|
332
332
|
- - '='
|
333
333
|
- !ruby/object:Gem::Version
|
334
|
-
version: 1.2021.
|
334
|
+
version: 1.2021.5
|
335
335
|
- !ruby/object:Gem::Dependency
|
336
336
|
name: vcs4sql
|
337
337
|
requirement: !ruby/object:Gem::Requirement
|
@@ -360,6 +360,20 @@ dependencies:
|
|
360
360
|
- - '='
|
361
361
|
- !ruby/object:Gem::Version
|
362
362
|
version: 1.1.1
|
363
|
+
- !ruby/object:Gem::Dependency
|
364
|
+
name: zaru
|
365
|
+
requirement: !ruby/object:Gem::Requirement
|
366
|
+
requirements:
|
367
|
+
- - '='
|
368
|
+
- !ruby/object:Gem::Version
|
369
|
+
version: 0.3.0
|
370
|
+
type: :runtime
|
371
|
+
prerelease: false
|
372
|
+
version_requirements: !ruby/object:Gem::Requirement
|
373
|
+
requirements:
|
374
|
+
- - '='
|
375
|
+
- !ruby/object:Gem::Version
|
376
|
+
version: 0.3.0
|
363
377
|
- !ruby/object:Gem::Dependency
|
364
378
|
name: codecov
|
365
379
|
requirement: !ruby/object:Gem::Requirement
|
@@ -408,14 +422,14 @@ dependencies:
|
|
408
422
|
requirements:
|
409
423
|
- - '='
|
410
424
|
- !ruby/object:Gem::Version
|
411
|
-
version: 5.
|
425
|
+
version: 5.15.0
|
412
426
|
type: :development
|
413
427
|
prerelease: false
|
414
428
|
version_requirements: !ruby/object:Gem::Requirement
|
415
429
|
requirements:
|
416
430
|
- - '='
|
417
431
|
- !ruby/object:Gem::Version
|
418
|
-
version: 5.
|
432
|
+
version: 5.15.0
|
419
433
|
- !ruby/object:Gem::Dependency
|
420
434
|
name: minitest-fail-fast
|
421
435
|
requirement: !ruby/object:Gem::Requirement
|
@@ -450,14 +464,14 @@ dependencies:
|
|
450
464
|
requirements:
|
451
465
|
- - '='
|
452
466
|
- !ruby/object:Gem::Version
|
453
|
-
version: 1.
|
467
|
+
version: 1.5.0
|
454
468
|
type: :development
|
455
469
|
prerelease: false
|
456
470
|
version_requirements: !ruby/object:Gem::Requirement
|
457
471
|
requirements:
|
458
472
|
- - '='
|
459
473
|
- !ruby/object:Gem::Version
|
460
|
-
version: 1.
|
474
|
+
version: 1.5.0
|
461
475
|
- !ruby/object:Gem::Dependency
|
462
476
|
name: net-ping
|
463
477
|
requirement: !ruby/object:Gem::Requirement
|
@@ -506,56 +520,56 @@ dependencies:
|
|
506
520
|
requirements:
|
507
521
|
- - '='
|
508
522
|
- !ruby/object:Gem::Version
|
509
|
-
version: 6.
|
523
|
+
version: 6.4.0
|
510
524
|
type: :development
|
511
525
|
prerelease: false
|
512
526
|
version_requirements: !ruby/object:Gem::Requirement
|
513
527
|
requirements:
|
514
528
|
- - '='
|
515
529
|
- !ruby/object:Gem::Version
|
516
|
-
version: 6.
|
530
|
+
version: 6.4.0
|
517
531
|
- !ruby/object:Gem::Dependency
|
518
532
|
name: rubocop
|
519
533
|
requirement: !ruby/object:Gem::Requirement
|
520
534
|
requirements:
|
521
535
|
- - '='
|
522
536
|
- !ruby/object:Gem::Version
|
523
|
-
version: 1.
|
537
|
+
version: 1.24.1
|
524
538
|
type: :development
|
525
539
|
prerelease: false
|
526
540
|
version_requirements: !ruby/object:Gem::Requirement
|
527
541
|
requirements:
|
528
542
|
- - '='
|
529
543
|
- !ruby/object:Gem::Version
|
530
|
-
version: 1.
|
544
|
+
version: 1.24.1
|
531
545
|
- !ruby/object:Gem::Dependency
|
532
546
|
name: rubocop-minitest
|
533
547
|
requirement: !ruby/object:Gem::Requirement
|
534
548
|
requirements:
|
535
549
|
- - '='
|
536
550
|
- !ruby/object:Gem::Version
|
537
|
-
version: 0.
|
551
|
+
version: 0.17.0
|
538
552
|
type: :development
|
539
553
|
prerelease: false
|
540
554
|
version_requirements: !ruby/object:Gem::Requirement
|
541
555
|
requirements:
|
542
556
|
- - '='
|
543
557
|
- !ruby/object:Gem::Version
|
544
|
-
version: 0.
|
558
|
+
version: 0.17.0
|
545
559
|
- !ruby/object:Gem::Dependency
|
546
560
|
name: rubocop-performance
|
547
561
|
requirement: !ruby/object:Gem::Requirement
|
548
562
|
requirements:
|
549
563
|
- - '='
|
550
564
|
- !ruby/object:Gem::Version
|
551
|
-
version: 1.
|
565
|
+
version: 1.13.1
|
552
566
|
type: :development
|
553
567
|
prerelease: false
|
554
568
|
version_requirements: !ruby/object:Gem::Requirement
|
555
569
|
requirements:
|
556
570
|
- - '='
|
557
571
|
- !ruby/object:Gem::Version
|
558
|
-
version: 1.
|
572
|
+
version: 1.13.1
|
559
573
|
- !ruby/object:Gem::Dependency
|
560
574
|
name: rubocop-rake
|
561
575
|
requirement: !ruby/object:Gem::Requirement
|
@@ -576,14 +590,28 @@ dependencies:
|
|
576
590
|
requirements:
|
577
591
|
- - '='
|
578
592
|
- !ruby/object:Gem::Version
|
579
|
-
version: 2.
|
593
|
+
version: 2.7.0
|
594
|
+
type: :development
|
595
|
+
prerelease: false
|
596
|
+
version_requirements: !ruby/object:Gem::Requirement
|
597
|
+
requirements:
|
598
|
+
- - '='
|
599
|
+
- !ruby/object:Gem::Version
|
600
|
+
version: 2.7.0
|
601
|
+
- !ruby/object:Gem::Dependency
|
602
|
+
name: ruby-prof
|
603
|
+
requirement: !ruby/object:Gem::Requirement
|
604
|
+
requirements:
|
605
|
+
- - '='
|
606
|
+
- !ruby/object:Gem::Version
|
607
|
+
version: 1.4.3
|
580
608
|
type: :development
|
581
609
|
prerelease: false
|
582
610
|
version_requirements: !ruby/object:Gem::Requirement
|
583
611
|
requirements:
|
584
612
|
- - '='
|
585
613
|
- !ruby/object:Gem::Version
|
586
|
-
version:
|
614
|
+
version: 1.4.3
|
587
615
|
- !ruby/object:Gem::Dependency
|
588
616
|
name: sqlint
|
589
617
|
requirement: !ruby/object:Gem::Requirement
|
@@ -604,14 +632,14 @@ dependencies:
|
|
604
632
|
requirements:
|
605
633
|
- - '='
|
606
634
|
- !ruby/object:Gem::Version
|
607
|
-
version: 0.1.
|
635
|
+
version: 0.1.2
|
608
636
|
type: :development
|
609
637
|
prerelease: false
|
610
638
|
version_requirements: !ruby/object:Gem::Requirement
|
611
639
|
requirements:
|
612
640
|
- - '='
|
613
641
|
- !ruby/object:Gem::Version
|
614
|
-
version: 0.1.
|
642
|
+
version: 0.1.2
|
615
643
|
- !ruby/object:Gem::Dependency
|
616
644
|
name: xcop
|
617
645
|
requirement: !ruby/object:Gem::Requirement
|
@@ -654,6 +682,7 @@ files:
|
|
654
682
|
- ".docker/readme.md"
|
655
683
|
- ".docker/vcs.dockerfile"
|
656
684
|
- ".docs/accuracy.md"
|
685
|
+
- ".docs/accuracy.sql"
|
657
686
|
- ".docs/accuracy_email.jpg"
|
658
687
|
- ".docs/accuracy_jira_comment.jpg"
|
659
688
|
- ".docs/duedate_expired.md"
|
@@ -700,6 +729,7 @@ files:
|
|
700
729
|
- lib/lazylead/salt.rb
|
701
730
|
- lib/lazylead/schedule.rb
|
702
731
|
- lib/lazylead/smtp.rb
|
732
|
+
- lib/lazylead/system/allocations.md
|
703
733
|
- lib/lazylead/system/empty.rb
|
704
734
|
- lib/lazylead/system/fake.rb
|
705
735
|
- lib/lazylead/system/jira.rb
|
@@ -730,6 +760,7 @@ files:
|
|
730
760
|
- lib/lazylead/task/confluence_ref.rb
|
731
761
|
- lib/lazylead/task/echo.rb
|
732
762
|
- lib/lazylead/task/fix_version.rb
|
763
|
+
- lib/lazylead/task/git/git.rb
|
733
764
|
- lib/lazylead/task/loading.rb
|
734
765
|
- lib/lazylead/task/micromanager.rb
|
735
766
|
- lib/lazylead/task/missing_comment.rb
|
@@ -762,6 +793,7 @@ files:
|
|
762
793
|
- test/lazylead/cli/app_test.rb
|
763
794
|
- test/lazylead/confluence_test.rb
|
764
795
|
- test/lazylead/exchange_test.rb
|
796
|
+
- test/lazylead/file_postman_test.rb
|
765
797
|
- test/lazylead/model_test.rb
|
766
798
|
- test/lazylead/opts_test.rb
|
767
799
|
- test/lazylead/postman_test.rb
|
@@ -769,6 +801,7 @@ files:
|
|
769
801
|
- test/lazylead/salt_test.rb
|
770
802
|
- test/lazylead/smoke_test.rb
|
771
803
|
- test/lazylead/smtp_test.rb
|
804
|
+
- test/lazylead/stdout_postman_test.rb
|
772
805
|
- test/lazylead/system/jira_test.rb
|
773
806
|
- test/lazylead/task/accuracy/accuracy_test.rb
|
774
807
|
- test/lazylead/task/accuracy/affected_build_test.rb
|
@@ -813,9 +846,10 @@ files:
|
|
813
846
|
homepage: http://github.com/dgroup/lazylead
|
814
847
|
licenses:
|
815
848
|
- MIT
|
816
|
-
metadata:
|
849
|
+
metadata:
|
850
|
+
rubygems_mfa_required: 'false'
|
817
851
|
post_install_message: |-
|
818
|
-
Thanks for installing Lazylead v0.
|
852
|
+
Thanks for installing Lazylead v0.12.0!
|
819
853
|
Read our blog posts: https://lazylead.org
|
820
854
|
Stay in touch with the community in Telegram: https://t.me/lazylead
|
821
855
|
Follow us on Twitter: https://twitter.com/lazylead
|
@@ -845,6 +879,7 @@ test_files:
|
|
845
879
|
- test/lazylead/cli/app_test.rb
|
846
880
|
- test/lazylead/confluence_test.rb
|
847
881
|
- test/lazylead/exchange_test.rb
|
882
|
+
- test/lazylead/file_postman_test.rb
|
848
883
|
- test/lazylead/model_test.rb
|
849
884
|
- test/lazylead/opts_test.rb
|
850
885
|
- test/lazylead/postman_test.rb
|
@@ -852,6 +887,7 @@ test_files:
|
|
852
887
|
- test/lazylead/salt_test.rb
|
853
888
|
- test/lazylead/smoke_test.rb
|
854
889
|
- test/lazylead/smtp_test.rb
|
890
|
+
- test/lazylead/stdout_postman_test.rb
|
855
891
|
- test/lazylead/system/jira_test.rb
|
856
892
|
- test/lazylead/task/accuracy/accuracy_test.rb
|
857
893
|
- test/lazylead/task/accuracy/affected_build_test.rb
|