lazylead 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.0pdd.yml +3 -0
- data/.circleci/config.yml +0 -13
- data/.github/workflows/build.yml +39 -0
- data/.github/workflows/release.yml +15 -0
- data/.rubocop.yml +5 -1
- data/.rultor.yml +2 -2
- data/Gemfile +1 -1
- data/Rakefile +17 -9
- data/bin/lazylead +5 -5
- data/lazylead.gemspec +16 -20
- data/lib/lazylead/allocated.rb +1 -1
- data/lib/lazylead/cc.rb +1 -1
- data/lib/lazylead/cli/app.rb +3 -3
- data/lib/lazylead/confluence.rb +1 -1
- data/lib/lazylead/email.rb +1 -1
- data/lib/lazylead/exchange.rb +3 -3
- data/lib/lazylead/home.rb +2 -2
- data/lib/lazylead/log.rb +1 -1
- data/lib/lazylead/model.rb +2 -2
- data/lib/lazylead/opts.rb +1 -1
- data/lib/lazylead/os.rb +2 -1
- data/lib/lazylead/postman.rb +4 -4
- data/lib/lazylead/requires.rb +1 -1
- data/lib/lazylead/salt.rb +1 -1
- data/lib/lazylead/schedule.rb +1 -1
- data/lib/lazylead/smtp.rb +1 -1
- data/lib/lazylead/system/empty.rb +1 -1
- data/lib/lazylead/system/fake.rb +1 -1
- data/lib/lazylead/system/jira.rb +5 -3
- data/lib/lazylead/system/synced.rb +1 -1
- data/lib/lazylead/task/accuracy/accuracy.rb +3 -3
- data/lib/lazylead/task/accuracy/affected_build.rb +1 -1
- data/lib/lazylead/task/accuracy/attachment.rb +1 -1
- data/lib/lazylead/task/accuracy/environment.rb +1 -1
- data/lib/lazylead/task/accuracy/has_label.rb +1 -1
- data/lib/lazylead/task/accuracy/logs.rb +1 -1
- data/lib/lazylead/task/accuracy/logs_link.rb +1 -1
- data/lib/lazylead/task/accuracy/memes.rb +1 -1
- data/lib/lazylead/task/accuracy/onlyll.rb +1 -1
- data/lib/lazylead/task/accuracy/records.rb +1 -1
- data/lib/lazylead/task/accuracy/records_link.rb +1 -1
- data/lib/lazylead/task/accuracy/required.rb +1 -1
- data/lib/lazylead/task/accuracy/requirement.rb +1 -1
- data/lib/lazylead/task/accuracy/screenshots.rb +1 -1
- data/lib/lazylead/task/accuracy/servers.rb +1 -1
- data/lib/lazylead/task/accuracy/stacktrace.rb +2 -2
- data/lib/lazylead/task/accuracy/testcase.rb +1 -1
- data/lib/lazylead/task/accuracy/wiki.rb +1 -1
- data/lib/lazylead/task/accuracy/wiki_url.rb +1 -1
- data/lib/lazylead/task/alert/alert.rb +1 -1
- data/lib/lazylead/task/alert/alertif.rb +1 -1
- data/lib/lazylead/task/alert/changed_to.rb +1 -1
- data/lib/lazylead/task/assignment.rb +1 -1
- data/lib/lazylead/task/confluence_ref.rb +1 -1
- data/lib/lazylead/task/echo.rb +1 -1
- data/lib/lazylead/task/fix_version.rb +1 -1
- data/lib/lazylead/task/git/git.rb +1 -1
- data/lib/lazylead/task/loading.rb +1 -1
- data/lib/lazylead/task/micromanager.rb +1 -1
- data/lib/lazylead/task/missing_comment.rb +1 -1
- data/lib/lazylead/task/propagate_down.rb +1 -1
- data/lib/lazylead/task/savepoint.rb +1 -1
- data/lib/lazylead/task/svn/diff.rb +1 -1
- data/lib/lazylead/task/svn/grep.rb +1 -1
- data/lib/lazylead/task/svn/svn.rb +1 -1
- data/lib/lazylead/task/svn/touch.rb +42 -14
- data/lib/lazylead/version.rb +2 -2
- data/lib/lazylead.rb +1 -1
- data/license.txt +1 -1
- data/readme.md +14 -12
- data/test/lazylead/allocated_test.rb +1 -1
- data/test/lazylead/cc_test.rb +7 -7
- data/test/lazylead/cli/app_test.rb +1 -1
- data/test/lazylead/confluence_test.rb +1 -1
- data/test/lazylead/exchange_test.rb +10 -10
- data/test/lazylead/file_postman_test.rb +1 -1
- data/test/lazylead/model_test.rb +2 -2
- data/test/lazylead/opts_test.rb +1 -1
- data/test/lazylead/postman_test.rb +7 -7
- data/test/lazylead/retry_test.rb +1 -1
- data/test/lazylead/salt_test.rb +1 -1
- data/test/lazylead/smoke_test.rb +2 -2
- data/test/lazylead/smtp_test.rb +7 -7
- data/test/lazylead/stdout_postman_test.rb +1 -1
- data/test/lazylead/system/jira_test.rb +53 -54
- data/test/lazylead/task/accuracy/accuracy_test.rb +11 -11
- data/test/lazylead/task/accuracy/affected_build_test.rb +1 -1
- data/test/lazylead/task/accuracy/attachment_test.rb +4 -4
- data/test/lazylead/task/accuracy/environment_test.rb +1 -1
- data/test/lazylead/task/accuracy/has_label_test.rb +1 -1
- data/test/lazylead/task/accuracy/logs_link_test.rb +1 -1
- data/test/lazylead/task/accuracy/logs_test.rb +1 -1
- data/test/lazylead/task/accuracy/memes_test.rb +1 -1
- data/test/lazylead/task/accuracy/onlyll_test.rb +21 -21
- data/test/lazylead/task/accuracy/records_llink_test.rb +1 -1
- data/test/lazylead/task/accuracy/records_test.rb +1 -1
- data/test/lazylead/task/accuracy/score_test.rb +4 -4
- data/test/lazylead/task/accuracy/screenshots_test.rb +3 -3
- data/test/lazylead/task/accuracy/servers_test.rb +1 -1
- data/test/lazylead/task/accuracy/stacktrace_test.rb +1 -1
- data/test/lazylead/task/accuracy/testcase_test.rb +1 -1
- data/test/lazylead/task/accuracy/wiki_test.rb +1 -1
- data/test/lazylead/task/accuracy/wiki_url_test.rb +1 -1
- data/test/lazylead/task/alert/alertif_test.rb +5 -5
- data/test/lazylead/task/alert/assignee_alert_test.rb +1 -1
- data/test/lazylead/task/alert/changed_to_test.rb +5 -5
- data/test/lazylead/task/assignment_test.rb +5 -5
- data/test/lazylead/task/confluence_ref_test.rb +8 -8
- data/test/lazylead/task/created_recently_test.rb +4 -4
- data/test/lazylead/task/duedate_test.rb +14 -14
- data/test/lazylead/task/echo_test.rb +1 -1
- data/test/lazylead/task/fix_version_test.rb +6 -5
- data/test/lazylead/task/loading_test.rb +7 -7
- data/test/lazylead/task/micromanager_test.rb +5 -5
- data/test/lazylead/task/missing_comment_test.rb +4 -4
- data/test/lazylead/task/propagate_down_test.rb +1 -1
- data/test/lazylead/task/savepoint_test.rb +1 -1
- data/test/lazylead/task/svn/diff_test.rb +14 -15
- data/test/lazylead/task/svn/grep_test.rb +4 -3
- data/test/lazylead/task/svn/touch_test.rb +74 -6
- data/test/lazylead/version_test.rb +1 -1
- data/test/sqlite_test.rb +1 -1
- data/test/test.rb +10 -3
- metadata +33 -98
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -39,7 +39,7 @@ module Lazylead
|
|
39
39
|
"exchange_to"
|
40
40
|
Exchange.new(Log.new, NoSalt.new).send(
|
41
41
|
Opts.new(
|
42
|
-
to: ENV
|
42
|
+
to: ENV.fetch("exchange_to", nil),
|
43
43
|
tickets: NoAuthJira.new("https://jira.spring.io")
|
44
44
|
.issues("key = DATAJDBC-480"),
|
45
45
|
"subject" => "[DD] PDTN!",
|
@@ -57,12 +57,12 @@ module Lazylead
|
|
57
57
|
Exchange.new(
|
58
58
|
Log.new,
|
59
59
|
Salt.new("exchange_salt"),
|
60
|
-
"exchange_url" => ENV
|
61
|
-
"exchange_user" => ENV
|
62
|
-
"exchange_password" => ENV
|
60
|
+
"exchange_url" => ENV.fetch("exchange_url", nil),
|
61
|
+
"exchange_user" => ENV.fetch("enc_exchange_usr", nil),
|
62
|
+
"exchange_password" => ENV.fetch("enc_exchange_psw", nil)
|
63
63
|
).send(
|
64
64
|
Opts.new(
|
65
|
-
to: ENV
|
65
|
+
to: ENV.fetch("exchange_to", nil),
|
66
66
|
tickets: NoAuthJira.new("https://jira.spring.io")
|
67
67
|
.issues("key = DATAJDBC-480"),
|
68
68
|
"subject" => "[DD] Enc PDTN!",
|
@@ -79,12 +79,12 @@ module Lazylead
|
|
79
79
|
Exchange.new(
|
80
80
|
Log.new,
|
81
81
|
Salt.new("exchange_salt"),
|
82
|
-
"exchange_url" => ENV
|
83
|
-
"exchange_user" => ENV
|
84
|
-
"exchange_password" => ENV
|
82
|
+
"exchange_url" => ENV.fetch("exchange_url", nil),
|
83
|
+
"exchange_user" => ENV.fetch("enc_exchange_usr", nil),
|
84
|
+
"exchange_password" => ENV.fetch("enc_exchange_psw", nil)
|
85
85
|
).send(
|
86
86
|
Opts.new(
|
87
|
-
to: ENV
|
87
|
+
to: ENV.fetch("exchange_to", nil),
|
88
88
|
"attachments" => "readme.md",
|
89
89
|
"subject" => "[LL] Attachments",
|
90
90
|
"template" => "lib/messages/savepoint.erb"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
data/test/lazylead/model_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -80,7 +80,7 @@ module Lazylead
|
|
80
80
|
vcs4sql: "upgrades/sqlite",
|
81
81
|
testdata: true
|
82
82
|
)
|
83
|
-
|
83
|
+
refute_predicate ORM::Task.find(260), :to_h?
|
84
84
|
end
|
85
85
|
|
86
86
|
test "second ticketing system is found" do
|
data/test/lazylead/opts_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -41,15 +41,15 @@ module Lazylead
|
|
41
41
|
Smtp.new(
|
42
42
|
Log.new,
|
43
43
|
NoSalt.new,
|
44
|
-
smtp_host: ENV
|
45
|
-
smtp_port: ENV
|
46
|
-
smtp_user: ENV
|
47
|
-
smtp_pass: ENV
|
44
|
+
smtp_host: ENV.fetch("LL_SMTP_HOST", nil),
|
45
|
+
smtp_port: ENV.fetch("LL_SMTP_PORT", nil),
|
46
|
+
smtp_user: ENV.fetch("LL_SMTP_USER", nil),
|
47
|
+
smtp_pass: ENV.fetch("LL_SMTP_PASS", nil)
|
48
48
|
).enable
|
49
49
|
Postman.new.send(
|
50
50
|
Opts.new(
|
51
|
-
"to" => ENV
|
52
|
-
"from" => ENV
|
51
|
+
"to" => ENV.fetch("LL_SMTP_TO", nil),
|
52
|
+
"from" => ENV.fetch("LL_SMTP_FROM", nil),
|
53
53
|
"attachments" => ["readme.md"],
|
54
54
|
"subject" => "[LL] Attachments",
|
55
55
|
"template" => "lib/messages/savepoint.erb"
|
data/test/lazylead/retry_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
data/test/lazylead/salt_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
data/test/lazylead/smoke_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -41,7 +41,7 @@ module Lazylead
|
|
41
41
|
f << "EnvTest=value"
|
42
42
|
f.flush
|
43
43
|
IniFile.new(filename: f).each { |_, k, v| ENV[k] = v }
|
44
|
-
assert_equal "value", ENV
|
44
|
+
assert_equal "value", ENV.fetch("EnvTest", nil)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
test "ini file not found" do
|
data/test/lazylead/smtp_test.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -46,14 +46,14 @@ module Lazylead
|
|
46
46
|
skip "Not implemented yet" unless env? "LL_SMTP_HOST", "LL_SMTP_USER"
|
47
47
|
Smtp.new(
|
48
48
|
Log.new, NoSalt.new,
|
49
|
-
smtp_host: ENV
|
50
|
-
smtp_port: ENV
|
51
|
-
smtp_user: ENV
|
52
|
-
smtp_pass: ENV
|
49
|
+
smtp_host: ENV.fetch("LL_SMTP_HOST", nil),
|
50
|
+
smtp_port: ENV.fetch("LL_SMTP_PORT", nil),
|
51
|
+
smtp_user: ENV.fetch("LL_SMTP_USER", nil),
|
52
|
+
smtp_pass: ENV.fetch("LL_SMTP_PASS", nil)
|
53
53
|
).enable
|
54
54
|
Mail.deliver do
|
55
|
-
from ENV
|
56
|
-
to ENV
|
55
|
+
from ENV.fetch("LL_SMTP_FROM", nil)
|
56
|
+
to ENV.fetch("LL_SMTP_TO", nil)
|
57
57
|
subject "Testing"
|
58
58
|
body "Good, it works"
|
59
59
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -31,9 +31,9 @@ require_relative "../../../lib/lazylead/system/jira"
|
|
31
31
|
module Lazylead
|
32
32
|
class JiraTest < Lazylead::Test
|
33
33
|
test "found issue by id" do
|
34
|
-
assert_equal "
|
35
|
-
NoAuthJira.new("https://jira.
|
36
|
-
.issues("key in ('
|
34
|
+
assert_equal "JAVA-150",
|
35
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
36
|
+
.issues("key in ('JAVA-150')")
|
37
37
|
.first
|
38
38
|
.key
|
39
39
|
end
|
@@ -46,20 +46,20 @@ module Lazylead
|
|
46
46
|
vcs4sql: "upgrades/sqlite",
|
47
47
|
testdata: true
|
48
48
|
)
|
49
|
-
assert_equal "
|
49
|
+
assert_equal "JAVA-150",
|
50
50
|
ORM::Task.find(4)
|
51
51
|
.system
|
52
52
|
.connect
|
53
|
-
.issues("key in ('
|
53
|
+
.issues("key in ('JAVA-150')")
|
54
54
|
.first
|
55
55
|
.key,
|
56
|
-
"Id mismatch for https://jira.
|
56
|
+
"Id mismatch for https://jira.mongodb.org/browse/JAVA-150"
|
57
57
|
end
|
58
58
|
|
59
59
|
test "group by assignee" do
|
60
60
|
assert_equal 2,
|
61
|
-
NoAuthJira.new("https://jira.
|
62
|
-
.issues("filter=
|
61
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
62
|
+
.issues("filter=46202")
|
63
63
|
.group_by(&:assignee)
|
64
64
|
.min_by { |a| a.first.id }
|
65
65
|
.length,
|
@@ -67,58 +67,58 @@ module Lazylead
|
|
67
67
|
end
|
68
68
|
|
69
69
|
test "issue reporter fetched successfully" do
|
70
|
-
assert_equal "
|
71
|
-
NoAuthJira.new("https://jira.
|
72
|
-
.issues("key in ('
|
70
|
+
assert_equal "Joseph Wang",
|
71
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
72
|
+
.issues("key in ('JAVA-150')")
|
73
73
|
.first
|
74
74
|
.reporter
|
75
75
|
.name
|
76
76
|
end
|
77
77
|
|
78
78
|
test "issue url fetched successfully" do
|
79
|
-
assert_equal "https://jira.
|
80
|
-
NoAuthJira.new("https://jira.
|
81
|
-
.issues("key in ('
|
79
|
+
assert_equal "https://jira.mongodb.org/browse/JAVA-150",
|
80
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
81
|
+
.issues("key in ('JAVA-150')")
|
82
82
|
.first
|
83
83
|
.url
|
84
84
|
end
|
85
85
|
|
86
86
|
test "issue history found" do
|
87
|
-
greater_or_eq
|
88
|
-
NoAuthJira.new("https://jira.
|
89
|
-
.issues("key='
|
87
|
+
greater_or_eq 10,
|
88
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
89
|
+
.issues("key='JAVA-150'", expand: "changelog")
|
90
90
|
.first
|
91
91
|
.history
|
92
92
|
.size
|
93
93
|
end
|
94
94
|
|
95
95
|
test "issue history not found" do
|
96
|
-
assert_empty NoAuthJira.new("https://jira.
|
97
|
-
.issues("key='
|
96
|
+
assert_empty NoAuthJira.new("https://jira.mongodb.org")
|
97
|
+
.issues("key='JAVA-150'")
|
98
98
|
.first
|
99
99
|
.history
|
100
100
|
end
|
101
101
|
|
102
102
|
test "2nd issue history item is correct" do
|
103
|
-
assert_equal "
|
104
|
-
NoAuthJira.new("https://jira.
|
105
|
-
.issues("key='
|
103
|
+
assert_equal "24893",
|
104
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
105
|
+
.issues("key='JAVA-150'", expand: "changelog")
|
106
106
|
.first
|
107
107
|
.history[2]["id"]
|
108
108
|
end
|
109
109
|
|
110
110
|
test "issue has expected status" do
|
111
111
|
assert_equal "Closed",
|
112
|
-
NoAuthJira.new("https://jira.
|
113
|
-
.issues("key='
|
112
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
113
|
+
.issues("key='JAVA-150'")
|
114
114
|
.first
|
115
115
|
.status
|
116
116
|
end
|
117
117
|
|
118
118
|
test "issue has 1 field" do
|
119
119
|
assert_equal 1,
|
120
|
-
NoAuthJira.new("https://jira.
|
121
|
-
.issues("key='
|
120
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
121
|
+
.issues("key='JAVA-150'", fields: ["summary"])
|
122
122
|
.first
|
123
123
|
.fields
|
124
124
|
.size
|
@@ -143,47 +143,46 @@ module Lazylead
|
|
143
143
|
end
|
144
144
|
|
145
145
|
test "description is correct" do
|
146
|
-
assert_words ["
|
147
|
-
NoAuthJira.new("https://jira.
|
148
|
-
.issues("key=
|
146
|
+
assert_words ["We've multiple colos"],
|
147
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
148
|
+
.issues("key=JAVA-150")
|
149
149
|
.first
|
150
150
|
.description
|
151
151
|
end
|
152
152
|
|
153
153
|
test "component is correct" do
|
154
|
-
assert_equal ["
|
155
|
-
NoAuthJira.new("https://jira.
|
156
|
-
.issues("key=
|
154
|
+
assert_equal ["GridFS"],
|
155
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
156
|
+
.issues("key=JAVA-192")
|
157
157
|
.first
|
158
158
|
.components
|
159
159
|
end
|
160
160
|
|
161
|
-
test "field
|
162
|
-
assert_includes NoAuthJira.new("https://jira.
|
163
|
-
.issues("key=
|
161
|
+
test "description available as field" do
|
162
|
+
assert_includes NoAuthJira.new("https://jira.mongodb.org")
|
163
|
+
.issues("key=JAVA-192")
|
164
164
|
.first["description"],
|
165
|
-
"
|
165
|
+
".files.drop() + .chunks.drop()"
|
166
166
|
end
|
167
167
|
|
168
168
|
test "field not found" do
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
.blank?
|
169
|
+
assert_predicate NoAuthJira.new("https://jira.mongodb.org")
|
170
|
+
.issues("key=JAVA-150")
|
171
|
+
.first["absent field"], :blank?
|
173
172
|
end
|
174
173
|
|
175
174
|
test "labels found" do
|
176
|
-
assert_includes NoAuthJira.new("https://jira.
|
177
|
-
.issues("key=
|
175
|
+
assert_includes NoAuthJira.new("https://jira.mongodb.org")
|
176
|
+
.issues("key=JAVA-295")
|
178
177
|
.first
|
179
178
|
.labels,
|
180
|
-
"
|
179
|
+
"android"
|
181
180
|
end
|
182
181
|
|
183
182
|
test "bulk search in few iterations" do
|
184
183
|
assert_equal 3,
|
185
|
-
NoAuthJira.new("https://jira.
|
186
|
-
.issues("key>
|
184
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
185
|
+
.issues("key>JAVA-150 and key < JAVA-154", max_results: 1)
|
187
186
|
.size
|
188
187
|
end
|
189
188
|
|
@@ -191,23 +190,23 @@ module Lazylead
|
|
191
190
|
refute_empty Jira.new(
|
192
191
|
"username" => nil,
|
193
192
|
"password" => nil,
|
194
|
-
"site" => "https://jira.
|
193
|
+
"site" => "https://jira.mongodb.org",
|
195
194
|
"context_path" => ""
|
196
|
-
).issues("key=
|
195
|
+
).issues("key=JAVA-150")
|
197
196
|
end
|
198
197
|
|
199
198
|
test "sprint is found" do
|
200
|
-
assert_equal "Sprint
|
201
|
-
NoAuthJira.new("https://jira.
|
202
|
-
.issues("key=
|
199
|
+
assert_equal "Java Sprint 25",
|
200
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
201
|
+
.issues("key=JAVA-192", fields: ["customfield_10557"])
|
203
202
|
.first
|
204
|
-
.sprint("
|
203
|
+
.sprint("customfield_10557")
|
205
204
|
end
|
206
205
|
|
207
206
|
test "bulk search in few iterations with limit" do
|
208
207
|
assert_equal 3,
|
209
|
-
NoAuthJira.new("https://jira.
|
210
|
-
.issues("key >
|
208
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
209
|
+
.issues("key > JAVA-150", max_results: 1, "limit" => 3)
|
211
210
|
.size
|
212
211
|
end
|
213
212
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -35,7 +35,7 @@ module Lazylead
|
|
35
35
|
test "detect affected build" do
|
36
36
|
Lazylead::Smtp.new.enable
|
37
37
|
Task::Accuracy.new.run(
|
38
|
-
NoAuthJira.new("https://jira.
|
38
|
+
NoAuthJira.new("https://jira.mongodb.org"),
|
39
39
|
Postman.new,
|
40
40
|
Opts.new(
|
41
41
|
"from" => "ll@fake.com",
|
@@ -54,14 +54,14 @@ module Lazylead
|
|
54
54
|
"90-100" => "https://meme.com?id=wow.gif"
|
55
55
|
}.to_json.to_s,
|
56
56
|
"docs" => "https://github.com/dgroup/lazylead/blob/master/.github/ISSUE_TEMPLATE/bug_report.md",
|
57
|
-
"jql" => "key
|
57
|
+
"jql" => "key=JAVA-151",
|
58
58
|
"max_results" => 200,
|
59
59
|
"subject" => "[LL] Raised tickets",
|
60
60
|
"template" => "lib/messages/accuracy.erb"
|
61
61
|
)
|
62
62
|
)
|
63
63
|
assert_email "[LL] Raised tickets",
|
64
|
-
"
|
64
|
+
"JAVA-151", "0.5", "100%", "Tsz Ming Wong", "Dot allowed in key names"
|
65
65
|
end
|
66
66
|
|
67
67
|
test "construct accuracy from orm" do
|
@@ -79,7 +79,7 @@ module Lazylead
|
|
79
79
|
Lazylead::Smtp.new.enable
|
80
80
|
assert_equal 1,
|
81
81
|
Task::Accuracy.new.run(
|
82
|
-
NoAuthJira.new("https://jira.
|
82
|
+
NoAuthJira.new("https://jira.mongodb.org"),
|
83
83
|
Postman.new,
|
84
84
|
Opts.new(
|
85
85
|
"from" => "ll@fake.com",
|
@@ -90,7 +90,7 @@ module Lazylead
|
|
90
90
|
"0" => "#FF4F33",
|
91
91
|
"57" => "#19DD1E"
|
92
92
|
}.to_json.to_s,
|
93
|
-
"jql" => "key >
|
93
|
+
"jql" => "key > JAVA-500",
|
94
94
|
"limit" => "1",
|
95
95
|
"subject" => "[LL] Raised tickets",
|
96
96
|
"template" => "lib/messages/accuracy.erb"
|
@@ -101,7 +101,7 @@ module Lazylead
|
|
101
101
|
test "score is correct" do
|
102
102
|
Lazylead::Smtp.new.enable
|
103
103
|
Task::Accuracy.new.run(
|
104
|
-
NoAuthJira.new("https://jira.
|
104
|
+
NoAuthJira.new("https://jira.mongodb.org"),
|
105
105
|
Postman.new,
|
106
106
|
Opts.new(
|
107
107
|
"from" => "ll@fake.com",
|
@@ -113,14 +113,14 @@ module Lazylead
|
|
113
113
|
"30" => "#FEC15E",
|
114
114
|
"50" => "#19DD1E"
|
115
115
|
}.to_json.to_s,
|
116
|
-
"jql" => "key=
|
116
|
+
"jql" => "key=JAVA-4344",
|
117
117
|
"silent" => "true",
|
118
|
-
"subject" => "[LL] Check
|
118
|
+
"subject" => "[LL] Check JAVA-4344",
|
119
119
|
"template" => "lib/messages/accuracy.erb"
|
120
120
|
)
|
121
121
|
)
|
122
|
-
assert_email "[LL] Check
|
123
|
-
"
|
122
|
+
assert_email "[LL] Check JAVA-4344",
|
123
|
+
"JAVA-4344", "3", "42.86%"
|
124
124
|
end
|
125
125
|
end
|
126
126
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -35,14 +35,14 @@ module Lazylead
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def matches?(attach)
|
38
|
-
"
|
38
|
+
"Main.java".eql? attach.attrs["filename"]
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
test "attachment is present" do
|
43
43
|
assert Txt.new.passed(
|
44
|
-
NoAuthJira.new("https://jira.
|
45
|
-
.issues("key=
|
44
|
+
NoAuthJira.new("https://jira.mongodb.org")
|
45
|
+
.issues("key=JAVA-8", fields: ["attachment"])
|
46
46
|
.first
|
47
47
|
)
|
48
48
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# The MIT License
|
4
4
|
#
|
5
|
-
# Copyright (c) 2019-
|
5
|
+
# Copyright (c) 2019-2022 Yurii Dubinka
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the "Software"),
|