lazylead 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/.0pdd.yml +3 -0
  3. data/.circleci/config.yml +0 -13
  4. data/.github/workflows/build.yml +39 -0
  5. data/.github/workflows/release.yml +15 -0
  6. data/.rubocop.yml +5 -1
  7. data/.rultor.yml +2 -2
  8. data/Gemfile +1 -1
  9. data/Rakefile +17 -9
  10. data/bin/lazylead +5 -5
  11. data/lazylead.gemspec +16 -20
  12. data/lib/lazylead/allocated.rb +1 -1
  13. data/lib/lazylead/cc.rb +1 -1
  14. data/lib/lazylead/cli/app.rb +3 -3
  15. data/lib/lazylead/confluence.rb +1 -1
  16. data/lib/lazylead/email.rb +1 -1
  17. data/lib/lazylead/exchange.rb +3 -3
  18. data/lib/lazylead/home.rb +2 -2
  19. data/lib/lazylead/log.rb +1 -1
  20. data/lib/lazylead/model.rb +2 -2
  21. data/lib/lazylead/opts.rb +1 -1
  22. data/lib/lazylead/os.rb +2 -1
  23. data/lib/lazylead/postman.rb +4 -4
  24. data/lib/lazylead/requires.rb +1 -1
  25. data/lib/lazylead/salt.rb +1 -1
  26. data/lib/lazylead/schedule.rb +1 -1
  27. data/lib/lazylead/smtp.rb +1 -1
  28. data/lib/lazylead/system/empty.rb +1 -1
  29. data/lib/lazylead/system/fake.rb +1 -1
  30. data/lib/lazylead/system/jira.rb +5 -3
  31. data/lib/lazylead/system/synced.rb +1 -1
  32. data/lib/lazylead/task/accuracy/accuracy.rb +3 -3
  33. data/lib/lazylead/task/accuracy/affected_build.rb +1 -1
  34. data/lib/lazylead/task/accuracy/attachment.rb +1 -1
  35. data/lib/lazylead/task/accuracy/environment.rb +1 -1
  36. data/lib/lazylead/task/accuracy/has_label.rb +1 -1
  37. data/lib/lazylead/task/accuracy/logs.rb +1 -1
  38. data/lib/lazylead/task/accuracy/logs_link.rb +1 -1
  39. data/lib/lazylead/task/accuracy/memes.rb +1 -1
  40. data/lib/lazylead/task/accuracy/onlyll.rb +1 -1
  41. data/lib/lazylead/task/accuracy/records.rb +1 -1
  42. data/lib/lazylead/task/accuracy/records_link.rb +1 -1
  43. data/lib/lazylead/task/accuracy/required.rb +1 -1
  44. data/lib/lazylead/task/accuracy/requirement.rb +1 -1
  45. data/lib/lazylead/task/accuracy/screenshots.rb +1 -1
  46. data/lib/lazylead/task/accuracy/servers.rb +1 -1
  47. data/lib/lazylead/task/accuracy/stacktrace.rb +2 -2
  48. data/lib/lazylead/task/accuracy/testcase.rb +1 -1
  49. data/lib/lazylead/task/accuracy/wiki.rb +1 -1
  50. data/lib/lazylead/task/accuracy/wiki_url.rb +1 -1
  51. data/lib/lazylead/task/alert/alert.rb +1 -1
  52. data/lib/lazylead/task/alert/alertif.rb +1 -1
  53. data/lib/lazylead/task/alert/changed_to.rb +1 -1
  54. data/lib/lazylead/task/assignment.rb +1 -1
  55. data/lib/lazylead/task/confluence_ref.rb +1 -1
  56. data/lib/lazylead/task/echo.rb +1 -1
  57. data/lib/lazylead/task/fix_version.rb +1 -1
  58. data/lib/lazylead/task/git/git.rb +1 -1
  59. data/lib/lazylead/task/loading.rb +1 -1
  60. data/lib/lazylead/task/micromanager.rb +1 -1
  61. data/lib/lazylead/task/missing_comment.rb +1 -1
  62. data/lib/lazylead/task/propagate_down.rb +1 -1
  63. data/lib/lazylead/task/savepoint.rb +1 -1
  64. data/lib/lazylead/task/svn/diff.rb +1 -1
  65. data/lib/lazylead/task/svn/grep.rb +1 -1
  66. data/lib/lazylead/task/svn/svn.rb +1 -1
  67. data/lib/lazylead/task/svn/touch.rb +42 -14
  68. data/lib/lazylead/version.rb +2 -2
  69. data/lib/lazylead.rb +1 -1
  70. data/license.txt +1 -1
  71. data/readme.md +14 -12
  72. data/test/lazylead/allocated_test.rb +1 -1
  73. data/test/lazylead/cc_test.rb +7 -7
  74. data/test/lazylead/cli/app_test.rb +1 -1
  75. data/test/lazylead/confluence_test.rb +1 -1
  76. data/test/lazylead/exchange_test.rb +10 -10
  77. data/test/lazylead/file_postman_test.rb +1 -1
  78. data/test/lazylead/model_test.rb +2 -2
  79. data/test/lazylead/opts_test.rb +1 -1
  80. data/test/lazylead/postman_test.rb +7 -7
  81. data/test/lazylead/retry_test.rb +1 -1
  82. data/test/lazylead/salt_test.rb +1 -1
  83. data/test/lazylead/smoke_test.rb +2 -2
  84. data/test/lazylead/smtp_test.rb +7 -7
  85. data/test/lazylead/stdout_postman_test.rb +1 -1
  86. data/test/lazylead/system/jira_test.rb +53 -54
  87. data/test/lazylead/task/accuracy/accuracy_test.rb +11 -11
  88. data/test/lazylead/task/accuracy/affected_build_test.rb +1 -1
  89. data/test/lazylead/task/accuracy/attachment_test.rb +4 -4
  90. data/test/lazylead/task/accuracy/environment_test.rb +1 -1
  91. data/test/lazylead/task/accuracy/has_label_test.rb +1 -1
  92. data/test/lazylead/task/accuracy/logs_link_test.rb +1 -1
  93. data/test/lazylead/task/accuracy/logs_test.rb +1 -1
  94. data/test/lazylead/task/accuracy/memes_test.rb +1 -1
  95. data/test/lazylead/task/accuracy/onlyll_test.rb +21 -21
  96. data/test/lazylead/task/accuracy/records_llink_test.rb +1 -1
  97. data/test/lazylead/task/accuracy/records_test.rb +1 -1
  98. data/test/lazylead/task/accuracy/score_test.rb +4 -4
  99. data/test/lazylead/task/accuracy/screenshots_test.rb +3 -3
  100. data/test/lazylead/task/accuracy/servers_test.rb +1 -1
  101. data/test/lazylead/task/accuracy/stacktrace_test.rb +1 -1
  102. data/test/lazylead/task/accuracy/testcase_test.rb +1 -1
  103. data/test/lazylead/task/accuracy/wiki_test.rb +1 -1
  104. data/test/lazylead/task/accuracy/wiki_url_test.rb +1 -1
  105. data/test/lazylead/task/alert/alertif_test.rb +5 -5
  106. data/test/lazylead/task/alert/assignee_alert_test.rb +1 -1
  107. data/test/lazylead/task/alert/changed_to_test.rb +5 -5
  108. data/test/lazylead/task/assignment_test.rb +5 -5
  109. data/test/lazylead/task/confluence_ref_test.rb +8 -8
  110. data/test/lazylead/task/created_recently_test.rb +4 -4
  111. data/test/lazylead/task/duedate_test.rb +14 -14
  112. data/test/lazylead/task/echo_test.rb +1 -1
  113. data/test/lazylead/task/fix_version_test.rb +6 -5
  114. data/test/lazylead/task/loading_test.rb +7 -7
  115. data/test/lazylead/task/micromanager_test.rb +5 -5
  116. data/test/lazylead/task/missing_comment_test.rb +4 -4
  117. data/test/lazylead/task/propagate_down_test.rb +1 -1
  118. data/test/lazylead/task/savepoint_test.rb +1 -1
  119. data/test/lazylead/task/svn/diff_test.rb +14 -15
  120. data/test/lazylead/task/svn/grep_test.rb +4 -3
  121. data/test/lazylead/task/svn/touch_test.rb +74 -6
  122. data/test/lazylead/version_test.rb +1 -1
  123. data/test/sqlite_test.rb +1 -1
  124. data/test/test.rb +10 -3
  125. metadata +33 -98
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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"),
@@ -78,7 +78,7 @@ module Lazylead
78
78
  words.each_with_index do |e, i|
