lita-github_pr_list 0.0.7 → 0.0.8

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: ebc0fc19185a5ac330656f0b67999f58c0e5e988
4
- data.tar.gz: 82b3c03c6f58dbcc0480283bb3b03c10fc1c12fd
3
+ metadata.gz: d4922f782e35b74f9dc56d480e442ab45ead6c25
4
+ data.tar.gz: 310f608d125d10eb36232d0dfd89f3c3b0f37022
5
5
  SHA512:
6
- metadata.gz: 127fb68e93ed3eb11befa20e04bc1307114b96798871333c2fa047c8d3d18bc4df7993e2afc0e6797ce104e63c14cb0b6237e953f157784443803486e6937ba8
7
- data.tar.gz: 9532d705c109b36883605803d067bc9422528bea89bed55d53a43a8a0bf5af7b7e0a6397bc0304e22d68297a94521068a6fc58d760d3d5c28081c32e258adab7
6
+ metadata.gz: 2229040711bbbced7c92b6e1d33ed76433578196ce67ec823eb7fdbfd4646aaeec3b5601bea2ba342508d5c4af12b417d02d538b1b03fcaa866d43ffcf9feb0b
7
+ data.tar.gz: d9c7c66acdd408b3ea11646689f3cad189242045ae4d03f53e0bf0248722e72525fc9cfcdbdd765ad3e2913bc6ef5993183de31bc0be0af4e37c1115dd9b4626
@@ -1,8 +1,8 @@
1
1
  module Lita
2
2
  module GithubPrList
3
3
  class CheckList
4
- attr_accessor :request, :response, :payload, :redis, :comment_body, :comment_id, :issue_owner,
5
- :issue_title, :issue_html_url, :repo_name, :github_token, :github_client
4
+ attr_accessor :request, :response, :payload, :redis, :repo_name, :comment_body,
5
+ :title, :id, :github_token, :github_client
6
6
 
7
7
  def initialize(params = {})
8
8
  self.github_token = params.fetch(:github_token, nil)
@@ -21,14 +21,12 @@ module Lita
21
21
  - [ ] Deploy to production "
22
22
 
23
23
  self.payload = JSON.parse(request.body.read)
24
- self.comment_body = "#{payload["comment"]["body"]} #{list}"
25
- self.comment_id = payload["comment"]["id"]
26
- self.issue_owner = payload["pull_request"]["user"]["login"]
27
- self.issue_title = payload["pull_request"]["title"]
28
- self.issue_html_url = payload["pull_request"]["html_url"]
29
- self.repo_name = payload["pull_request"]["head"]["full_name"]
24
+ self.repo_name = payload["pull_request"]["head"]["repo"]["full_name"]
25
+ self.comment_body = "#{payload["pull_request"]["body"]} #{list}"
26
+ self.title = payload["pull_request"]["title"]
27
+ self.id = payload["number"]
30
28
 
31
- github_client.update_comment("octokit/octokit.rb", comment_id.to_i, comment_body)
29
+ github_client.update_pull_request(repo_name, id, title, comment_body, 'open') if payload["action"] == "opened"
32
30
  end
33
31
  end
34
32
  end
@@ -1,5 +1,5 @@
1
1
  module Lita
2
2
  module GithubPrList
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
@@ -66,14 +66,12 @@ module Lita
66
66
 
67
67
  def add_pr_hooks(response)
68
68
  Lita::GithubPrList::WebHook.new(github_organization: github_organization, github_token: github_access_token,
69
- web_hook: web_hook, response: response,
70
- event_type: "pull_request_review_comment").add_hooks
69
+ web_hook: web_hook, response: response, event_type: "pull_request").add_hooks
71
70
  end
72
71
 
73
72
  def remove_pr_hooks(response)
