lita-github_pr_list 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c755fb8dd6f5653f1aba859150becb3ad320a72a
4
- data.tar.gz: ecc29c76d27e7c13bfa767bb4c800a17eca717a9
3
+ metadata.gz: dd78448cd040baecf3281fbc29eee9b1293e8438
4
+ data.tar.gz: 845c8780bf8a6016a268df094ba25942280b0555
5
5
  SHA512:
6
- metadata.gz: 7608e8723fbfbeeef2eff66a60aad67744c418f2b6436dad58ec9a28ba698e9e8a8b639f7cf2104f45321a31142c01e763581df6f5f9c9b2437e14b446cac1e7
7
- data.tar.gz: 242ae2f5b1d84a5b7f17d254923d79c4fcf227a6bdbeef231c6801a1434a1c044b5ee7aacd86ea61cf79b5652e57b514a6375f6fa1b54ad45236600840aa5a6c
6
+ metadata.gz: 098ea2078b2692d9c4a1825514a42871ac7e787750ea3a32886f3359a8fdb57950018fcd012f85c0cad18f51e62ddc3bb11cdd5c19a06babaf1162aaf0ba0d5e
7
+ data.tar.gz: 268dd782ba73ac9c135eea584f3ce2ac840fefa1bacee8560a9bb0ac4ccca0ca3568283efab1171ae38eeed909df6af43e4ad0bf1d1e6c1d145d97c45d4a1aa9
@@ -3,14 +3,14 @@ module Lita
3
3
  class Status
4
4
  attr_accessor :comment, :base, :dev, :design, :status
5
5
 
6
- DESIGN_REVIEW_REGEX = /:art:/
7
- DEV_REVIEW_REGEX = /:elephant:/
8
- PASS_DEV_REGEX = /:elephant:\s?:elephant:\s?:elephant:/
9
- PASS_DESIGN_REGEX = /:art:\s?:art:\s?:art:/
10
- REVIEW_REGEX = /:book:/
11
- FAIL_REGEX = /:poop:|:hankey:/
12
- FIXED_REGEX = /:wave:/
13
- NEW_REGEX = /:new:/
6
+ DESIGN_REVIEW_REGEX = /:art:|🎨 /
7
+ DEV_REVIEW_REGEX = /:elephant:|🐘 /
8
+ PASS_DEV_REGEX = /:elephant:\s?:elephant:\s?:elephant:|🐘 \s?🐘 \s?🐘 /
9
+ PASS_DESIGN_REGEX = /:art:\s?:art:\s?:art:|🎨 \s?🎨 \s?🎨 /
10
+ REVIEW_REGEX = /:book:|📖 /
11
+ FAIL_REGEX = /:poop:|:hankey:|💩 /
12
+ FIXED_REGEX = /:wave:|👋 /
13
+ NEW_REGEX = /:new:|🆕 /
14
14
 
15
15
  DESIGN_REVIEW_REQUIRED = "(art)"
16
16
  DEV_REVIEW_REQUIRED = "(elephant)"
@@ -1,5 +1,5 @@
1
1
  module Lita