79
79
  next unless e.start_with? text
80
80
  pair = snippets.last
81
- pair << i if pair.size.zero? || pair.size == 1
81
+ pair << i if pair.empty? || pair.size == 1
82
82
  snippets[-1] = pair
83
83
  snippets << [] if pair.size == 2
84
84
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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,23 +41,23 @@ module Lazylead
41
41
  end
42
42
 
43
43
  def run(_, postman, opts)
44
- files = opts.slice("files", ",")
45
- commits = touch(files, opts)
44
+ commits = touch(opts)
46
45
  postman.send(opts.merge(entries: commits)) unless commits.empty?
47
46
  end
48
47
 
49
48
  # Return all svn commits for a particular date range, which are touching
50
49
  # somehow the critical files within the svn repo.
51
- def touch(files, opts)
52
- xpath = files.map { |f| "contains(text(),\"#{f}\")" }.join(" or ")
53
- svn_log(opts).xpath("//logentry[paths/path[#{xpath}]]")
54
- .map { |xml| to_entry(xml) }
55
- .each do |e|
50
+ def touch(opts)
51
+ files = opts.slice("files", ",")
52
+ branches = opts.slice("branches", ",")
53
+ svn_log(opts)
54
+ .select { |e| branches.empty? || branches.any? { |b| e.paths.path.start_with? b } }
55
+ .each do |e|
56
56
  e.paths.path.delete_if { |p| files.none? { |f| p.include? f } } if e.paths.path.respond_to? :delete_if