74
73
  Lita::GithubPrList::WebHook.new(github_organization: github_organization, github_token: github_access_token,
75
- web_hook: web_hook, response: response,
76
- event_type: "pull_request_review_comment").remove_hooks
74
+ web_hook: web_hook, response: response, event_type: "pull_request").remove_hooks
77
75
  end
78
76
 
79
77
  private
@@ -0,0 +1,413 @@
1
+ {
2
+ "action": "opened",
3
+ "number": 48,
4
+ "pull_request": {
5
+ "url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/48",
6
+ "id": 18905849,
7
+ "html_url": "https://github.com/baxterthehacker/public-repo/pull/48",
8
+ "diff_url": "https://github.com/baxterthehacker/public-repo/pull/48.diff",
9
+ "patch_url": "https://github.com/baxterthehacker/public-repo/pull/48.patch",
10
+ "issue_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/48",
11
+ "number": 48,
12
+ "state": "open",
13
+ "title": "Update the README with new information",
14
+ "user": {
15
+ "login": "baxterthehacker",
16
+ "id": 6752317,
17
+ "avatar_url": "https://avatars.githubusercontent.com/u/6752317?",
18
+ "gravatar_id": "258ae60b5512c8402b93673b7478d9c6",
19
+ "url": "https://api.github.com/users/baxterthehacker",
20
+ "html_url": "https://github.com/baxterthehacker",
21
+ "followers_url": "https://api.github.com/users/baxterthehacker/followers",
22
+ "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
23
+ "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
24
+ "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
25
+ "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
26
+ "organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
27
+ "repos_url": "https://api.github.com/users/baxterthehacker/repos",
28
+ "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
29
+ "received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
30
+ "type": "User",
31
+ "site_admin": false
32
+ },
33
+ "body": "This is a pretty simple change that we need to pull into master.
34
+ - [ ] Change log
35
+ - [ ] Demo page
36
+ - [ ] Product owner signoff
37
+ - [ ] Merge into master
38
+ - [ ] Deploy to production",
39
+ "created_at": "2014-07-25T16:37:42Z",
40
+ "updated_at": "2014-07-25T16:37:42Z",
41
+ "closed_at": null,
42
+ "merged_at": null,
43
+ "merge_commit_sha": null,
44
+ "assignee": null,
45
+ "milestone": null,
46
+ "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/48/commits",
47
+ "review_comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/48/comments",
48
+ "review_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments/{number}",
49
+ "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/48/comments",
50
+ "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/05c588ba8cd510ecbe112d020f215facb17817a6",
51
+ "head": {
52
+ "label": "baxterthehacker:changes",
53
+ "ref": "changes",
54
+ "sha": "05c588ba8cd510ecbe112d020f215facb17817a6",
55
+ "user": {
56
+ "login": "baxterthehacker",
57
+ "id": 6752317,
58
+ "avatar_url": "https://avatars.githubusercontent.com/u/6752317?",
59
+ "gravatar_id": "258ae60b5512c8402b93673b7478d9c6",
60
+ "url": "https://api.github.com/users/baxterthehacker",
61
+ "html_url": "https://github.com/baxterthehacker",
62
+ "followers_url": "https://api.github.com/users/baxterthehacker/followers",
63
+ "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
64
+ "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
65
+ "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
66
+ "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
67
+ "organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
68
+ "repos_url": "https://api.github.com/users/baxterthehacker/repos",
69
+ "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
70
+ "received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
71
+ "type": "User",
72
+ "site_admin": false
73
+ },
74
+ "repo": {
75
+ "id": 20000106,
76
+ "name": "public-repo",
77
+ "full_name": "baxterthehacker/public-repo",
78
+ "owner": {
79
+ "login": "baxterthehacker",
80
+ "id": 6752317,
81
+ "avatar_url": "https://avatars.githubusercontent.com/u/6752317?",
82
+ "gravatar_id": "258ae60b5512c8402b93673b7478d9c6",
83
+ "url": "https://api.github.com/users/baxterthehacker",
84
+ "html_url": "https://github.com/baxterthehacker",
85
+ "followers_url": "https://api.github.com/users/baxterthehacker/followers",
86
+ "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
87
+ "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
88
+ "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
89
+ "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
90
+ "organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
91
+ "repos_url": "https://api.github.com/users/baxterthehacker/repos",
92
+ "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
93
+ "received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
94
+ "type": "User",
95
+ "site_admin": false
96
+ },
97
+ "private": false,
98
+ "html_url": "https://github.com/baxterthehacker/public-repo",
99
+ "description": "",
100
+ "fork": false,
101
+ "url": "https://api.github.com/repos/baxterthehacker/public-repo",
102
+ "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks",
103
+ "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}",
104
+ "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}",
105
+ "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams",
106
+ "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks",
107
+ "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}",
108
+ "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events",
109
+ "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}",
110
+ "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}",
111
+ "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags",
112
+ "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}",
113
+ "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}",
114
+ "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}",
115
+ "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}",
116
+ "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}",
117
+ "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages",
118
+ "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers",
119
+ "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors",
120
+ "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers",
121
+ "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription",
122
+ "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}",
123
+ "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}",
124
+ "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}",
125
+ "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments/{number}",
126
+ "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}",
127
+ "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}",
128
+ "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges",
129
+ "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}",
130
+ "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads",
131
+ "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}",
132
+ "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}",
133
+ "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}",
134
+ "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}",
135
+ "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}",
136
+ "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}",
137
+ "created_at": "2014-05-20T22:39:43Z",
138
+ "updated_at": "2014-07-01T17:21:25Z",
139
+ "pushed_at": "2014-07-25T16:37:42Z",
140
+ "git_url": "git://github.com/baxterthehacker/public-repo.git",
141
+ "ssh_url": "git@github.com:baxterthehacker/public-repo.git",
142
+ "clone_url": "https://github.com/baxterthehacker/public-repo.git",
143
+ "svn_url": "https://github.com/baxterthehacker/public-repo",
144
+ "homepage": null,
145
+ "size": 612,
146
+ "stargazers_count": 0,
147
+ "watchers_count": 0,
148
+ "language": null,
149
+ "has_issues": true,
150
+ "has_downloads": true,
151
+ "has_wiki": true,
152
+ "forks_count": 0,
153
+ "mirror_url": null,
154
+ "open_issues_count": 25,
155
+ "forks": 0,
156
+ "open_issues": 25,
157
+ "watchers": 0,
158
+ "default_branch": "master"
159
+ }
160
+ },
161
+ "base": {
162
+ "label": "baxterthehacker:master",
163
+ "ref": "master",
164
+ "sha": "69a8b72e2d3d955075d47f03d902929dcaf74033",
165
+ "user": {
166
+ "login": "baxterthehacker",
167
+ "id": 6752317,
168
+ "avatar_url": "https://avatars.githubusercontent.com/u/6752317?",
169
+ "gravatar_id": "258ae60b5512c8402b93673b7478d9c6",
170
+ "url": "https://api.github.com/users/baxterthehacker",
171
+ "html_url": "https://github.com/baxterthehacker",
172
+ "followers_url": "https://api.github.com/users/baxterthehacker/followers",
173
+ "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
174
+ "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
175
+ "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
176
+ "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
177
+ "organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
178
+ "repos_url": "https://api.github.com/users/baxterthehacker/repos",
179
+ "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
180
+ "received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
181
+ "type": "User",
182
+ "site_admin": false
183
+ },
184
+ "repo": {
185
+ "id": 20000106,
186
+ "name": "public-repo",
187
+ "full_name": "baxterthehacker/public-repo",
188
+ "owner": {
189
+ "login": "baxterthehacker",
190
+ "id": 6752317,
191
+ "avatar_url": "https://avatars.githubusercontent.com/u/6752317?",
192
+ "gravatar_id": "258ae60b5512c8402b93673b7478d9c6",
193
+ "url": "https://api.github.com/users/baxterthehacker",
194
+ "html_url": "https://github.com/baxterthehacker",
195
+ "followers_url": "https://api.github.com/users/baxterthehacker/followers",
196
+ "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
197
+ "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
198
+ "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
199
+ "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
200
+ "organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
201
+ "repos_url": "https://api.github.com/users/baxterthehacker/repos",
202
+ "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
203
+ "received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
204
+ "type": "User",
205
+ "site_admin": false
206
+ },
207
+ "private": false,
208
+ "html_url": "https://github.com/baxterthehacker/public-repo",
209
+ "description": "",
210
+ "fork": false,
211
+ "url": "https://api.github.com/repos/baxterthehacker/public-repo",
212
+ "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks",
213
+ "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}",
214
+ "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}",
215
+ "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams",
216
+ "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks",
217
+ "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}",
218
+ "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events",
219
+ "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}",
220
+ "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}",
221
+ "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags",
222
+ "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}",
223
+ "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}",
224
+ "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}",
225
+ "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}",
226
+ "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}",
227
+ "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages",
228
+ "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers",
229
+ "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors",
230
+ "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers",
231
+ "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription",
232
+ "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}",
233
+ "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}",
234
+ "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}",
235
+ "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments/{number}",
236
+ "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}",
237
+ "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}",
238
+ "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges",
239
+ "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}",
240
+ "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads",
241
+ "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}",
242
+ "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}",
243
+ "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}",
244
+ "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}",
245
+ "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}",
246
+ "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}",
247
+ "created_at": "2014-05-20T22:39:43Z",
248
+ "updated_at": "2014-07-01T17:21:25Z",
249
+ "pushed_at": "2014-07-25T16:37:42Z",
250
+ "git_url": "git://github.com/baxterthehacker/public-repo.git",
251
+ "ssh_url": "git@github.com:baxterthehacker/public-repo.git",
252
+ "clone_url": "https://github.com/baxterthehacker/public-repo.git",
253
+ "svn_url": "https://github.com/baxterthehacker/public-repo",
254
+ "homepage": null,
255
+ "size": 612,
256
+ "stargazers_count": 0,
257
+ "watchers_count": 0,
258
+ "language": null,
259
+ "has_issues": true,
260
+ "has_downloads": true,
261
+ "has_wiki": true,
262
+ "forks_count": 0,
263
+ "mirror_url": null,
264
+ "open_issues_count": 25,
265
+ "forks": 0,
266
+ "open_issues": 25,
267
+ "watchers": 0,
268
+ "default_branch": "master"
269
+ }
270
+ },
271
+ "_links": {
272
+ "self": {
273
+ "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/48"
274
+ },
275
+ "html": {
276
+ "href": "https://github.com/baxterthehacker/public-repo/pull/48"
277
+ },
278
+ "issue": {
279
+ "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/48"
280
+ },
281
+ "comments": {
282
+ "href": "https://api.github.com/repos/baxterthehacker/public-repo/issues/48/comments"
283
+ },
284
+ "review_comments": {
285
+ "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/48/comments"
286
+ },
287
+ "review_comment": {
288
+ "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments/{number}"
289
+ },
290
+ "commits": {
291
+ "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/48/commits"
292
+ },
293
+ "statuses": {
294
+ "href": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/05c588ba8cd510ecbe112d020f215facb17817a6"
295
+ }
296
+ },
297
+ "merged": false,
298
+ "mergeable": null,
299
+ "mergeable_state": "unknown",
300
+ "merged_by": null,
301
+ "comments": 0,
302
+ "review_comments": 1,
303
+ "commits": 1,
304
+ "additions": 2,
305
+ "deletions": 0,
306
+ "changed_files": 1
307
+ },
308
+ "repository": {
309
+ "id": 20000106,
310
+ "name": "public-repo",
311
+ "full_name": "baxterthehacker/public-repo",
312
+ "owner": {
313
+ "login": "baxterthehacker",
314
+ "id": 6752317,
315
+ "avatar_url": "https://avatars.githubusercontent.com/u/6752317?",
316
+ "gravatar_id": "258ae60b5512c8402b93673b7478d9c6",
317
+ "url": "https://api.github.com/users/baxterthehacker",
318
+ "html_url": "https://github.com/baxterthehacker",
319
+ "followers_url": "https://api.github.com/users/baxterthehacker/followers",
320
+ "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
321
+ "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
322
+ "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
323
+ "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
324
+ "organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
325
+ "repos_url": "https://api.github.com/users/baxterthehacker/repos",
326
+ "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
327
+ "received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
328
+ "type": "User",
329
+ "site_admin": false
330
+ },
331
+ "private": false,
332
+ "html_url": "https://github.com/baxterthehacker/public-repo",
333
+ "description": "",
334
+ "fork": false,
335
+ "url": "https://api.github.com/repos/baxterthehacker/public-repo",
336
+ "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks",
337
+ "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}",
338
+ "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}",
339
+ "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams",
340
+ "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks",
341
+ "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}",
342
+ "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events",
343
+ "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}",
344
+ "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}",
345
+ "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags",
346
+ "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}",
347
+ "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}",
348
+ "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}",
349
+ "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}",
350
+ "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}",
351
+ "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages",
352
+ "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers",
353
+ "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors",
354
+ "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers",
355
+ "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription",
356
+ "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}",
357
+ "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}",
358
+ "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}",
359
+ "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments/{number}",
360
+ "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}",
361
+ "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}",
362
+ "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges",
363
+ "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}",
364
+ "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads",
365
+ "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}",
366
+ "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}",
367
+ "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}",
368
+ "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}",
369
+ "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}",
370
+ "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}",
371
+ "created_at": "2014-05-20T22:39:43Z",
372
+ "updated_at": "2014-07-25T16:37:43Z",
373
+ "pushed_at": "2014-07-25T16:37:42Z",
374
+ "git_url": "git://github.com/baxterthehacker/public-repo.git",
375
+ "ssh_url": "git@github.com:baxterthehacker/public-repo.git",
376
+ "clone_url": "https://github.com/baxterthehacker/public-repo.git",
377
+ "svn_url": "https://github.com/baxterthehacker/public-repo",
378
+ "homepage": null,
379
+ "size": 612,
380
+ "stargazers_count": 0,
381
+ "watchers_count": 0,
382
+ "language": null,
383
+ "has_issues": true,
384
+ "has_downloads": true,
385
+ "has_wiki": true,
386
+ "forks_count": 1,
387
+ "mirror_url": null,
388
+ "open_issues_count": 25,
389
+ "forks": 1,
390
+ "open_issues": 25,
391
+ "watchers": 0,
392
+ "default_branch": "master"
393
+ },
394
+ "sender": {
395
+ "login": "baxterthehacker",
396
+ "id": 6752317,
397
+ "avatar_url": "https://avatars.githubusercontent.com/u/6752317?",
398
+ "gravatar_id": "258ae60b5512c8402b93673b7478d9c6",
399
+ "url": "https://api.github.com/users/baxterthehacker",
400
+ "html_url": "https://github.com/baxterthehacker",
401
+ "followers_url": "https://api.github.com/users/baxterthehacker/followers",
402
+ "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
403
+ "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
404
+ "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
405
+ "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
406
+ "organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
407
+ "repos_url": "https://api.github.com/users/baxterthehacker/repos",
408
+ "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
409
+ "received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
410
+ "type": "User",
411
+ "site_admin": false
412
+ }
413
+ }
@@ -1,50 +1,6 @@
1
1
  {
2
- "action": "created",
3
- "comment": {
4
- "url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments/15410670",
5
- "id": 15410670,
6
- "diff_hunk": "@@ -1,2 +1,4 @@\n public-repo",
7
- "path": "README.md",
8
- "position": 1,
9
- "original_position": 1,
10
- "commit_id": "05c588ba8cd510ecbe112d020f215facb17817a6",
11
- "original_commit_id": "05c588ba8cd510ecbe112d020f215facb17817a6",
12
- "user": {
13
- "login": "baxterthehacker",
14
- "id": 6752317,
15
- "avatar_url": "https://avatars.githubusercontent.com/u/6752317?",
16
- "gravatar_id": "258ae60b5512c8402b93673b7478d9c6",
17
- "url": "https://api.github.com/users/baxterthehacker",
18
- "html_url": "https://github.com/baxterthehacker",
19
- "followers_url": "https://api.github.com/users/baxterthehacker/followers",
20
- "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
21
- "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
22
- "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
23
- "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
24
- "organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
25
- "repos_url": "https://api.github.com/users/baxterthehacker/repos",
26
- "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
27
- "received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
28
- "type": "User",
29
- "site_admin": false
30
- },
31
- "body": "Maybe you should use more emojji on this line.",
32
- "created_at": "2014-07-25T16:37:42Z",
33
- "updated_at": "2014-07-25T16:37:42Z",
34
- "html_url": "https://github.com/baxterthehacker/public-repo/pull/48#discussion_r15410670",
35
- "pull_request_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/48",
36
- "_links": {
37
- "self": {
38
- "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/comments/15410670"
39
- },
40
- "html": {
41
- "href": "https://github.com/baxterthehacker/public-repo/pull/48#discussion_r15410670"
42
- },
43
- "pull_request": {
44
- "href": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/48"
45
- }
46
- }
47
- },
2
+ "action": "opened",
3
+ "number": 48,
48
4
  "pull_request": {
49
5
  "url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/48",
50
6
  "id": 18905849,
@@ -79,7 +35,7 @@
79
35
  "updated_at": "2014-07-25T16:37:42Z",
80
36
  "closed_at": null,
81
37
  "merged_at": null,
82
- "merge_commit_sha": "854a8c117c8ed88ef1e87f33051720615956cad6",
38
+ "merge_commit_sha": null,
83
39
  "assignee": null,
84
40
  "milestone": null,
85
41
  "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls/48/commits",
@@ -174,7 +130,7 @@
174
130
  "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}",
175
131
  "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}",
176
132
  "created_at": "2014-05-20T22:39:43Z",
177
- "updated_at": "2014-07-25T16:37:43Z",
133
+ "updated_at": "2014-07-01T17:21:25Z",
178
134
  "pushed_at": "2014-07-25T16:37:42Z",
179
135
  "git_url": "git://github.com/baxterthehacker/public-repo.git",
180
136
  "ssh_url": "git@github.com:baxterthehacker/public-repo.git",
@@ -182,8 +138,8 @@
182
138
  "svn_url": "https://github.com/baxterthehacker/public-repo",
183
139
  "homepage": null,
184
140
  "size": 612,
185
- "stargazers_count": 1,
186
- "watchers_count": 1,
141
+ "stargazers_count": 0,
142
+ "watchers_count": 0,
187
143
  "language": null,
188
144
  "has_issues": true,
189
145
  "has_downloads": true,
@@ -193,7 +149,7 @@
193
149
  "open_issues_count": 25,
194
150
  "forks": 0,
195
151
  "open_issues": 25,
196
- "watchers": 1,
152
+ "watchers": 0,
197
153
  "default_branch": "master"
198
154
  }
199
155
  },
