lita-github-pinger 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/github_pinger.rb +22 -31
- data/lita-github-pinger.gemspec +1 -1
- 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: b594bf9b9431f0ad27149c953c92e38dddbf1f26
|
4
|
+
data.tar.gz: d78897eae20042b7b049f67e96d1f68af2bdf8a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3bc94bb6a94c3e92a402aa473d70b9c963e5484af79a61e127ca8bd65db14576a854e39bfb5deba671d6db9093144d521609c67dbb8b1ccf903b1d6ee1ec72e
|
7
|
+
data.tar.gz: bae42cbe1d15873aa803031cfcd78ab2c017c0ca0b2f07329eea0a7c6af09a0ca5e780141036bf26cefc03ac59f21aee36869fd533c823c0624533b9c337da71
|
@@ -34,10 +34,9 @@ module Lita
|
|
34
34
|
config :engineers, type: Hash, required: true
|
35
35
|
|
36
36
|
http.post("/ghping", :ghping)
|
37
|
-
http.post("/travisping", :travisping)
|
38
37
|
|
39
38
|
def ghping(request, response)
|
40
|
-
puts "########## New
|
39
|
+
puts "########## New GitHub Event! ##########"
|
41
40
|
body = MultiJson.load(request.body)
|
42
41
|
|
43
42
|
if body["comment"]
|
@@ -47,46 +46,38 @@ module Lita
|
|
47
46
|
if body["action"] && body["action"] == "assigned"
|
48
47
|
act_on_assign(body, response)
|
49
48
|
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def travisping(request, response)
|
53
|
-
puts "########## New Travis Event! ##########"
|
54
|
-
body = MultiJson.load(request.body)
|
55
49
|
|
56
|
-
|
57
|
-
|
50
|
+
if body["state"] && body["state"] == "success"
|
51
|
+
act_on_build_success(body, response)
|
52
|
+
end
|
58
53
|
|
59
|
-
if
|
60
|
-
|
61
|
-
elsif ["Broken", "Failed"].include?(build_status)
|
62
|
-
act_on_build_failure(commiter, body)
|
54
|
+
if body["state"] && body["state"] == "failure"
|
55
|
+
act_on_build_failure(body, response)
|
63
56
|
end
|
64
57
|
end
|
65
58
|
|
66
|
-
def act_on_build_failure(
|
67
|
-
|
68
|
-
|
59
|
+
def act_on_build_failure(body, response)
|
60
|
+
commit_url = body["commit"]["html_url"]
|
61
|
+
committer = find_engineer(github: github["commit"]["committer"]["login"])
|
69
62
|
|
70
|
-
puts "Detected
|
71
|
-
message = ":x: Your
|
72
|
-
message += "
|
63
|
+
puts "Detected a travis build failure for commit #{body["sha"]}"
|
64
|
+
message = ":x: Your commit failed some tests."
|
65
|
+
message += "\n#{commit_url}"
|
73
66
|
|
74
|
-
if commiter[:travis_preferences][:frequency]
|
75
|
-
|
76
|
-
end
|
67
|
+
return if ["off", "only_passes"].include?(commiter[:travis_preferences][:frequency])
|
68
|
+
send_dm(commiter[:usernames][:slack], message)
|
77
69
|
end
|
78
70
|
|
79
|
-
def act_on_build_success(
|
80
|
-
|
81
|
-
|
71
|
+
def act_on_build_success(body, response)
|
72
|
+
commit_url = body["commit"]["html_url"]
|
73
|
+
committer = find_engineer(github: github["commit"]["committer"]["login"])
|
82
74
|
|
83
|
-
puts "Detected
|
84
|
-
message = ":white_check_mark: Your
|
85
|
-
message += "
|
75
|
+
puts "Detected a travis build success for commit #{body["sha"]}"
|
76
|
+
message = ":white_check_mark: Your commit has passed its travis build."
|
77
|
+
message += "\n#{commit_url}"
|
86
78
|
|
87
|
-
if commiter[:travis_preferences][:frequency]
|
88
|
-
|
89
|
-
end
|
79
|
+
return if ["off", "only_failures"].include?(commiter[:travis_preferences][:frequency])
|
80
|
+
send_dm(commiter[:usernames][:slack], message)
|
90
81
|
end
|
91
82
|
|
92
83
|
def act_on_assign(body, response)
|
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.5.
|
3
|
+
spec.version = "0.5.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."
|