57
57
  end
58
58
  end
59
59
 
60
- # Return all svn commits for particular date range in repo
60
+ # Return svn commits history for file(s) within particular date range in repo
61
61
  def svn_log(opts)
62
62
  now = if opts.key? "now"
63
63
  DateTime.parse(opts["now"])
@@ -65,11 +65,15 @@ module Lazylead
65
65
  DateTime.now
66
66
  end
67
67
  start = (now.to_time - opts["period"].to_i).to_datetime
68
- raw = OS.new.run "svn log --no-auth-cache",
69
- "--username #{opts.decrypt('svn_user', 'svn_salt')}",
70
- "--password #{opts.decrypt('svn_password', 'svn_salt')}",
71
- "--xml -v -r {#{start}}:{#{now}} #{opts['svn_url']}"
72
- Nokogiri.XML(raw, nil, "UTF-8")
68
+ locations(opts).flat_map do |file|
69
+ raw = OS.new.run "svn log --no-auth-cache",
70
+ "--username #{opts.decrypt('svn_user', 'svn_salt')}",
71
+ "--password #{opts.decrypt('svn_password', 'svn_salt')}",
72
+ "--xml -v -r {#{start}}:{#{now}} #{opts['svn_url']}/#{file}"
73
+ Nokogiri.XML(raw, nil, "UTF-8")
74
+ .xpath("//logentry[paths/path]")
75
+ .map { |xml| to_entry(xml) }
76
+ end
73
77
  end
74
78
 
75
79
  # Convert single revision(XML text) to entry object.
@@ -91,6 +95,30 @@ module Lazylead
91
95
  hsh.transform_values { |v| v.is_a?(Hash) ? to_struct(v) : v }
92
96
  )
93
97
  end
