lita-github_pr_list 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91165ab7475df7a5d88e14b8528154a9edf2919f
|
4
|
+
data.tar.gz: a97244c9a462b27bd65b60d8622cbacd26e56b3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b49fee37598ef82069ad9a1be7f9039df93c1ea77563234975eb000081aec8872e7b55acdbdee6d5c56b97c4aad847f4841451f02ea93580a456e5f94a1ed2fd
|
7
|
+
data.tar.gz: 4399fecc1fe374a14cb805d89283fd16436b0851aa889b0e2e6b402c013d11d88f60b3ac5219eae1fecedc6a682c3635c3506c4c313cc898ee31ac2a668d1baf
|
@@ -26,16 +26,16 @@ module Lita
|
|
26
26
|
def message
|
27
27
|
self.status = repo_status(payload["repository"]["full_name"], payload["issue"])
|
28
28
|
if !status[:last_comment].empty?
|
29
|
-
if status[:
|
30
|
-
pass_dev?
|
31
|
-
elsif status[:list].include? Lita::GithubPrList::Status::PASS_DESIGN_EMOJI
|
32
|
-
pass_design?
|
33
|
-
elsif status[:list].include? Lita::GithubPrList::Status::REVIEW_EMOJI
|
29
|
+
if status[:last_comment].include? Lita::GithubPrList::Status::REVIEW_EMOJI
|
34
30
|
"@#{commenter} is currently reviewing: #{issue_title}. #{issue_html_url}"
|
35
|
-
elsif status[:
|
31
|
+
elsif status[:last_comment].include? Lita::GithubPrList::Status::FAIL_EMOJI
|
36
32
|
"@#{issue_owner} your pull request: #{issue_title} has failed. #{issue_html_url}"
|
37
|
-
elsif status[:
|
33
|
+
elsif status[:last_comment].include? Lita::GithubPrList::Status::FIXED_EMOJI
|
38
34
|
"#{issue_title} has been fixed: #{issue_html_url}"
|
35
|
+
elsif status[:list].include? Lita::GithubPrList::Status::PASS_DEV_EMOJI
|
36
|
+
pass_dev?
|
37
|
+
elsif status[:list].include? Lita::GithubPrList::Status::PASS_DESIGN_EMOJI
|
38
|
+
pass_design?
|
39
39
|
end
|
40
40
|
else
|
41
41
|
nil
|
@@ -0,0 +1,137 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"id": 1,
|
4
|
+
"url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1",
|
5
|
+
"html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
|
6
|
+
"body": "this is cool",
|
7
|
+
"user": {
|
8
|
+
"login": "octocat",
|
9
|
+
"id": 1,
|
10
|
+
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
|
11
|
+
"gravatar_id": "somehexcode",
|
12
|
+
"url": "https://api.github.com/users/octocat",
|
13
|
+
"html_url": "https://github.com/octocat",
|
14
|
+
"followers_url": "https://api.github.com/users/octocat/followers",
|
15
|
+
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
|
16
|
+
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
|
17
|
+
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
|
18
|
+
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
|
19
|
+
"organizations_url": "https://api.github.com/users/octocat/orgs",
|
20
|
+
"repos_url": "https://api.github.com/users/octocat/repos",
|
21
|
+
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
|
22
|
+
"received_events_url": "https://api.github.com/users/octocat/received_events",
|
23
|
+
"type": "User",
|
24
|
+
"site_admin": false
|
25
|
+
},
|
26
|
+
"created_at": "2011-04-14T16:00:49Z",
|
27
|
+
"updated_at": "2011-04-14T16:00:49Z"
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"id": 1,
|
31
|
+
"url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1",
|
32
|
+
"html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
|
33
|
+
"body": ":book:",
|
34
|
+
"user": {
|
35
|
+
"login": "octocat",
|
36
|
+
"id": 1,
|
37
|
+
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
|
38
|
+
"gravatar_id": "somehexcode",
|
39
|
+
"url": "https://api.github.com/users/octocat",
|
40
|
+
"html_url": "https://github.com/octocat",
|
41
|
+
"followers_url": "https://api.github.com/users/octocat/followers",
|
42
|
+
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
|
43
|
+
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
|
44
|
+
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
|
45
|
+
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
|
46
|
+
"organizations_url": "https://api.github.com/users/octocat/orgs",
|
47
|
+
"repos_url": "https://api.github.com/users/octocat/repos",
|
48
|
+
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
|
49
|
+
"received_events_url": "https://api.github.com/users/octocat/received_events",
|
50
|
+
"type": "User",
|
51
|
+
"site_admin": false
|
52
|
+
},
|
53
|
+
"created_at": "2011-04-14T16:00:49Z",
|
54
|
+
"updated_at": "2011-04-14T16:00:49Z"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"id": 1,
|
58
|
+
"url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1",
|
59
|
+
"html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
|
60
|
+
"body": ":elephant: :elephant: :elephant:",
|
61
|
+
"user": {
|
62
|
+
"login": "octocat",
|
63
|
+
"id": 1,
|
64
|
+
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
|
65
|
+
"gravatar_id": "somehexcode",
|
66
|
+
"url": "https://api.github.com/users/octocat",
|
67
|
+
"html_url": "https://github.com/octocat",
|
68
|
+
"followers_url": "https://api.github.com/users/octocat/followers",
|
69
|
+
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
|
70
|
+
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
|
71
|
+
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
|
72
|
+
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
|
73
|
+
"organizations_url": "https://api.github.com/users/octocat/orgs",
|
74
|
+
"repos_url": "https://api.github.com/users/octocat/repos",
|
75
|
+
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
|
76
|
+
"received_events_url": "https://api.github.com/users/octocat/received_events",
|
77
|
+
"type": "User",
|
78
|
+
"site_admin": false
|
79
|
+
},
|
80
|
+
"created_at": "2011-04-14T16:00:49Z",
|
81
|
+
"updated_at": "2011-04-14T16:00:49Z"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
"id": 1,
|
85
|
+
"url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1",
|
86
|
+
"html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
|
87
|
+
"body": ":art: :art: :art:",
|
88
|
+
"user": {
|
89
|
+
"login": "octocat",
|
90
|
+
"id": 1,
|
91
|
+
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
|
92
|
+
"gravatar_id": "somehexcode",
|
93
|
+
"url": "https://api.github.com/users/octocat",
|
94
|
+
"html_url": "https://github.com/octocat",
|
95
|
+
"followers_url": "https://api.github.com/users/octocat/followers",
|
96
|
+
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
|
97
|
+
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
|
98
|
+
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
|
99
|
+
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
|
100
|
+
"organizations_url": "https://api.github.com/users/octocat/orgs",
|
101
|
+
"repos_url": "https://api.github.com/users/octocat/repos",
|
102
|
+
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
|
103
|
+
"received_events_url": "https://api.github.com/users/octocat/received_events",
|
104
|
+
"type": "User",
|
105
|
+
"site_admin": false
|
106
|
+
},
|
107
|
+
"created_at": "2011-04-14T16:00:49Z",
|
108
|
+
"updated_at": "2011-04-14T16:00:49Z"
|
109
|
+
},
|
110
|
+
{
|
111
|
+
"id": 1,
|
112
|
+
"url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/1",
|
113
|
+
"html_url": "https://github.com/octocat/Hello-World/issues/1347#issuecomment-1",
|
114
|
+
"body": ":book:",
|
115
|
+
"user": {
|
116
|
+
"login": "octocat",
|
117
|
+
"id": 1,
|
118
|
+
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
|
119
|
+
"gravatar_id": "somehexcode",
|
120
|
+
"url": "https://api.github.com/users/octocat",
|
121
|
+
"html_url": "https://github.com/octocat",
|
122
|
+
"followers_url": "https://api.github.com/users/octocat/followers",
|
123
|
+
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
|
124
|
+
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
|
125
|
+
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
|
126
|
+
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
|
127
|
+
"organizations_url": "https://api.github.com/users/octocat/orgs",
|
128
|
+
"repos_url": "https://api.github.com/users/octocat/repos",
|
129
|
+
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
|
130
|
+
"received_events_url": "https://api.github.com/users/octocat/received_events",
|
131
|
+
"type": "User",
|
132
|
+
"site_admin": false
|
133
|
+
},
|
134
|
+
"created_at": "2011-04-14T16:00:49Z",
|
135
|
+
"updated_at": "2011-04-14T16:00:49Z"
|
136
|
+
}
|
137
|
+
]
|
@@ -6,6 +6,7 @@ describe Lita::Handlers::GithubPrList, lita_handler: true do
|
|
6
6
|
let(:issue_comments_fixed) { sawyer_resource_array("spec/fixtures/issue_comments_fixed.json") }
|
7
7
|
let(:issue_comments_trivial) { sawyer_resource_array("spec/fixtures/issue_comments_trivial.json") }
|
8
8
|
let(:issue_comments_passed_both) { sawyer_resource_array("spec/fixtures/issue_comments_passed_both.json") }
|
9
|
+
let(:issue_comments_passed_both_book_after) { sawyer_resource_array("spec/fixtures/issue_comments_passed_both_book_after.json") }
|
9
10
|
|
10
11
|
before :each do
|
11
12
|
Lita.config.handlers.github_pr_list.github_organization = 'aaaaaabbbbbbcccccc'
|
@@ -88,6 +89,22 @@ describe Lita::Handlers::GithubPrList, lita_handler: true do
|
|
88
89
|
" https://github.com/baxterthehacker/public-repo/issues/47")
|
89
90
|
expect(replies.last).to_not include(" - You still require DEV REVIEW")
|
90
91
|
end
|
92
|
+
context "Design/Dev passed and book is used" do
|
93
|
+
it "returns - currently reviewing" do
|
94
|
+
expect_any_instance_of(Octokit::Client).to receive(:issue_comments).and_return(issue_comments_passed_both_book_after)
|
95
|
+
|
96
|
+
request = Rack::Request.new("rack.input" => StringIO.new(issue_comment_event_passed_design))
|
97
|
+
response = Rack::Response.new(['Hello'], 200, { 'Content-Type' => 'text/plain' })
|
98
|
+
|
99
|
+
github_handler = Lita::Handlers::GithubPrList.new robot
|
100
|
+
github_handler.comment_hook(request, response)
|
101
|
+
|
102
|
+
expect(replies.last).to include("@baxterthehacker is currently reviewing: Spelling error in the README file."\
|
103
|
+
" https://github.com/baxterthehacker/public-repo/issues/47")
|
104
|
+
expect(replies.last).to_not include("@mcwaffle1234 your pull request: Spelling error in the README file has passed."\
|
105
|
+
" https://github.com/baxterthehacker/public-repo/issues/47")
|
106
|
+
end
|
107
|
+
end
|
91
108
|
|
92
109
|
|
93
110
|
it "mentions the github user in the room and tell them they failed" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-github_pr_list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael van den Beuken
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2015-12-
|
18
|
+
date: 2015-12-30 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: lita
|
@@ -192,6 +192,7 @@ files:
|
|
192
192
|
- spec/fixtures/issue_comments_new.json
|
193
193
|
- spec/fixtures/issue_comments_passed.json
|
194
194
|
- spec/fixtures/issue_comments_passed_both.json
|
195
|
+
- spec/fixtures/issue_comments_passed_both_book_after.json
|
195
196
|
- spec/fixtures/issue_comments_passed_design.json
|
196
197
|
- spec/fixtures/issue_comments_trivial.json
|
197
198
|
- spec/fixtures/one_org_issue_list.json
|
@@ -257,6 +258,7 @@ test_files:
|
|
257
258
|
- spec/fixtures/issue_comments_new.json
|
258
259
|
- spec/fixtures/issue_comments_passed.json
|
259
260
|
- spec/fixtures/issue_comments_passed_both.json
|
261
|
+
- spec/fixtures/issue_comments_passed_both_book_after.json
|
260
262
|
- spec/fixtures/issue_comments_passed_design.json
|
261
263
|
- spec/fixtures/issue_comments_trivial.json
|
262
264
|
- spec/fixtures/one_org_issue_list.json
|