2
2
  module GithubPrList
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -0,0 +1,180 @@
1
+ {
2
+ "action": "created",
3
+ "issue": {
4
+ "url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/47",
5
+ "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/47/labels{/name}",
6
+ "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/47/comments",
7
+ "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/47/events",
8
+ "html_url": "https://github.com/baxterthehacker/public-repo/issues/47",
9
+ "id": 36913817,
10
+ "number": 47,
11
+ "title": "Spelling error in the README file",
12
+ "user": {
13
+ "login": "mcwaffle1234",
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
+ "labels": [
32
+ {
33
+ "url": "https://api.github.com/repos/baxterthehacker/public-repo/labels/bug",
34
+ "name": "bug",
35
+ "color": "fc2929"
36
+ }
37
+ ],
38
+ "state": "open",
39
+ "assignee": null,
40
+ "milestone": null,
41
+ "comments": 1,
42
+ "created_at": "2014-07-01T17:21:15Z",
43
+ "updated_at": "2014-07-01T17:21:15Z",
44
+ "closed_at": null,
45
+ "body": "It looks like you accidently spelled 'commit' with two 't's."
46
+ },
47
+ "comment": {
48
+ "url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments/47684681",
49
+ "html_url": "https://github.com/baxterthehacker/public-repo/issues/47#issuecomment-47684681",
50
+ "issue_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/47",
51
+ "id": 47684681,
52
+ "user": {
53
+ "login": "baxterthehacker",
54
+ "id": 6752317,
55
+ "avatar_url": "https://avatars.githubusercontent.com/u/6752317?",
56
+ "gravatar_id": "258ae60b5512c8402b93673b7478d9c6",
57
+ "url": "https://api.github.com/users/baxterthehacker",
58
+ "html_url": "https://github.com/baxterthehacker",
59
+ "followers_url": "https://api.github.com/users/baxterthehacker/followers",
60
+ "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
61
+ "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
62
+ "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
63
+ "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
64
+ "organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
65
+ "repos_url": "https://api.github.com/users/baxterthehacker/repos",
66
+ "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
67
+ "received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
68
+ "type": "User",
69
+ "site_admin": false
70
+ },
71
+ "created_at": "2014-07-01T17:21:15Z",
72
+ "updated_at": "2014-07-01T17:21:15Z",
73
+ "body": "Passed 🐘 🐘 🐘 "
74
+ },
75
+ "repository": {
76
+ "id": 20000106,
77
+ "name": "public-repo",
78
+ "full_name": "baxterthehacker/public-repo",
79
+ "owner": {
80
+ "login": "baxterthehacker",
81
+ "id": 6752317,
82
+ "avatar_url": "https://avatars.githubusercontent.com/u/6752317?",
83
+ "gravatar_id": "258ae60b5512c8402b93673b7478d9c6",
84
+ "url": "https://api.github.com/users/baxterthehacker",
85
+ "html_url": "https://github.com/baxterthehacker",
86
+ "followers_url": "https://api.github.com/users/baxterthehacker/followers",
87
+ "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
88
+ "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
89
+ "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
90
+ "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
91
+ "organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
92
+ "repos_url": "https://api.github.com/users/baxterthehacker/repos",
93
+ "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
94
+ "received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
95
+ "type": "User",
96
+ "site_admin": false
97
+ },
98
+ "private": false,
99
+ "html_url": "https://github.com/baxterthehacker/public-repo",
100
+ "description": "",
101
+ "fork": false,
102
+ "url": "https://api.github.com/repos/baxterthehacker/public-repo",
103
+ "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks",
104
+ "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}",
105
+ "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}",
106
+ "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams",
107
+ "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks",
108
+ "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}",
109
+ "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events",
110
+ "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}",
111
+ "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}",
112
+ "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags",
113
+ "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}",
114
+ "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}",
115
+ "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}",
116
+ "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}",
117
+ "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}",
118
+ "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages",
119
+ "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers",
120
+ "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors",
121
+ "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers",
122
+ "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription",
123
+ "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}",
124
+ "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}",
125
+ "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}",
126
+ "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments/{number}",
127
+ "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}",
128
+ "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}",
129
+ "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges",
130
+ "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}",
131
+ "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads",
132
+ "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}",
133
+ "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}",
134
+ "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}",
135
+ "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}",
136
+ "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}",
137
+ "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}",
138
+ "created_at": "2014-05-20T22:39:43Z",
139
+ "updated_at": "2014-07-01T17:17:43Z",
140
+ "pushed_at": "2014-07-01T17:21:15Z",
141
+ "git_url": "git://github.com/baxterthehacker/public-repo.git",
142
+ "ssh_url": "git@github.com:baxterthehacker/public-repo.git",
143
+ "clone_url": "https://github.com/baxterthehacker/public-repo.git",
144
+ "svn_url": "https://github.com/baxterthehacker/public-repo",
145
+ "homepage": null,
146
+ "size": 569,
147
+ "stargazers_count": 0,
148
+ "watchers_count": 0,
149
+ "language": null,
150
+ "has_issues": true,
151
+ "has_downloads": true,
152
+ "has_wiki": true,
153
+ "forks_count": 0,
154
+ "mirror_url": null,
155
+ "open_issues_count": 24,
156
+ "forks": 0,
157
+ "open_issues": 24,
158
+ "watchers": 0,
159
+ "default_branch": "master"
160
+ },
161
+ "sender": {
162
+ "login": "baxterthehacker",
163
+ "id": 6752317,
164
+ "avatar_url": "https://avatars.githubusercontent.com/u/6752317?",
165
+ "gravatar_id": "258ae60b5512c8402b93673b7478d9c6",
166
+ "url": "https://api.github.com/users/baxterthehacker",
167
+ "html_url": "https://github.com/baxterthehacker",
168
+ "followers_url": "https://api.github.com/users/baxterthehacker/followers",
169
+ "following_url": "https://api.github.com/users/baxterthehacker/following{/other_user}",
170
+ "gists_url": "https://api.github.com/users/baxterthehacker/gists{/gist_id}",
171
+ "starred_url": "https://api.github.com/users/baxterthehacker/starred{/owner}{/repo}",
172
+ "subscriptions_url": "https://api.github.com/users/baxterthehacker/subscriptions",
173
+ "organizations_url": "https://api.github.com/users/baxterthehacker/orgs",
174
+ "repos_url": "https://api.github.com/users/baxterthehacker/repos",
175
+ "events_url": "https://api.github.com/users/baxterthehacker/events{/privacy}",
176
+ "received_events_url": "https://api.github.com/users/baxterthehacker/received_events",
177
+ "type": "User",
178
+ "site_admin": false
179
+ }
180
+ }
@@ -31,6 +31,7 @@ describe Lita::Handlers::GithubPrList, lita_handler: true do
31
31
  end
32
32
 
33
33
  let(:issue_comment_event_passed) { File.read("spec/fixtures/issue_comment_event_passed.json") }
34
+ let(:issue_comment_event_passed_emoji) { File.read("spec/fixtures/issue_comment_event_passed_emoji.json") }
34
35
  let(:issue_comment_event_passed_design) { File.read("spec/fixtures/issue_comment_event_passed_design.json") }
35
36
  let(:issue_comment_event_failed) { File.read("spec/fixtures/issue_comment_event_failed.json") }
36
37
  let(:issue_comment_event_failed_hankey) { File.read("spec/fixtures/issue_comment_event_failed_hankey.json") }
@@ -48,18 +49,36 @@ describe Lita::Handlers::GithubPrList, lita_handler: true do
48
49
 
49
50
  it { is_expected.to route_http(:post, "/comment_hook").to(:comment_hook) }
50
51
 
51
- it "mentions the github user in the room and tell them they passed , but they need design review" do
52
- expect_any_instance_of(Octokit::Client).to receive(:issue_comments).and_return(issue_comments_passed)
52
+ context "comment made with text" do
53
+ it "mentions the github user in the room and tell them they passed , but they need design review" do
54
+ expect_any_instance_of(Octokit::Client).to receive(:issue_comments).and_return(issue_comments_passed)
53
55
 
54
- request = Rack::Request.new("rack.input" => StringIO.new(issue_comment_event_passed))
55
- response = Rack::Response.new(['Hello'], 200, { 'Content-Type' => 'text/plain' })
56
+ request = Rack::Request.new("rack.input" => StringIO.new(issue_comment_event_passed))
57
+ response = Rack::Response.new(['Hello'], 200, { 'Content-Type' => 'text/plain' })
56
58
 
57
- github_handler = Lita::Handlers::GithubPrList.new robot
58
- github_handler.comment_hook(request, response)
59
+ github_handler = Lita::Handlers::GithubPrList.new robot
60
+ github_handler.comment_hook(request, response)
59
61
 
60
- expect(replies.last).to include("@mcwaffle1234 your pull request: Spelling error in the README file has passed DEV REVIEW."\
61
- " https://github.com/baxterthehacker/public-repo/issues/47"\
62
- " - You still require DESIGN REVIEW")
62
+ expect(replies.last).to include("@mcwaffle1234 your pull request: Spelling error in the README file has passed DEV REVIEW."\
63
+ " https://github.com/baxterthehacker/public-repo/issues/47"\
64
+ " - You still require DESIGN REVIEW")
65
+ end
66
+ end
67
+
68
+ context "comment made with emojis" do
69
+ it "mentions the github user in the room and tell them they passed , but they need design review" do
70
+ expect_any_instance_of(Octokit::Client).to receive(:issue_comments).and_return(issue_comments_passed)
71
+
72
+ request = Rack::Request.new("rack.input" => StringIO.new(issue_comment_event_passed_emoji))
73
+ response = Rack::Response.new(['Hello'], 200, { 'Content-Type' => 'text/plain' })
74
+
75
+ github_handler = Lita::Handlers::GithubPrList.new robot
76
+ github_handler.comment_hook(request, response)
77
+
78
+ expect(replies.last).to include("@mcwaffle1234 your pull request: Spelling error in the README file has passed DEV REVIEW."\
79
+ " https://github.com/baxterthehacker/public-repo/issues/47"\
80
+ " - You still require DESIGN REVIEW")
81
+ end
63
82
  end
64
83
 
65
84
  it "mentions the github user in the room and tell them they passed DESIGN" 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.2.0
4
+ version: 0.2.1
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: 2016-04-08 00:00:00.000000000 Z
18
+ date: 2016-04-18 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: lita
@@ -185,6 +185,7 @@ files:
185
185
  - spec/fixtures/issue_comment_event_no_event.json
186
186
  - spec/fixtures/issue_comment_event_passed.json
187
187
  - spec/fixtures/issue_comment_event_passed_design.json
188
+ - spec/fixtures/issue_comment_event_passed_emoji.json
188
189
  - spec/fixtures/issue_comments_failed.json
189
190
  - spec/fixtures/issue_comments_fixed.json
190
191
  - spec/fixtures/issue_comments_in_review.json
@@ -229,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
230
  version: '0'
230
231
  requirements: []
231
232
  rubyforge_project:
232
- rubygems_version: 2.2.0
233
+ rubygems_version: 2.6.3
233
234
  signing_key:
234
235
  specification_version: 4
235
236
  summary: List open pull requests for an organization.
@@ -251,6 +252,7 @@ test_files:
251
252
  - spec/fixtures/issue_comment_event_no_event.json
252
253
  - spec/fixtures/issue_comment_event_passed.json
253
254
  - spec/fixtures/issue_comment_event_passed_design.json
255
+ - spec/fixtures/issue_comment_event_passed_emoji.json
254
256
  - spec/fixtures/issue_comments_failed.json
255
257
  - spec/fixtures/issue_comments_fixed.json
256
258
  - spec/fixtures/issue_comments_in_review.json