98
+
99
+ # Return for each file all his locations considering branches
100
+ # > locations('readme.md')
101
+ # branches/0.13.x/readme.md
102
+ # trunk/readme.md
103
+ #
104
+ # @todo #567/DEV Performance: improve the glob pattern to support multiple files.
105
+ # Right now in order to find all branches for a particular file we are using glob pattern
106
+ # - https://en.wikipedia.org/wiki/Glob_(programming)
107
+ # - https://stackoverflow.com/a/70950401/6916890
108
+ # - https://globster.xyz
109
+ # Right now for each file we initiate a separate search request, thus we need to think
110
+ # how to avoid this and send only one search request
111
+ def locations(opts)
112
+ opts.slice("files", ",").flat_map do |file|
113
+ raw = OS.new.run "svn ls --no-auth-cache ",
114
+ "--username #{opts.decrypt('svn_user', 'svn_salt')}",
115
+ "--password #{opts.decrypt('svn_password', 'svn_salt')}",
116
+ "--xml -R --search \"#{file}\" #{opts['svn_url']}"
117
+ Nokogiri.XML(raw, nil, "UTF-8")
118
+ .xpath("/lists/list/entry/name/text()")
119
+ .map { |f| f.to_s.strip }
120
+ end
121
+ end
94
122
  end
95
123
  end
96
124
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
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"),
@@ -23,5 +23,5 @@
23
23
  # OR OTHER DEALINGS IN THE SOFTWARE.
24
24
 
25
25
  module Lazylead
26
- VERSION = "0.12.0"
26
+ VERSION = "0.13.0"
27
27
  end
