lazylead 0.3.1 → 0.4.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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.0pdd.yml +4 -1
  3. data/.docs/accuracy.md +107 -0
  4. data/.docs/accuracy_email.jpg +0 -0
  5. data/.docs/accuracy_jira_comment.jpg +0 -0
  6. data/.docs/propagate_down.md +1 -1
  7. data/.pdd +1 -1
  8. data/.rubocop.yml +6 -0
  9. data/bin/lazylead +6 -3
  10. data/lazylead.gemspec +4 -4
  11. data/lib/lazylead/exchange.rb +1 -1
  12. data/lib/lazylead/log.rb +30 -8
  13. data/lib/lazylead/model.rb +44 -22
  14. data/lib/lazylead/opts.rb +68 -0
  15. data/lib/lazylead/postman.rb +1 -1
  16. data/lib/lazylead/schedule.rb +3 -3
  17. data/lib/lazylead/smtp.rb +1 -1
  18. data/lib/lazylead/system/jira.rb +16 -14
  19. data/lib/lazylead/system/synced.rb +2 -1
  20. data/lib/lazylead/task/accuracy/accuracy.rb +140 -0
  21. data/lib/lazylead/task/accuracy/affected_build.rb +43 -0
  22. data/lib/lazylead/task/accuracy/requirement.rb +40 -0
  23. data/lib/lazylead/task/alert.rb +8 -6
  24. data/lib/lazylead/task/confluence_ref.rb +4 -3
  25. data/lib/lazylead/task/echo.rb +4 -0
  26. data/lib/lazylead/task/fix_version.rb +10 -6
  27. data/lib/lazylead/task/missing_comment.rb +7 -5
  28. data/lib/lazylead/task/propagate_down.rb +11 -3
  29. data/lib/lazylead/task/savepoint.rb +1 -1
  30. data/lib/lazylead/task/touch.rb +102 -0
  31. data/lib/lazylead/version.rb +1 -1
  32. data/lib/messages/accuracy.erb +118 -0
  33. data/lib/messages/svn_touch.erb +147 -0
  34. data/readme.md +17 -16
  35. data/test/lazylead/cc_test.rb +2 -2
  36. data/test/lazylead/cli/app_test.rb +2 -2
  37. data/test/lazylead/exchange_test.rb +3 -3
  38. data/test/lazylead/model_test.rb +4 -4
  39. data/test/lazylead/opts_test.rb +66 -0
  40. data/test/lazylead/postman_test.rb +1 -1
  41. data/test/lazylead/smtp_test.rb +1 -1
  42. data/test/lazylead/system/jira_test.rb +35 -1
  43. data/test/lazylead/task/accuracy/accuracy_test.rb +73 -0
  44. data/test/lazylead/task/accuracy/affected_build_test.rb +42 -0
  45. data/test/lazylead/task/assignee_alert_test.rb +2 -2
  46. data/test/lazylead/task/duedate_test.rb +36 -26
  47. data/test/lazylead/task/fix_version_test.rb +9 -6
  48. data/test/lazylead/task/missing_comment_test.rb +11 -9
  49. data/test/lazylead/task/propagate_down_test.rb +4 -2
  50. data/test/lazylead/task/touch_test.rb +63 -0
  51. data/upgrades/sqlite/999.testdata.sql +2 -1
  52. metadata +25 -7
@@ -26,6 +26,7 @@ require "mail"
26
26
 
27
27
  require_relative "../../test"
28
28
  require_relative "../../../lib/lazylead/smtp"
29
+ require_relative "../../../lib/lazylead/opts"
29
30
  require_relative "../../../lib/lazylead/postman"
30
31
  require_relative "../../../lib/lazylead/task/fix_version"
31
32
 
