dri 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dri/commands/fetch/failures.rb +30 -26
- data/lib/dri/report.rb +1 -1
- data/lib/dri/version.rb +1 -1
- metadata +2 -3
- data/lib/dri/templates/incidents/.gitkeep +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb71a1d13a00cb33c436608e3c34e40a4202505bad341d31d5d85803c36495d4
|
4
|
+
data.tar.gz: 73648bafa41eac28824435b62a41ead17494c144bbd99c6af52062e616379f2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c2d592d0906e3764ec1ab2fe298a42a1798be1d58dd216261ed2a88227cfe007a97a175ae199f5ee4f4db16f7efe2dd6f99521e8febc740e191b61c0f2ef8cc
|
7
|
+
data.tar.gz: 1106b7fc11be59d38c72f471f8a5148eb4e724a81665b4382185da5c22a4e554fc7e1b1cc274a980b9ceeb6071f7fa5da0397e3657655132a6d21f2a31cf9712
|
data/Gemfile.lock
CHANGED
@@ -13,8 +13,9 @@ module Dri
|
|
13
13
|
SORT_BY_OPTIONS = {
|
14
14
|
title: 0,
|
15
15
|
triaged: 1,
|
16
|
-
|
17
|
-
|
16
|
+
environment: 2,
|
17
|
+
author: 3,
|
18
|
+
url: 4
|
18
19
|
}.freeze
|
19
20
|
|
20
21
|
def initialize(options)
|
@@ -25,14 +26,16 @@ module Dri
|
|
25
26
|
def execute(input: $stdin, output: $stdout) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
|
26
27
|
verify_config_exists
|
27
28
|
|
29
|
+
urgent_environments = %w[canary canary.staging]
|
30
|
+
|
28
31
|
title = add_color('Title', :bright_yellow)
|
29
32
|
triaged = add_color('Triaged?', :bright_yellow)
|
33
|
+
environment = add_color('Environment', :bright_yellow)
|
30
34
|
author = add_color('Author', :bright_yellow)
|
31
35
|
url = add_color('URL', :bright_yellow)
|
32
36
|
|
33
37
|
failures = []
|
34
|
-
|
35
|
-
labels = [title, triaged, author, url]
|
38
|
+
labels = [title, triaged, environment, author, url]
|
36
39
|
triaged_counter = 0
|
37
40
|
|
38
41
|
logger.info "Fetching today's failures..."
|
@@ -50,6 +53,12 @@ module Dri
|
|
50
53
|
author = failure.to_h.dig('author', 'username')
|
51
54
|
url = failure.web_url
|
52
55
|
triaged = add_color('x', :red)
|
56
|
+
envs = failure.labels.select { |l| l.include?('found:') }.map do |l|
|
57
|
+
env = l.split(':').last.gsub('.gitlab.com', '')
|
58
|
+
|
59
|
+
env == 'gitlab.com' ? 'production' : env
|
60
|
+
end
|
61
|
+
urgent = urgent_environments.all? { |env| envs.include?(env) }
|
53
62
|
|
54
63
|
emoji_awards = api_client.fetch_awarded_emojis(failure.iid).find do |e|
|
55
64
|
e.name == emoji && e.to_h.dig('user', 'username') == username
|
@@ -61,32 +70,27 @@ module Dri
|
|
61
70
|
end
|
62
71
|
|
63
72
|
if @options[:urgent]
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
if label.include?('found:canary.gitlab.com' && 'found:canary.staging.gitlab.com')
|
68
|
-
urgent << [title, triaged, author, url]
|
69
|
-
end
|
70
|
-
end
|
73
|
+
failures << [title, triaged, envs.first, author, url] if urgent
|
74
|
+
else
|
75
|
+
failures << [title, triaged, envs.first, author, url]
|
71
76
|
end
|
72
|
-
|
73
|
-
failures << [title, triaged, author, url]
|
74
|
-
|
75
|
-
failures.sort_by! { |e| e[SORT_BY_OPTIONS[@options[:sort_by].to_sym]] } if @options[:sort_by]
|
76
77
|
end
|
77
|
-
end
|
78
78
|
|
79
|
-
|
80
|
-
print_table(labels, urgent, alignments: [:left, :center, :center, :left])
|
81
|
-
output.puts(<<~MSG)
|
82
|
-
Found: #{urgent.size} urgent failures, occurring in both canary.gitlab.com and canary.staging.gitlab.com.
|
83
|
-
MSG
|
84
|
-
else
|
85
|
-
print_table(labels, failures, alignments: [:left, :center, :center, :left])
|
86
|
-
output.puts(<<~MSG)
|
87
|
-
Found: #{failures.size} failures, of these #{triaged_counter} have been triaged with a #{emoji}.
|
88
|
-
MSG
|
79
|
+
failures.sort_by! { |failure| failure[SORT_BY_OPTIONS[@options[:sort_by]&.to_sym || :environment]] }
|
89
80
|
end
|
81
|
+
|
82
|
+
msg = if @options[:urgent]
|
83
|
+
<<~MSG
|
84
|
+
Found: #{failures.size} urgent failures, occurring in both canary.gitlab.com and canary.staging.gitlab.com.
|
85
|
+
MSG
|
86
|
+
else
|
87
|
+
<<~MSG
|
88
|
+
Found: #{failures.size} failures, of these #{triaged_counter} have been triaged with a #{emoji}.
|
89
|
+
MSG
|
90
|
+
end
|
91
|
+
|
92
|
+
print_table(labels, failures, alignments: [:left, :center, :center, :left])
|
93
|
+
output.puts(msg)
|
90
94
|
end
|
91
95
|
end
|
92
96
|
end
|
data/lib/dri/report.rb
CHANGED
data/lib/dri/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitLab Quality
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab
|
@@ -337,7 +337,6 @@ files:
|
|
337
337
|
- lib/dri/gitlab/issues.rb
|
338
338
|
- lib/dri/refinements/truncate.rb
|
339
339
|
- lib/dri/report.rb
|
340
|
-
- lib/dri/templates/incidents/.gitkeep
|
341
340
|
- lib/dri/utils/feature_flag_consts.rb
|
342
341
|
- lib/dri/utils/markdown_lists.rb
|
343
342
|
- lib/dri/utils/table.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
#
|