data/lib/lazylead.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
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/license.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2019-2021 Yurii Dubinka
3
+ Copyright (c) 2019-2022 Yurii Dubinka
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"),
data/readme.md CHANGED
@@ -1,33 +1,37 @@
1
1
  [![Versions](https://img.shields.io/badge/semver-2.0-green)](https://semver.org/spec/v2.0.0.html)
2
2
  [![Gem Version](https://badge.fury.io/rb/lazylead.svg)](https://rubygems.org/gems/lazylead)
3
- [![Downloads](https://ruby-gem-downloads-badge.herokuapp.com/lazylead?type=total)](https://rubygems.org/gems/lazylead)
3
+
4
+ [![Downloads](https://img.shields.io/gem/dt/lazylead)](https://rubygems.org/gems/lazylead)
4
5
  [![](https://img.shields.io/docker/pulls/dgroup/lazylead.svg)](https://hub.docker.com/r/dgroup/lazylead "Image pulls")
5
6
  [![](https://images.microbadger.com/badges/image/dgroup/lazylead.svg)](https://microbadger.com/images/dgroup/lazylead "Image layers")
6
7
  [![Commit activity](https://img.shields.io/github/commit-activity/y/dgroup/lazylead.svg?style=flat-square)](https://github.com/dgroup/lazylead/graphs/commit-activity)
7
8
  [![Hits-of-Code](https://hitsofcode.com/github/dgroup/lazylead)](https://hitsofcode.com/view/github/dgroup/lazylead)
8
9
  [![License: MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](./license.txt)
9
10
 
10
- [![Build status circleci](https://circleci.com/gh/dgroup/lazylead/tree/master.svg?style=shield)](https://circleci.com/gh/dgroup/lazylead/tree/master)
11
+ [![CI](https://github.com/dgroup/lazylead/actions/workflows/build.yml/badge.svg)](https://github.com/dgroup/lazylead/actions/workflows/build.yml)
11
12
  [![0pdd](http://www.0pdd.com/svg?name=dgroup/lazylead)](http://www.0pdd.com/p?name=dgroup/lazylead)
12
- [![Dependency Status](https://requires.io/github/dgroup/lazylead/requirements.svg?branch=master)](https://requires.io/github/dgroup/lazylead/requirements/?branch=master)
13
13
  [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dgroup_lazylead&metric=alert_status)](https://sonarcloud.io/dashboard?id=dgroup_lazylead)
14
14
  [![codebeat badge](https://codebeat.co/badges/f3bc8c19-5986-413f-89c4-c869b1e9b705)](https://codebeat.co/projects/github-com-dgroup-lazylead-master)
15
15
  [![Codacy Badge](https://app.codacy.com/project/badge/Grade/e1ec2d63ff9040d99c934e3c05c24abe)](https://www.codacy.com/manual/dgroup/lazylead?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=dgroup/lazylead&amp;utm_campaign=Badge_Grade)
16
16
  [![Maintainability](https://api.codeclimate.com/v1/badges/e873a41b1c76d7b2d6ae/maintainability)](https://codeclimate.com/github/dgroup/lazylead/maintainability)
17
17
  [![codecov](https://codecov.io/gh/dgroup/lazylead/branch/master/graph/badge.svg)](https://codecov.io/gh/dgroup/lazylead)
18
18
 
19
- [![DevOps By Rultor.com](http://www.rultor.com/b/dgroup/lazylead)](http://www.rultor.com/p/dgroup/lazylead)
20
- [![EO badge](http://www.elegantobjects.org/badge.svg)](http://www.elegantobjects.org/#principles)
21
-
22
19
  ### Overview
23
20
  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.
24
21
 
25
- The idea of automatic management is not new, for example [Zerocracy](https://www.zerocracy.com/) is available on the market.
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).
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.
22
+ The idea of automatic management is not new, 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).
23
+ 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. The same logic we can apply to our day-to-day ticket management activities - let's reduce or even remove unnecessary routine actions.
28
24
 
29
25
  Join our telegram chat [lazylead](https://t.me/lazyleads) for discussions.
30
26
 
27
+ Legend:
28
+
29
+ - 🚴🏽 in-progress
30
+ - ⌛ planned
31
+ - ✅ implemented
32
+ - 🌵 implemented, but not tested
33
+ - ❌ not supported/planned
34
+
31
35
  | Daily annoying task | Jira | Github | Trello | SVN | Git |
32
36
  | :---------------------------------------------------------------------------------- | :---: | :----: | :----: | :----: | :----: |
33
37
  | [Notify ticket's assignee](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ | ❌ | ❌ |
@@ -68,8 +72,6 @@ Join our telegram chat [lazylead](https://t.me/lazyleads) for discussions.
68
72
  | GitLab | VCS + CI/CD | ⌛ |
69
73
  | BitBucket | VCS + CI/CD | ⌛ |
70
74
 
71
- 🚴🏽 - in-progress, ⌛ - planned, ✅ - implemented, 🌵 - implemented, but not tested, ❌ - not supported/planned.
72
-
73
75
  New ideas, bugs, suggestions or questions are welcome [via GitHub issues](https://github.com/dgroup/lazylead/issues/new)!
74
76
 
75
77
  ### Get started
@@ -179,7 +181,7 @@ For simplicity, we are using [docker-compose](https://docs.docker.com/compose/):
179
181
 
180
182
  <a href="https://www.buymeacoffee.com/lazylead" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
181
183
 
182
- [Pull requests](http://www.elegantobjects.org/#principles) are welcome! Don't forget to add your name to contribution section and run this, beforehand:
184
+ Pull requests are welcome! Don't forget to add your name to contribution section and run this, beforehand:
183
185
  ```ruby
184
186
  rake -A
185
187
  ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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"),
@@ -115,18 +115,18 @@ module Lazylead
115
115
  # lead's email, thus, its took few minutes for huge projects.
116
116
  test "cc by component is found" do
117
117
  skip "Disabled due to performance issue with Jira API"
118
- assert_equal ENV["cc_email"],
118
+ assert_equal ENV.fetch("cc_email", nil),
119
119
  ComponentCC.new(
120
- ENV["cc_project"],
120
+ ENV.fetch("cc_project", nil),
121
121
  Jira.new(
122
122
  {
123
- username: ENV["JIRA_USER"],
124
- password: ENV["JIRA_PASS"],
125
- site: ENV["JIRA_URL"],
123
+ username: ENV.fetch("JIRA_USER", nil),
124
+ password: ENV.fetch("JIRA_PASS", nil),
125
+ site: ENV.fetch("JIRA_URL", nil),
126
126
  context_path: ""
127
127
  }
128
128
  )
129
- ).cc(ENV["cc_component"])
129
+ ).cc(ENV.fetch("cc_component", nil))
130
130
  end
131
131
 
132
132
  test "detect plain cc" do
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
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-2021 Yurii Dubinka
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"),