@@ -36,12 +37,14 @@ module Lazylead
36
37
  Task::FixVersion.new.run(
37
38
  NoAuthJira.new("https://jira.spring.io"),
38
39
  Postman.new,
39
- "to" => "lead@company.com",
40
- "from" => "ll@company.com",
41
- "jql" => "key in ('DATAJDBC-480') and fixVersion is not empty",
42
- "allowed" => "tom,mike,bob",
43
- "subject" => "FixVersion: How dare you?",
44
- "template" => "lib/messages/illegal_fixversion_change.erb"
40
+ Opts.new(
41
+ "to" => "lead@company.com",
42
+ "from" => "ll@company.com",
43
+ "jql" => "key in ('DATAJDBC-480') and fixVersion is not empty",
44
+ "allowed" => "tom,mike,bob",
45
+ "subject" => "FixVersion: How dare you?",
46
+ "template" => "lib/messages/illegal_fixversion_change.erb"
47
+ )
45
48
  )
46
49
  assert_email "FixVersion: How dare you?",
47
50
  %w[DATAJDBC-480 01-Apr-2020 Minor Mark\ Paluch tom,mike,bob EntityInstantiators]
@@ -37,15 +37,17 @@ module Lazylead
37
37
  Task::MissingComment.new.run(
38
38
  NoAuthJira.new("https://jira.spring.io"),
39
39
  Postman.new,
40
- "to" => "lead@company.com",
41
- "addressee" => "Tom",
42
- "from" => "ll@company.com",
43
- "jql" => "key=DATAJDBC-523",
44
- "text" => "ftp.com/demo.avi",
45
- "details" => "reference to <code>ftp.com/demo.avi</code>",
46
- "subject" => "Expected ftp link is missing",
47
- "template" => "lib/messages/missing_comment.erb",
48
- "template_details" => "reference to <a href='file://ftp/path'>ftp</a>"
40
+ Opts.new(
41
+ "to" => "lead@company.com",
42
+ "addressee" => "Tom",
43
+ "from" => "ll@company.com",
44
+ "jql" => "key=DATAJDBC-523",
45
+ "text" => "ftp.com/demo.avi",
46
+ "details" => "reference to <code>ftp.com/demo.avi</code>",
47
+ "subject" => "Expected ftp link is missing",
48
+ "template" => "lib/messages/missing_comment.erb",
49
+ "template_details" => "reference to <a href='file://ftp/path'>ftp</a>"
50
+ )
49
51
  )
50
52
  assert_email "Expected ftp link is missing",
