lita-github-pinger 0.9.7 → 0.9.8
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.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/lib/lita/handlers/github_pinger.rb +29 -29
- data/lita-github-pinger.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0bdd1e180e85f791f7dc861b0c6cc6f6d6a828c0d52eb0ee8ea95a071aa6cfb2
|
|
4
|
+
data.tar.gz: 45f5f8e03dbb33a06a12fdbb642f6ddc564b6abd0e12516531744a8489bba2e3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '08079f6af45a95dd17270504b7a1a851ce696556b143bea79d51b5e4bc5959866cb293b7a12487ce21050cbd863b1b4001de453989a8684d49e8a1b7e0a6846c'
|
|
7
|
+
data.tar.gz: 883ca754f34895bb844c12f0dbe7985d807543f8fdbabc797c08f1e2e91fb38ac6529933e6a1f35dad8e17cdfe70aff91fac869f66dfa748f27973c1ccd4fda9
|
data/Gemfile
CHANGED
|
@@ -171,46 +171,46 @@ module Lita
|
|
|
171
171
|
puts "looking at previously notified reviewers for this PR"
|
|
172
172
|
|
|
173
173
|
pr = body["pull_request"]
|
|
174
|
-
|
|
175
174
|
url = pr["html_url"]
|
|
176
175
|
|
|
177
|
-
|
|
176
|
+
redis.lock() do |lock|
|
|
177
|
+
notified_engineers = redis.get(REVIEW_REDIS_KEY + ":" + url)
|
|
178
178
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
notified_engineers = if notified_engineers
|
|
180
|
+
JSON.parse(notified_engineers)
|
|
181
|
+
else
|
|
182
|
+
[]
|
|
183
|
+
end
|
|
184
184
|
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
pr["requested_reviewers"].each do |reviewer|
|
|
186
|
+
engineer = find_engineer(github: reviewer["login"])
|
|
187
187
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
if !engineer
|
|
189
|
+
puts "Could not find engineer #{reviewer["login"]}"
|
|
190
|
+
next
|
|
191
|
+
end
|
|
192
192
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
if notified_engineers.include?(reviewer["login"])
|
|
194
|
+
puts "#{reviewer["login"]} has already been notified to review PR, skipping..."
|
|
195
|
+
next
|
|
196
|
+
end
|
|
197
197
|
|
|
198
|
-
|
|
198
|
+
puts "#{engineer} determined as a reviewer."
|
|
199
199
|
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
puts "Looking up preferences..."
|
|
201
|
+
should_notify = engineer[:github_preferences][:notify_about_review_requests]
|
|
202
202
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
203
|
+
if !should_notify
|
|
204
|
+
puts "will not notify, preference for :github_preferences[:notify_about_review_requests] is not true"
|
|
205
|
+
else
|
|
206
|
+
message = "You've been asked to review a pull request:\n#{url}"
|
|
207
|
+
send_dm(engineer[:usernames][:slack], message)
|
|
208
|
+
notified_engineers.push(reviewer["login"])
|
|
209
|
+
end
|
|
209
210
|
end
|
|
210
|
-
end
|
|
211
|
-
|
|
212
|
-
redis.set(REVIEW_REDIS_KEY + ":" + url, notified_engineers.to_json)
|
|
213
211
|
|
|
212
|
+
redis.set(REVIEW_REDIS_KEY + ":" + url, notified_engineers.to_json)
|
|
213
|
+
end
|
|
214
214
|
response
|
|
215
215
|
end
|
|
216
216
|
|
data/lita-github-pinger.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |spec|
|
|
2
2
|
spec.name = "lita-github-pinger"
|
|
3
|
-
spec.version = "0.9.
|
|
3
|
+
spec.version = "0.9.8"
|
|
4
4
|
spec.authors = ["Taylor Lapeyre"]
|
|
5
5
|
spec.email = ["taylorlapeyre@gmail.com"]
|
|
6
6
|
spec.description = "A Lita handler that detects github comment notifications and regurgitates a ping to the correct slack username."
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lita-github-pinger
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Taylor Lapeyre
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-09-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lita
|