@@ -284,7 +240,7 @@
284
240
  "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}",
285
241
  "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}",
286
242
  "created_at": "2014-05-20T22:39:43Z",
287
- "updated_at": "2014-07-25T16:37:43Z",
243
+ "updated_at": "2014-07-01T17:21:25Z",
288
244
  "pushed_at": "2014-07-25T16:37:42Z",
289
245
  "git_url": "git://github.com/baxterthehacker/public-repo.git",
290
246
  "ssh_url": "git@github.com:baxterthehacker/public-repo.git",
@@ -292,8 +248,8 @@
292
248
  "svn_url": "https://github.com/baxterthehacker/public-repo",
293
249
  "homepage": null,
294
250
  "size": 612,
295
- "stargazers_count": 1,
296
- "watchers_count": 1,
251
+ "stargazers_count": 0,
252
+ "watchers_count": 0,
297
253
  "language": null,
298
254
  "has_issues": true,
299
255
  "has_downloads": true,
@@ -303,7 +259,7 @@
303
259
  "open_issues_count": 25,
304
260
  "forks": 0,
305
261
  "open_issues": 25,
306
- "watchers": 1,
262
+ "watchers": 0,
307
263
  "default_branch": "master"
308
264
  }
309
265
  },
@@ -332,7 +288,17 @@
332
288
  "statuses": {
333
289
  "href": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/05c588ba8cd510ecbe112d020f215facb17817a6"
334
290
  }
