bender-bot 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/bender/bot.rb +12 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16a097145cfdcc734e12df57606e67d363c2c614
|
4
|
+
data.tar.gz: f1c109b61161bdee403f656b707d1773d331a919
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2e0bebe81fb108140633f466bbc505271eeb3419db719adaf7e099d11f06200bbfafc6ce51b900b59461081487ccbd64ed46f28226069b2ef0cb3c07d2b9123
|
7
|
+
data.tar.gz: e1bc4357247d6e4046e68e1a7b00d767a4b4ad346a9e5be833c783e5e7275b6aa772ab55f44e02b0fd0ed3c02f1e7763fce8c07669d5e50d306bf4c8014b5821
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.3
|
data/lib/bender/bot.rb
CHANGED
@@ -59,7 +59,7 @@ class BenderBot
|
|
59
59
|
desc: 'Close an incident',
|
60
60
|
},
|
61
61
|
open: {
|
62
|
-
fmt: "
|
62
|
+
fmt: "#{SEVERITY_FIELD.upcase}=#{SEVERITIES.keys.sort_by(&:to_i).join(',')} SUMMARY_TEXT",
|
63
63
|
desc: 'Open a new incident',
|
64
64
|
},
|
65
65
|
summary: {
|
@@ -160,7 +160,7 @@ class BenderBot
|
|
160
160
|
unless status =~ /resolved|closed/i
|
161
161
|
'%s (%s - %s) [%s]: %s' % [
|
162
162
|
incident_link(i),
|
163
|
-
short_severity(i
|
163
|
+
short_severity(sev_for(i)),
|
164
164
|
normalize_value(i['fields']['status']),
|
165
165
|
friendly_date(i['fields']['created']),
|
166
166
|
i['fields']['summary']
|
@@ -191,8 +191,7 @@ class BenderBot
|
|
191
191
|
i['fields']['summary']
|
192
192
|
]
|
193
193
|
|
194
|
-
|
195
|
-
severities[sev] << repr
|
194
|
+
severities[sev_for(i)] << repr
|
196
195
|
statuses[status] += 1
|
197
196
|
end
|
198
197
|
end
|
@@ -203,7 +202,7 @@ class BenderBot
|
|
203
202
|
summary << '%s: %d incident(s)' % [ status, size ]
|
204
203
|
end
|
205
204
|
summary << ''
|
206
|
-
summary <<
|
205
|
+
summary << "By #{SEVERITY_FIELD.capitalize}:"
|
207
206
|
severities.keys.sort.each do |severity|
|
208
207
|
summary << '%s: %d incident(s)' % [
|
209
208
|
short_severity(severity),
|
@@ -502,4 +501,12 @@ private
|
|
502
501
|
|
503
502
|
def prefix ; config[:prefix] end
|
504
503
|
|
504
|
+
|
505
|
+
def sev_for i
|
506
|
+
sev = if i['fields'][SEVERITY_FIELD]
|
507
|
+
i['fields'][SEVERITY_FIELD]['value'] || i['fields'][SEVERITY_FIELD]['name']
|
508
|
+
end
|
509
|
+
sev.nil? ? '??' : sev
|
510
|
+
end
|
511
|
+
|
505
512
|
end
|