51
53
  %w[DATAJDBC-523 Major Mark\ Paluch https://github.com/spring-projects/spring-data-jdbc/commit/aadbb667ed1d61139d5ac51a06eb3dd1b39316db#diff-510a5041bb8a0575e97fedf105606b83R130]
@@ -66,8 +66,10 @@ module Lazylead
66
66
  Task::PropagateDown.new.run(
67
67
  Fake.new([parent, child]),
68
68
  [],
69
- "jql" => "type=Defect and updated>-1h and has subtasks without fields",
70
- "fields" => "customfield_101,customfield_102"
69
+ Opts.new(
70
+ "jql" => "type=Defect and updated>-1h and subtasks without fields",
71
+ "propagate" => "customfield_101,customfield_102"
72
+ )
71
73
  )
72
74
  assert_entries(
73
75
  {
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The MIT License
4
+ #
5
+ # Copyright (c) 2019-2020 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
+ require_relative "../../test"
27
+ require_relative "../../../lib/lazylead/smtp"
28
+
29
+ require_relative "../../../lib/lazylead/postman"
30
+ require_relative "../../../lib/lazylead/task/touch"
31
+
32
+ module Lazylead
33
+ class SvnTouchTest < Lazylead::Test
34
+ # @todo #/DEV Find stable svn repo which can be used for stable test, for
35
+ # now only floating repo used for testing locally. Also, create a new
36
+ # method "ping" which can be used during tests like
37
+ # skip "No connection available to svn repo" unless ping("https://svn.com")
38
+ test "important files changed in svn repo" do
39
+ skip "No svn credentials provided" unless env? "svn_url",
40
+ "svn_user",
41
+ "svn_password"
42
+ Lazylead::Smtp.new.enable
43
+ Task::SvnTouch.new.run(
44
+ nil,
45
+ Postman.new,
46
+ "svn_url" => ENV["svn_url"],
47
+ "svn_user" => ENV["svn_user"],
48
+ "svn_password" => ENV["svn_password"],
49
+ "commit_url" => "https://view.commit.com?rev=",
50
+ "user" => "https://user.com?id=",
51
+ "to" => "lead@fake.com",
52
+ "from" => "ll@fake.com",
53
+ "now" => "2020-07-12T17:24:45+01:00",
54
+ "period" => "864000",
55
+ "files" => "checkstyle.xml,checkstyle_suppressions.xml",
56
+ "subject" => "[SVN] Static analysis configuration has been changed!",
57
+ "template" => "lib/messages/svn_touch.erb"
58
+ )
59
+ assert_email "[SVN] Static analysis configuration has been changed!",
60
+ %w[revision user ticket]
61
+ end
62
+ end
63
+ end
@@ -41,4 +41,5 @@ values ('echo', '* * * * *', 'false', 1, 1, 1, 'Lazylead::Task::Echo', '{}'),
41
41
  ('issue 154', '* * * * *', 'false', 154, 1, 154, 'Lazylead::Task::AssigneeAlert', '{}'),
42
42
  ('task with complex cc', '* * * * *', 'false', 165, 1, 1, 'Lazylead::Task::Echo',
43
43
  '{"cc":{"type":"Lazylead::PredefinedCC","opts": {"jvm":"tom@fake.com","jdbc":"mike@fake.com"}}}'),
44
- ('issue 171', '* * * * *', 'false', 171, 1, 1, 'Lazylead::Task::Echo', '{"envkey":"${key171}"}');
44
+ ('issue 171', '* * * * *', 'false', 171, 1, 1, 'Lazylead::Task::Echo', '{"envkey":"${key171}"}'),
45
+ ('issue 195', '* * * * *', 'false', 195, 1, 1, 'Lazylead::Task::Accuracy', '{"key":"value"}');
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.3.1
4
+ version: 0.4.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: 2020-07-19 00:00:00.000000000 Z
11
+ date: 2020-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 2.2.0
89
+ version: 2.3.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 2.2.0
96
+ version: 2.3.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: logging
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -296,14 +296,14 @@ dependencies:
296
296
  requirements:
297
297
  - - '='
298
298
  - !ruby/object:Gem::Version
299
- version: 0.1.14
299
+ version: 0.2.3
300
300
  type: :development
301
301
  prerelease: false
302
302
  version_requirements: !ruby/object:Gem::Requirement
303
303
  requirements:
304
304
  - - '='
305
305
  - !ruby/object:Gem::Version
306
- version: 0.1.14
306
+ version: 0.2.3
307
307
  - !ruby/object:Gem::Dependency
308
308
  name: guard
309
309
  requirement: !ruby/object:Gem::Requirement
@@ -541,6 +541,9 @@ files:
541
541
  - ".docker/docker-compose.yml"
542
542
  - ".docker/readme.md"
543
543
  - ".docker/vcs.dockerfile"
544
+ - ".docs/accuracy.md"
545
+ - ".docs/accuracy_email.jpg"
546
+ - ".docs/accuracy_jira_comment.jpg"
544
547
  - ".docs/duedate_expired.md"
545
548
  - ".docs/propagate_down.md"
546
549
  - ".gitattributes"
@@ -578,6 +581,7 @@ files:
578
581
  - lib/lazylead/home.rb
579
582
  - lib/lazylead/log.rb
580
583
  - lib/lazylead/model.rb
584
+ - lib/lazylead/opts.rb
581
585
  - lib/lazylead/postman.rb
582
586
  - lib/lazylead/salt.rb
583
587
  - lib/lazylead/schedule.rb
@@ -586,6 +590,9 @@ files:
586
590
  - lib/lazylead/system/fake.rb
587
591
  - lib/lazylead/system/jira.rb
588
592
  - lib/lazylead/system/synced.rb
593
+ - lib/lazylead/task/accuracy/accuracy.rb
594
+ - lib/lazylead/task/accuracy/affected_build.rb
595
+ - lib/lazylead/task/accuracy/requirement.rb
589
596
  - lib/lazylead/task/alert.rb
590
597
  - lib/lazylead/task/confluence_ref.rb
591
598
  - lib/lazylead/task/echo.rb
@@ -593,11 +600,14 @@ files:
593
600
  - lib/lazylead/task/missing_comment.rb
594
601
  - lib/lazylead/task/propagate_down.rb
595
602
  - lib/lazylead/task/savepoint.rb
603
+ - lib/lazylead/task/touch.rb
596
604
  - lib/lazylead/version.rb
605
+ - lib/messages/accuracy.erb
597
606
  - lib/messages/due_date_expired.erb
598
607
  - lib/messages/illegal_fixversion_change.erb
599
608
  - lib/messages/missing_comment.erb
600
609
  - lib/messages/savepoint.erb
610
+ - lib/messages/svn_touch.erb
601
611
  - license.txt
602
612
  - readme.md
603
613
  - test/lazylead/allocated_test.rb
@@ -606,11 +616,14 @@ files:
606
616
  - test/lazylead/confluence_test.rb
607
617
  - test/lazylead/exchange_test.rb
608
618
  - test/lazylead/model_test.rb
619
+ - test/lazylead/opts_test.rb
609
620
  - test/lazylead/postman_test.rb
610
621
  - test/lazylead/salt_test.rb
611
622
  - test/lazylead/smoke_test.rb
612
623
  - test/lazylead/smtp_test.rb
613
624
  - test/lazylead/system/jira_test.rb
625
+ - test/lazylead/task/accuracy/accuracy_test.rb
626
+ - test/lazylead/task/accuracy/affected_build_test.rb
614
627
  - test/lazylead/task/assignee_alert_test.rb
615
628
  - test/lazylead/task/confluence_ref_test.rb
616
629
  - test/lazylead/task/duedate_test.rb
@@ -619,6 +632,7 @@ files:
619
632
  - test/lazylead/task/missing_comment_test.rb
620
633
  - test/lazylead/task/propagate_down_test.rb
621
634
  - test/lazylead/task/savepoint_test.rb
635
+ - test/lazylead/task/touch_test.rb
622
636
  - test/lazylead/version_test.rb
623
637
  - test/sqlite_test.rb
624
638
  - test/test.rb
@@ -629,7 +643,7 @@ licenses:
629
643
  - MIT
630
644
  metadata: {}
631
645
  post_install_message: |-
632
- Thanks for installing Lazylead v0.3.1!
646
+ Thanks for installing Lazylead v0.4.0!
633
647
  Read our blog posts: https://lazylead.org
634
648
  Stay in touch with the community in Telegram: https://t.me/lazylead
635
649
  Follow us on Twitter: https://twitter.com/lazylead
@@ -660,11 +674,14 @@ test_files:
660
674
  - test/lazylead/confluence_test.rb
661
675
  - test/lazylead/exchange_test.rb
662
676
  - test/lazylead/model_test.rb
677
+ - test/lazylead/opts_test.rb
663
678
  - test/lazylead/postman_test.rb
664
679
  - test/lazylead/salt_test.rb
665
680
  - test/lazylead/smoke_test.rb
666
681
  - test/lazylead/smtp_test.rb
667
682
  - test/lazylead/system/jira_test.rb
683
+ - test/lazylead/task/accuracy/accuracy_test.rb
684
+ - test/lazylead/task/accuracy/affected_build_test.rb
668
685
  - test/lazylead/task/assignee_alert_test.rb
669
686
  - test/lazylead/task/confluence_ref_test.rb
670
687
  - test/lazylead/task/duedate_test.rb
@@ -673,6 +690,7 @@ test_files:
673
690
  - test/lazylead/task/missing_comment_test.rb
674
691
  - test/lazylead/task/propagate_down_test.rb
675
692
  - test/lazylead/task/savepoint_test.rb
693
+ - test/lazylead/task/touch_test.rb
676
694
  - test/lazylead/version_test.rb
677
695
  - test/sqlite_test.rb
678
696
  - test/test.rb