335
- }
291
+ },
292
+ "merged": false,
293
+ "mergeable": null,
294
+ "mergeable_state": "unknown",
295
+ "merged_by": null,
296
+ "comments": 0,
297
+ "review_comments": 1,
298
+ "commits": 1,
299
+ "additions": 2,
300
+ "deletions": 0,
301
+ "changed_files": 1
336
302
  },
337
303
  "repository": {
338
304
  "id": 20000106,
@@ -4,9 +4,9 @@ describe Lita::Handlers::GithubPrList, lita_handler: true do
4
4
  Lita.config.handlers.github_pr_list.github_access_token = 'wafflesausages111111'
5
5
  end
6
6
 
7
- let(:pull_request_review_comment) { File.read("spec/fixtures/pull_request_review_comment.json") }
8
- let(:edit_comment_response_content) { [File.read("spec/fixtures/edit_comment.json")] }
9
- let(:edit_comment_response) { Rack::Response.new(edit_comment_response_content, 200, { 'Content-Type' => 'json' }) }
7
+ let(:pull_request_edit_comment) { File.read("spec/fixtures/pull_request_edit_comment.json") }
8
+ let(:pull_request_response) { [File.read("spec/fixtures/edit_comment.json")] }
9
+ let(:edit_pull_request_response) { Rack::Response.new(pull_request_response, 200, { 'Content-Type' => 'json' }) }
10
10
  let(:check_list) do
11
11
  "- [ ] Change log
12
12
  - [ ] Demo page
@@ -18,12 +18,12 @@ describe Lita::Handlers::GithubPrList, lita_handler: true do
18
18
  it { routes_http(:post, "/check_list").to(:check_list) }
19
19
 
20
20
  it "mentions the github user in the room and tell them the check list was added to the pull request" do
21
- allow_any_instance_of(Octokit::Client).to receive(:update_comment).and_return(edit_comment_response)
21
+ allow_any_instance_of(Octokit::Client).to receive(:update_pull_request).and_return(edit_pull_request_response)
22
22
  request = Rack::Request.new("rack.input" => StringIO.new(pull_request_review_comment))
23
23
  response = Rack::Response.new(['Hello'], 200, {'Content-Type' => 'text/plain'})
24
24
 
25
25
  github_handler = Lita::Handlers::GithubPrList.new
26
26
  github_handler.check_list(request, response)
27
- expect(edit_comment_response.body.first).to include(check_list)
27
+ expect(edit_pull_request_response.body.first).to include(check_list)
28
28
  end
29
29
  end
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.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael van den Beuken
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2014-08-13 00:00:00.000000000 Z
16
+ date: 2014-08-14 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: lita
@@ -161,7 +161,7 @@ files:
161
161
  - lib/lita/github_pr_list/web_hook.rb
162
162
  - lib/lita/handlers/github_pr_list.rb
163
163
  - lita-github_pr_list.gemspec
164
- - spec/fixtures/edit_comment.json
164
+ - spec/fixtures/edit_pull_request.json
165
165
  - spec/fixtures/issue_comment_event_failed.json
166
166
  - spec/fixtures/issue_comment_event_fixed.json
167
167
  - spec/fixtures/issue_comment_event_in_review.json
@@ -172,7 +172,7 @@ files:
172
172
  - spec/fixtures/issue_comments_new.json
173
173
  - spec/fixtures/issue_comments_passed.json
174
174
  - spec/fixtures/one_org_issue_list.json
175
- - spec/fixtures/pull_request_review_comment.json
175
+ - spec/fixtures/pull_request_edit_comment.json
176
176
  - spec/fixtures/repository_hooks.json
177
177
  - spec/fixtures/repository_list.json
178
178
  - spec/fixtures/two_org_issue_list.json
@@ -208,7 +208,7 @@ signing_key:
208
208
  specification_version: 4
209
209
  summary: List open pull requests for an organization.
210
210
  test_files:
211
- - spec/fixtures/edit_comment.json
211
+ - spec/fixtures/edit_pull_request.json
212
212
  - spec/fixtures/issue_comment_event_failed.json
213
213
  - spec/fixtures/issue_comment_event_fixed.json
214
214
  - spec/fixtures/issue_comment_event_in_review.json
@@ -219,7 +219,7 @@ test_files:
219
219
  - spec/fixtures/issue_comments_new.json
220
220
  - spec/fixtures/issue_comments_passed.json
221
221
  - spec/fixtures/one_org_issue_list.json
222
- - spec/fixtures/pull_request_review_comment.json
222
+ - spec/fixtures/pull_request_edit_comment.json
223
223
  - spec/fixtures/repository_hooks.json
224
224
  - spec/fixtures/repository_list.json
225
225
  - spec/fixtures/two_org_issue_list.json
@@ -1,49 +0,0 @@
1
- {
2
- "url": "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1",
3
- "id": 1,
4
- "diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
5
- "path": "file1.txt",
6
- "position": 1,
7
- "original_position": 4,
8
- "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
9
- "original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
10
- "user": {
11
- "login": "octocat",
12
- "id": 1,
13
- "avatar_url": "https://github.com/images/error/octocat_happy.gif",
14
- "gravatar_id": "somehexcode",
15
- "url": "https://api.github.com/users/octocat",
16
- "html_url": "https://github.com/octocat",
17
- "followers_url": "https://api.github.com/users/octocat/followers",
18
- "following_url": "https://api.github.com/users/octocat/following{/other_user}",
19
- "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
20
- "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
21
- "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
22
- "organizations_url": "https://api.github.com/users/octocat/orgs",
23
- "repos_url": "https://api.github.com/users/octocat/repos",
24
- "events_url": "https://api.github.com/users/octocat/events{/privacy}",
25
- "received_events_url": "https://api.github.com/users/octocat/received_events",
26
- "type": "User",
27
- "site_admin": false
28
- },
29
- "body": "Great stuff - [ ] Change log
30
- - [ ] Demo page
31
- - [ ] Product owner signoff
32
- - [ ] Merge into master
33
- - [ ] Deploy to production",
34
- "created_at": "2011-04-14T16:00:49Z",
35
- "updated_at": "2011-04-14T16:00:49Z",
36
- "html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
37
- "pull_request_url": "https://api.github.com/repos/octocat/Hello-World/pulls/1",
38
- "_links": {
39
- "self": {
40
- "href": "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1"
41
- },
42
- "html": {
43
- "href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
44
- },
45
- "pull_request": {
46
- "href": "https://api.github.com/repos/octocat/Hello-World/pulls/1"
47
- }
48
- }
49
- }