octogate 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +101 -5
- data/lib/octogate/client.rb +9 -8
- data/lib/octogate/events.rb +3 -0
- data/lib/octogate/events/issue.rb +20 -0
- data/lib/octogate/events/issue_comment.rb +21 -0
- data/lib/octogate/events/pull_request_review_comment.rb +20 -0
- data/lib/octogate/gh.rb +8 -4
- data/lib/octogate/gh/issue.rb +15 -0
- data/lib/octogate/gh/issue_comment.rb +7 -0
- data/lib/octogate/gh/label.rb +4 -0
- data/lib/octogate/gh/review_comment.rb +7 -0
- data/lib/octogate/version.rb +1 -1
- data/octogate.gemspec +1 -0
- data/spec/config_sample.rb +1 -1
- data/spec/issue_comment_payload.json +204 -0
- data/spec/issues_payload.json +158 -0
- data/spec/lib/octogate/client_spec.rb +1 -1
- data/spec/lib/octogate/events/issue_comment_spec.rb +22 -0
- data/spec/lib/octogate/events/issue_spec.rb +20 -0
- data/spec/lib/octogate/events/pull_request_review_comment_spec.rb +20 -0
- data/spec/lib/octogate/events/pull_request_spec.rb +6 -0
- data/spec/lib/octogate/events/push_spec.rb +6 -0
- data/spec/pull_request_review_comment_payload.json +153 -0
- data/spec/spec_helper.rb +3 -0
- metadata +35 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a893f768570f7934db01a2314d6467c7cd3f930a
|
4
|
+
data.tar.gz: d9861197a5ceac6cb8b3916ce5d69ace77d80e18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f991d9e3c4f8fc28662af108b296a5c3fdd3b3f45b79fd010ede2aa65f66879f2c401998ce1e331b5358618e6a4fc851e0cbfa533c9f833610da5d15e914316
|
7
|
+
data.tar.gz: e40e81224d97c31f4410888b5b2d6511a9af023736c51d2e776670e13b6fd63580be3e6d0746a3964847e17124718574dd971de4368b2a46a96d73aea2bccecb
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/octogate.png)](http://badge.fury.io/rb/octogate)
|
3
3
|
[![Build Status](https://travis-ci.org/joker1007/octogate.png?branch=master)](https://travis-ci.org/joker1007/octogate)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/joker1007/octogate.png)](https://codeclimate.com/github/joker1007/octogate)
|
5
|
+
[![Coverage Status](https://coveralls.io/repos/joker1007/octogate/badge.png)](https://coveralls.io/r/joker1007/octogate)
|
5
6
|
|
6
7
|
Github hook proxy server of Sinatra Framework.
|
7
8
|
|
@@ -25,6 +26,14 @@ Or install it yourself as:
|
|
25
26
|
|
26
27
|
- Ruby-2.0.0 or later
|
27
28
|
|
29
|
+
## Event Capability
|
30
|
+
|
31
|
+
- Push Event
|
32
|
+
- PullRequest Event
|
33
|
+
- PullRequest Review Comment Event
|
34
|
+
- Issues Event
|
35
|
+
- Issue Comment Event
|
36
|
+
|
28
37
|
## Usage
|
29
38
|
|
30
39
|
Write config.rb.
|
@@ -33,7 +42,7 @@ Write config.rb.
|
|
33
42
|
token "token_string"
|
34
43
|
|
35
44
|
target "jenkins" do
|
36
|
-
hook_type [:push
|
45
|
+
hook_type [:push]
|
37
46
|
url "http://targethost.dev/job/JobName"
|
38
47
|
http_method :post
|
39
48
|
|
@@ -44,6 +53,8 @@ target "jenkins" do
|
|
44
53
|
event.ref =~ /master/
|
45
54
|
}
|
46
55
|
end
|
56
|
+
# if event type is push and event.ref contains "master",
|
57
|
+
# octogate requests "http://targethost.dev/job/JobName" via POST method, request body is {key1: "value1, key2: "value2"} params
|
47
58
|
|
48
59
|
target "json_params" do
|
49
60
|
hook_type [:push, :pull_request]
|
@@ -54,9 +65,17 @@ target "json_params" do
|
|
54
65
|
params key1: "value1", key2: "value2"
|
55
66
|
|
56
67
|
match ->(event) {
|
57
|
-
event
|
68
|
+
case event
|
69
|
+
when Octogate::Event::PullRequest
|
70
|
+
event.try(:pull_request).try(:head).try(:ref) =~ /json_params/
|
71
|
+
when Octogate::Event::Push
|
72
|
+
event.ref =~ /json_params/
|
73
|
+
end
|
58
74
|
}
|
59
75
|
end
|
76
|
+
# if event type is push or pull_request, and ref name contains "json_params",
|
77
|
+
# octogate requests "http://targethost.dev/job/JobName" via POST method, body is {key1: "value1, key2: "value2"} as JSON FORMAT
|
78
|
+
|
60
79
|
```
|
61
80
|
|
62
81
|
More sample is [hear](https://github.com/joker1007/octogate/blob/master/spec/config_sample.rb)
|
@@ -74,10 +93,87 @@ Usage: octogate [options]
|
|
74
93
|
# => Endpoint is http://hostname:4567/token_string
|
75
94
|
```
|
76
95
|
|
77
|
-
##
|
96
|
+
## Config DSL Reference
|
78
97
|
|
79
|
-
|
80
|
-
|
98
|
+
### Global definitions
|
99
|
+
| name | arg | description |
|
100
|
+
| ------- | -------- | ------------ |
|
101
|
+
| token | String | set token used as endpoint url. |
|
102
|
+
| ssl_verify | Boolean | if set false, make disable SSL verification. (if target uses self-signed certificate) |
|
103
|
+
| target | String and Block | String is target name. Block is target definition block. |
|
104
|
+
|
105
|
+
### Target definitions
|
106
|
+
| name | arg | description |
|
107
|
+
| ---------------- | ----------------- | ---------------------------------------------------------------------------------------------------- |
|
108
|
+
| hook_type | Array (value is event type) | set hook event (default = [:push]) |
|
109
|
+
| url | String | set destination URL |
|
110
|
+
| http_method | Symbol | set HTTP method when octogate request target. |
|
111
|
+
| parameter_type | :query or :json | :query = use form parameter or get query parameter, :json = serialize payload by json format (default = :query) |
|
112
|
+
| params | Hash or Proc | set payload parameters. if pass Proc instance, call with event instance and use result |
|
113
|
+
| match | Boolean or Proc | if this value is set, then transfer process is executed only when the evaluation result is truthy. |
|
114
|
+
| username | String | set Basic Auth username |
|
115
|
+
| password | String | set Basic Auth password |
|
116
|
+
|
117
|
+
### Event type
|
118
|
+
| name | class name |
|
119
|
+
| ------- | ------------------ |
|
120
|
+
| :push | Octogate::Event::Push |
|
121
|
+
| :pull_request | Octogate::Event::PullRequest |
|
122
|
+
| :pull_request_review_comment | Octogate::Event::PullRequestReviewComment |
|
123
|
+
| :issues | Octogate::Event::Issue |
|
124
|
+
| :issue_comment | Octogate::Event::IssueComment |
|
125
|
+
|
126
|
+
Event instance is Mash subclass. it has same data with the payload sent by GitHub Hook.
|
127
|
+
|
128
|
+
ref. [Event Types | GitHub API](https://developer.github.com/v3/activity/events/types/#pushevent "Event Types | GitHub API")
|
129
|
+
|
130
|
+
## Hosting on Heroku
|
131
|
+
|
132
|
+
Create directory and bundle init.
|
133
|
+
|
134
|
+
```sh
|
135
|
+
% mkdir your-app-dir
|
136
|
+
% cd your-app-dir
|
137
|
+
% bundle init
|
138
|
+
```
|
139
|
+
|
140
|
+
Write `Gemfile` and `bundle install`.
|
141
|
+
|
142
|
+
```ruby
|
143
|
+
gem "octogate"
|
144
|
+
gem "thin"
|
145
|
+
```
|
146
|
+
|
147
|
+
```sh
|
148
|
+
bundle install --path .bundle
|
149
|
+
```
|
150
|
+
|
151
|
+
Write `Procfile`
|
152
|
+
|
153
|
+
```
|
154
|
+
web: bundle exec octogate -c ./config.rb -p $PORT
|
155
|
+
```
|
156
|
+
|
157
|
+
Write config at `./config.rb`
|
158
|
+
|
159
|
+
```sh
|
160
|
+
% vim config.rb
|
161
|
+
```
|
162
|
+
|
163
|
+
Create git repository.
|
164
|
+
|
165
|
+
```sh
|
166
|
+
% git init .
|
167
|
+
% echo ".bundle" > .gitignore
|
168
|
+
% git commit -am "init"
|
169
|
+
```
|
170
|
+
|
171
|
+
Create Heroku app and push it.
|
172
|
+
|
173
|
+
```sh
|
174
|
+
% heroku create your-app-name
|
175
|
+
% git push heroku master
|
176
|
+
```
|
81
177
|
|
82
178
|
## Contributing
|
83
179
|
|
data/lib/octogate/client.rb
CHANGED
@@ -18,23 +18,24 @@ class Octogate::Client
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
def request(
|
22
|
-
uri = URI(
|
21
|
+
def request(target)
|
22
|
+
uri = URI(target.url)
|
23
23
|
|
24
|
-
options = {url:
|
24
|
+
options = {url: target.url}
|
25
25
|
options.merge!(ssl_options) if uri.scheme == "https"
|
26
26
|
|
27
|
-
conn = build_connection(options,
|
27
|
+
conn = build_connection(options, target.username, target.password)
|
28
28
|
|
29
|
-
params =
|
29
|
+
params = target.params.is_a?(Proc) ?
|
30
|
+
target.instance_exec(event, &target.params) : target.params
|
30
31
|
|
31
|
-
case
|
32
|
+
case target.http_method
|
32
33
|
when :get
|
33
34
|
Octogate::TransferRequest::GET.new(conn)
|
34
35
|
.do_request(url: uri.path, params: params)
|
35
36
|
when :post
|
36
37
|
Octogate::TransferRequest::POST.new(conn)
|
37
|
-
.do_request(url: uri.path, params: params, parameter_type:
|
38
|
+
.do_request(url: uri.path, params: params, parameter_type: target.parameter_type)
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
@@ -44,7 +45,7 @@ class Octogate::Client
|
|
44
45
|
condition = event.default_condition && target.include_event?(event)
|
45
46
|
case target.match
|
46
47
|
when Proc
|
47
|
-
condition && instance_exec(event, &target.match)
|
48
|
+
condition && target.instance_exec(event, &target.match)
|
48
49
|
when nil
|
49
50
|
condition
|
50
51
|
else
|
data/lib/octogate/events.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
require "octogate/events/base"
|
2
|
+
require "octogate/gh"
|
3
|
+
|
4
|
+
module Octogate
|
5
|
+
class Event::Issue < Event::Base
|
6
|
+
register_event :issues, self
|
7
|
+
|
8
|
+
coerce_key :issue, GH::Issue
|
9
|
+
coerce_key :repository, GH::Repository
|
10
|
+
coerce_key :sender, GH::User
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def parse(json)
|
14
|
+
payload = Oj.load(json).deep_symbolize_keys
|
15
|
+
|
16
|
+
new(payload)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require "octogate/events/base"
|
2
|
+
require "octogate/gh"
|
3
|
+
|
4
|
+
module Octogate
|
5
|
+
class Event::IssueComment < Event::Base
|
6
|
+
register_event :issue_comment, self
|
7
|
+
|
8
|
+
coerce_key :issue, GH::Issue
|
9
|
+
coerce_key :comment, GH::IssueComment
|
10
|
+
coerce_key :repository, GH::Repository
|
11
|
+
coerce_key :sender, GH::User
|
12
|
+
|
13
|
+
class << self
|
14
|
+
def parse(json)
|
15
|
+
payload = Oj.load(json).deep_symbolize_keys
|
16
|
+
|
17
|
+
new(payload)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "octogate/events/base"
|
2
|
+
require "octogate/gh"
|
3
|
+
|
4
|
+
module Octogate
|
5
|
+
class Event::PullRequestReviewComment < Event::Base
|
6
|
+
register_event :pull_request_review_comment, self
|
7
|
+
|
8
|
+
coerce_key :comment, GH::ReviewComment
|
9
|
+
coerce_key :repository, GH::Repository
|
10
|
+
coerce_key :sender, GH::User
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def parse(json)
|
14
|
+
payload = Oj.load(json).deep_symbolize_keys
|
15
|
+
|
16
|
+
new(payload)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/octogate/gh.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
module Octogate
|
2
2
|
module GH
|
3
|
-
autoload :Commit
|
4
|
-
autoload :Repository
|
5
|
-
autoload :User
|
6
|
-
autoload :PullRequest
|
3
|
+
autoload :Commit , "octogate/gh/commit"
|
4
|
+
autoload :Repository , "octogate/gh/repository"
|
5
|
+
autoload :User , "octogate/gh/user"
|
6
|
+
autoload :PullRequest , "octogate/gh/pull_request"
|
7
|
+
autoload :Issue , "octogate/gh/issue"
|
8
|
+
autoload :Label , "octogate/gh/label"
|
9
|
+
autoload :IssueComment , "octogate/gh/issue_comment"
|
10
|
+
autoload :ReviewComment, "octogate/gh/review_comment"
|
7
11
|
end
|
8
12
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "octogate/gh/user"
|
2
|
+
|
3
|
+
module Octogate
|
4
|
+
class GH::Issue < Model
|
5
|
+
coerce_key :user, GH::User
|
6
|
+
coerce_key :assignee, GH::User
|
7
|
+
|
8
|
+
def initialize(*args)
|
9
|
+
super
|
10
|
+
self.labels = labels.nil? ? [] : labels.map do |l|
|
11
|
+
GH::Label.new(l)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/octogate/version.rb
CHANGED
data/octogate.gemspec
CHANGED
data/spec/config_sample.rb
CHANGED
@@ -39,7 +39,7 @@ target "block params" do
|
|
39
39
|
http_method :post
|
40
40
|
|
41
41
|
parameter_type :query
|
42
|
-
params ->(event) { {ref: event.ref, head_commit_id: event.head_commit.id} }
|
42
|
+
params ->(event) { {ref: event.ref, head_commit_id: event.head_commit.id, method: http_method} }
|
43
43
|
|
44
44
|
match ->(event) {
|
45
45
|
event.ref =~ /block_parameters/
|
@@ -0,0 +1,204 @@
|
|
1
|
+
{
|
2
|
+
"action": "created",
|
3
|
+
"issue": {
|
4
|
+
"url": "https://api.github.com/repos/joker1007/octogate/issues/4",
|
5
|
+
"labels_url": "https://api.github.com/repos/joker1007/octogate/issues/4/labels{/name}",
|
6
|
+
"comments_url": "https://api.github.com/repos/joker1007/octogate/issues/4/comments",
|
7
|
+
"events_url": "https://api.github.com/repos/joker1007/octogate/issues/4/events",
|
8
|
+
"html_url": "https://github.com/joker1007/octogate/issues/4",
|
9
|
+
"id": 28599636,
|
10
|
+
"number": 4,
|
11
|
+
"title": "対応するイベントを増やす",
|
12
|
+
"user": {
|
13
|
+
"login": "joker1007",
|
14
|
+
"id": 116996,
|
15
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/116996",
|
16
|
+
"gravatar_id": "a5e5ee2fb9e4ce3c728ed9e3ef6e916f",
|
17
|
+
"url": "https://api.github.com/users/joker1007",
|
18
|
+
"html_url": "https://github.com/joker1007",
|
19
|
+
"followers_url": "https://api.github.com/users/joker1007/followers",
|
20
|
+
"following_url": "https://api.github.com/users/joker1007/following{/other_user}",
|
21
|
+
"gists_url": "https://api.github.com/users/joker1007/gists{/gist_id}",
|
22
|
+
"starred_url": "https://api.github.com/users/joker1007/starred{/owner}{/repo}",
|
23
|
+
"subscriptions_url": "https://api.github.com/users/joker1007/subscriptions",
|
24
|
+
"organizations_url": "https://api.github.com/users/joker1007/orgs",
|
25
|
+
"repos_url": "https://api.github.com/users/joker1007/repos",
|
26
|
+
"events_url": "https://api.github.com/users/joker1007/events{/privacy}",
|
27
|
+
"received_events_url": "https://api.github.com/users/joker1007/received_events",
|
28
|
+
"type": "User",
|
29
|
+
"site_admin": false
|
30
|
+
},
|
31
|
+
"labels": [
|
32
|
+
{
|
33
|
+
"url": "https://api.github.com/repos/joker1007/octogate/labels/in+progress",
|
34
|
+
"name": "in progress",
|
35
|
+
"color": "ededed"
|
36
|
+
}
|
37
|
+
],
|
38
|
+
"state": "open",
|
39
|
+
"assignee": {
|
40
|
+
"login": "joker1007",
|
41
|
+
"id": 116996,
|
42
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/116996",
|
43
|
+
"gravatar_id": "a5e5ee2fb9e4ce3c728ed9e3ef6e916f",
|
44
|
+
"url": "https://api.github.com/users/joker1007",
|
45
|
+
"html_url": "https://github.com/joker1007",
|
46
|
+
"followers_url": "https://api.github.com/users/joker1007/followers",
|
47
|
+
"following_url": "https://api.github.com/users/joker1007/following{/other_user}",
|
48
|
+
"gists_url": "https://api.github.com/users/joker1007/gists{/gist_id}",
|
49
|
+
"starred_url": "https://api.github.com/users/joker1007/starred{/owner}{/repo}",
|
50
|
+
"subscriptions_url": "https://api.github.com/users/joker1007/subscriptions",
|
51
|
+
"organizations_url": "https://api.github.com/users/joker1007/orgs",
|
52
|
+
"repos_url": "https://api.github.com/users/joker1007/repos",
|
53
|
+
"events_url": "https://api.github.com/users/joker1007/events{/privacy}",
|
54
|
+
"received_events_url": "https://api.github.com/users/joker1007/received_events",
|
55
|
+
"type": "User",
|
56
|
+
"site_admin": false
|
57
|
+
},
|
58
|
+
"milestone": null,
|
59
|
+
"comments": 1,
|
60
|
+
"created_at": "2014-03-03T05:19:53Z",
|
61
|
+
"updated_at": "2014-03-03T14:59:03Z",
|
62
|
+
"closed_at": null,
|
63
|
+
"pull_request": {
|
64
|
+
"html_url": null,
|
65
|
+
"diff_url": null,
|
66
|
+
"patch_url": null
|
67
|
+
},
|
68
|
+
"body": null
|
69
|
+
},
|
70
|
+
"comment": {
|
71
|
+
"url": "https://api.github.com/repos/joker1007/octogate/issues/comments/36517379",
|
72
|
+
"html_url": "https://github.com/joker1007/octogate/issues/4#issuecomment-36517379",
|
73
|
+
"issue_url": "https://api.github.com/repos/joker1007/octogate/issues/4",
|
74
|
+
"id": 36517379,
|
75
|
+
"user": {
|
76
|
+
"login": "joker1007",
|
77
|
+
"id": 116996,
|
78
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/116996",
|
79
|
+
"gravatar_id": "a5e5ee2fb9e4ce3c728ed9e3ef6e916f",
|
80
|
+
"url": "https://api.github.com/users/joker1007",
|
81
|
+
"html_url": "https://github.com/joker1007",
|
82
|
+
"followers_url": "https://api.github.com/users/joker1007/followers",
|
83
|
+
"following_url": "https://api.github.com/users/joker1007/following{/other_user}",
|
84
|
+
"gists_url": "https://api.github.com/users/joker1007/gists{/gist_id}",
|
85
|
+
"starred_url": "https://api.github.com/users/joker1007/starred{/owner}{/repo}",
|
86
|
+
"subscriptions_url": "https://api.github.com/users/joker1007/subscriptions",
|
87
|
+
"organizations_url": "https://api.github.com/users/joker1007/orgs",
|
88
|
+
"repos_url": "https://api.github.com/users/joker1007/repos",
|
89
|
+
"events_url": "https://api.github.com/users/joker1007/events{/privacy}",
|
90
|
+
"received_events_url": "https://api.github.com/users/joker1007/received_events",
|
91
|
+
"type": "User",
|
92
|
+
"site_admin": false
|
93
|
+
},
|
94
|
+
"created_at": "2014-03-03T14:59:03Z",
|
95
|
+
"updated_at": "2014-03-03T14:59:03Z",
|
96
|
+
"body": "IssueとIssue Commentを追加する。"
|
97
|
+
},
|
98
|
+
"repository": {
|
99
|
+
"id": 17311500,
|
100
|
+
"name": "octogate",
|
101
|
+
"full_name": "joker1007/octogate",
|
102
|
+
"owner": {
|
103
|
+
"login": "joker1007",
|
104
|
+
"id": 116996,
|
105
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/116996",
|
106
|
+
"gravatar_id": "a5e5ee2fb9e4ce3c728ed9e3ef6e916f",
|
107
|
+
"url": "https://api.github.com/users/joker1007",
|
108
|
+
"html_url": "https://github.com/joker1007",
|
109
|
+
"followers_url": "https://api.github.com/users/joker1007/followers",
|
110
|
+
"following_url": "https://api.github.com/users/joker1007/following{/other_user}",
|
111
|
+
"gists_url": "https://api.github.com/users/joker1007/gists{/gist_id}",
|
112
|
+
"starred_url": "https://api.github.com/users/joker1007/starred{/owner}{/repo}",
|
113
|
+
"subscriptions_url": "https://api.github.com/users/joker1007/subscriptions",
|
114
|
+
"organizations_url": "https://api.github.com/users/joker1007/orgs",
|
115
|
+
"repos_url": "https://api.github.com/users/joker1007/repos",
|
116
|
+
"events_url": "https://api.github.com/users/joker1007/events{/privacy}",
|
117
|
+
"received_events_url": "https://api.github.com/users/joker1007/received_events",
|
118
|
+
"type": "User",
|
119
|
+
"site_admin": false
|
120
|
+
},
|
121
|
+
"private": false,
|
122
|
+
"html_url": "https://github.com/joker1007/octogate",
|
123
|
+
"description": "Github hook proxy server",
|
124
|
+
"fork": false,
|
125
|
+
"url": "https://api.github.com/repos/joker1007/octogate",
|
126
|
+
"forks_url": "https://api.github.com/repos/joker1007/octogate/forks",
|
127
|
+
"keys_url": "https://api.github.com/repos/joker1007/octogate/keys{/key_id}",
|
128
|
+
"collaborators_url": "https://api.github.com/repos/joker1007/octogate/collaborators{/collaborator}",
|
129
|
+
"teams_url": "https://api.github.com/repos/joker1007/octogate/teams",
|
130
|
+
"hooks_url": "https://api.github.com/repos/joker1007/octogate/hooks",
|
131
|
+
"issue_events_url": "https://api.github.com/repos/joker1007/octogate/issues/events{/number}",
|
132
|
+
"events_url": "https://api.github.com/repos/joker1007/octogate/events",
|
133
|
+
"assignees_url": "https://api.github.com/repos/joker1007/octogate/assignees{/user}",
|
134
|
+
"branches_url": "https://api.github.com/repos/joker1007/octogate/branches{/branch}",
|
135
|
+
"tags_url": "https://api.github.com/repos/joker1007/octogate/tags",
|
136
|
+
"blobs_url": "https://api.github.com/repos/joker1007/octogate/git/blobs{/sha}",
|
137
|
+
"git_tags_url": "https://api.github.com/repos/joker1007/octogate/git/tags{/sha}",
|
138
|
+
"git_refs_url": "https://api.github.com/repos/joker1007/octogate/git/refs{/sha}",
|
139
|
+
"trees_url": "https://api.github.com/repos/joker1007/octogate/git/trees{/sha}",
|
140
|
+
"statuses_url": "https://api.github.com/repos/joker1007/octogate/statuses/{sha}",
|
141
|
+
"languages_url": "https://api.github.com/repos/joker1007/octogate/languages",
|
142
|
+
"stargazers_url": "https://api.github.com/repos/joker1007/octogate/stargazers",
|
143
|
+
"contributors_url": "https://api.github.com/repos/joker1007/octogate/contributors",
|
144
|
+
"subscribers_url": "https://api.github.com/repos/joker1007/octogate/subscribers",
|
145
|
+
"subscription_url": "https://api.github.com/repos/joker1007/octogate/subscription",
|
146
|
+
"commits_url": "https://api.github.com/repos/joker1007/octogate/commits{/sha}",
|
147
|
+
"git_commits_url": "https://api.github.com/repos/joker1007/octogate/git/commits{/sha}",
|
148
|
+
"comments_url": "https://api.github.com/repos/joker1007/octogate/comments{/number}",
|
149
|
+
"issue_comment_url": "https://api.github.com/repos/joker1007/octogate/issues/comments/{number}",
|
150
|
+
"contents_url": "https://api.github.com/repos/joker1007/octogate/contents/{+path}",
|
151
|
+
"compare_url": "https://api.github.com/repos/joker1007/octogate/compare/{base}...{head}",
|
152
|
+
"merges_url": "https://api.github.com/repos/joker1007/octogate/merges",
|
153
|
+
"archive_url": "https://api.github.com/repos/joker1007/octogate/{archive_format}{/ref}",
|
154
|
+
"downloads_url": "https://api.github.com/repos/joker1007/octogate/downloads",
|
155
|
+
"issues_url": "https://api.github.com/repos/joker1007/octogate/issues{/number}",
|
156
|
+
"pulls_url": "https://api.github.com/repos/joker1007/octogate/pulls{/number}",
|
157
|
+
"milestones_url": "https://api.github.com/repos/joker1007/octogate/milestones{/number}",
|
158
|
+
"notifications_url": "https://api.github.com/repos/joker1007/octogate/notifications{?since,all,participating}",
|
159
|
+
"labels_url": "https://api.github.com/repos/joker1007/octogate/labels{/name}",
|
160
|
+
"releases_url": "https://api.github.com/repos/joker1007/octogate/releases{/id}",
|
161
|
+
"created_at": "2014-03-01T09:02:12Z",
|
162
|
+
"updated_at": "2014-03-03T14:47:44Z",
|
163
|
+
"pushed_at": "2014-03-03T14:47:44Z",
|
164
|
+
"git_url": "git://github.com/joker1007/octogate.git",
|
165
|
+
"ssh_url": "git@github.com:joker1007/octogate.git",
|
166
|
+
"clone_url": "https://github.com/joker1007/octogate.git",
|
167
|
+
"svn_url": "https://github.com/joker1007/octogate",
|
168
|
+
"homepage": "",
|
169
|
+
"size": 0,
|
170
|
+
"stargazers_count": 6,
|
171
|
+
"watchers_count": 6,
|
172
|
+
"language": "Ruby",
|
173
|
+
"has_issues": true,
|
174
|
+
"has_downloads": true,
|
175
|
+
"has_wiki": true,
|
176
|
+
"forks_count": 0,
|
177
|
+
"mirror_url": null,
|
178
|
+
"open_issues_count": 3,
|
179
|
+
"forks": 0,
|
180
|
+
"open_issues": 3,
|
181
|
+
"watchers": 6,
|
182
|
+
"default_branch": "master",
|
183
|
+
"master_branch": "master"
|
184
|
+
},
|
185
|
+
"sender": {
|
186
|
+
"login": "joker1007",
|
187
|
+
"id": 116996,
|
188
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/116996",
|
189
|
+
"gravatar_id": "a5e5ee2fb9e4ce3c728ed9e3ef6e916f",
|
190
|
+
"url": "https://api.github.com/users/joker1007",
|
191
|
+
"html_url": "https://github.com/joker1007",
|
192
|
+
"followers_url": "https://api.github.com/users/joker1007/followers",
|
193
|
+
"following_url": "https://api.github.com/users/joker1007/following{/other_user}",
|
194
|
+
"gists_url": "https://api.github.com/users/joker1007/gists{/gist_id}",
|
195
|
+
"starred_url": "https://api.github.com/users/joker1007/starred{/owner}{/repo}",
|
196
|
+
"subscriptions_url": "https://api.github.com/users/joker1007/subscriptions",
|
197
|
+
"organizations_url": "https://api.github.com/users/joker1007/orgs",
|
198
|
+
"repos_url": "https://api.github.com/users/joker1007/repos",
|
199
|
+
"events_url": "https://api.github.com/users/joker1007/events{/privacy}",
|
200
|
+
"received_events_url": "https://api.github.com/users/joker1007/received_events",
|
201
|
+
"type": "User",
|
202
|
+
"site_admin": false
|
203
|
+
}
|
204
|
+
}
|
@@ -0,0 +1,158 @@
|
|
1
|
+
{
|
2
|
+
"action": "opened",
|
3
|
+
"issue": {
|
4
|
+
"url": "https://api.github.com/repos/joker1007/octogate/issues/3",
|
5
|
+
"labels_url": "https://api.github.com/repos/joker1007/octogate/issues/3/labels{/name}",
|
6
|
+
"comments_url": "https://api.github.com/repos/joker1007/octogate/issues/3/comments",
|
7
|
+
"events_url": "https://api.github.com/repos/joker1007/octogate/issues/3/events",
|
8
|
+
"html_url": "https://github.com/joker1007/octogate/issues/3",
|
9
|
+
"id": 28599630,
|
10
|
+
"number": 3,
|
11
|
+
"title": "configファイルのドキュメントを整備する",
|
12
|
+
"user": {
|
13
|
+
"login": "joker1007",
|
14
|
+
"id": 116996,
|
15
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/116996",
|
16
|
+
"gravatar_id": "a5e5ee2fb9e4ce3c728ed9e3ef6e916f",
|
17
|
+
"url": "https://api.github.com/users/joker1007",
|
18
|
+
"html_url": "https://github.com/joker1007",
|
19
|
+
"followers_url": "https://api.github.com/users/joker1007/followers",
|
20
|
+
"following_url": "https://api.github.com/users/joker1007/following{/other_user}",
|
21
|
+
"gists_url": "https://api.github.com/users/joker1007/gists{/gist_id}",
|
22
|
+
"starred_url": "https://api.github.com/users/joker1007/starred{/owner}{/repo}",
|
23
|
+
"subscriptions_url": "https://api.github.com/users/joker1007/subscriptions",
|
24
|
+
"organizations_url": "https://api.github.com/users/joker1007/orgs",
|
25
|
+
"repos_url": "https://api.github.com/users/joker1007/repos",
|
26
|
+
"events_url": "https://api.github.com/users/joker1007/events{/privacy}",
|
27
|
+
"received_events_url": "https://api.github.com/users/joker1007/received_events",
|
28
|
+
"type": "User",
|
29
|
+
"site_admin": false
|
30
|
+
},
|
31
|
+
"labels": [
|
32
|
+
{
|
33
|
+
"url": "https://api.github.com/repos/joker1007/octogate/labels/in+progress",
|
34
|
+
"name": "in progress",
|
35
|
+
"color": "ededed"
|
36
|
+
}
|
37
|
+
],
|
38
|
+
"state": "open",
|
39
|
+
"assignee": null,
|
40
|
+
"milestone": null,
|
41
|
+
"comments": 0,
|
42
|
+
"created_at": "2014-03-03T05:19:39Z",
|
43
|
+
"updated_at": "2014-03-03T05:19:39Z",
|
44
|
+
"closed_at": null,
|
45
|
+
"pull_request": {
|
46
|
+
"html_url": null,
|
47
|
+
"diff_url": null,
|
48
|
+
"patch_url": null
|
49
|
+
},
|
50
|
+
"body": null
|
51
|
+
},
|
52
|
+
"repository": {
|
53
|
+
"id": 17311500,
|
54
|
+
"name": "octogate",
|
55
|
+
"full_name": "joker1007/octogate",
|
56
|
+
"owner": {
|
57
|
+
"login": "joker1007",
|
58
|
+
"id": 116996,
|
59
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/116996",
|
60
|
+
"gravatar_id": "a5e5ee2fb9e4ce3c728ed9e3ef6e916f",
|
61
|
+
"url": "https://api.github.com/users/joker1007",
|
62
|
+
"html_url": "https://github.com/joker1007",
|
63
|
+
"followers_url": "https://api.github.com/users/joker1007/followers",
|
64
|
+
"following_url": "https://api.github.com/users/joker1007/following{/other_user}",
|
65
|
+
"gists_url": "https://api.github.com/users/joker1007/gists{/gist_id}",
|
66
|
+
"starred_url": "https://api.github.com/users/joker1007/starred{/owner}{/repo}",
|
67
|
+
"subscriptions_url": "https://api.github.com/users/joker1007/subscriptions",
|
68
|
+
"organizations_url": "https://api.github.com/users/joker1007/orgs",
|
69
|
+
"repos_url": "https://api.github.com/users/joker1007/repos",
|
70
|
+
"events_url": "https://api.github.com/users/joker1007/events{/privacy}",
|
71
|
+
"received_events_url": "https://api.github.com/users/joker1007/received_events",
|
72
|
+
"type": "User",
|
73
|
+
"site_admin": false
|
74
|
+
},
|
75
|
+
"private": false,
|
76
|
+
"html_url": "https://github.com/joker1007/octogate",
|
77
|
+
"description": "Github hook proxy server",
|
78
|
+
"fork": false,
|
79
|
+
"url": "https://api.github.com/repos/joker1007/octogate",
|
80
|
+
"forks_url": "https://api.github.com/repos/joker1007/octogate/forks",
|
81
|
+
"keys_url": "https://api.github.com/repos/joker1007/octogate/keys{/key_id}",
|
82
|
+
"collaborators_url": "https://api.github.com/repos/joker1007/octogate/collaborators{/collaborator}",
|
83
|
+
"teams_url": "https://api.github.com/repos/joker1007/octogate/teams",
|
84
|
+
"hooks_url": "https://api.github.com/repos/joker1007/octogate/hooks",
|
85
|
+
"issue_events_url": "https://api.github.com/repos/joker1007/octogate/issues/events{/number}",
|
86
|
+
"events_url": "https://api.github.com/repos/joker1007/octogate/events",
|
87
|
+
"assignees_url": "https://api.github.com/repos/joker1007/octogate/assignees{/user}",
|
88
|
+
"branches_url": "https://api.github.com/repos/joker1007/octogate/branches{/branch}",
|
89
|
+
"tags_url": "https://api.github.com/repos/joker1007/octogate/tags",
|
90
|
+
"blobs_url": "https://api.github.com/repos/joker1007/octogate/git/blobs{/sha}",
|
91
|
+
"git_tags_url": "https://api.github.com/repos/joker1007/octogate/git/tags{/sha}",
|
92
|
+
"git_refs_url": "https://api.github.com/repos/joker1007/octogate/git/refs{/sha}",
|
93
|
+
"trees_url": "https://api.github.com/repos/joker1007/octogate/git/trees{/sha}",
|
94
|
+
"statuses_url": "https://api.github.com/repos/joker1007/octogate/statuses/{sha}",
|
95
|
+
"languages_url": "https://api.github.com/repos/joker1007/octogate/languages",
|
96
|
+
"stargazers_url": "https://api.github.com/repos/joker1007/octogate/stargazers",
|
97
|
+
"contributors_url": "https://api.github.com/repos/joker1007/octogate/contributors",
|
98
|
+
"subscribers_url": "https://api.github.com/repos/joker1007/octogate/subscribers",
|
99
|
+
"subscription_url": "https://api.github.com/repos/joker1007/octogate/subscription",
|
100
|
+
"commits_url": "https://api.github.com/repos/joker1007/octogate/commits{/sha}",
|
101
|
+
"git_commits_url": "https://api.github.com/repos/joker1007/octogate/git/commits{/sha}",
|
102
|
+
"comments_url": "https://api.github.com/repos/joker1007/octogate/comments{/number}",
|
103
|
+
"issue_comment_url": "https://api.github.com/repos/joker1007/octogate/issues/comments/{number}",
|
104
|
+
"contents_url": "https://api.github.com/repos/joker1007/octogate/contents/{+path}",
|
105
|
+
"compare_url": "https://api.github.com/repos/joker1007/octogate/compare/{base}...{head}",
|
106
|
+
"merges_url": "https://api.github.com/repos/joker1007/octogate/merges",
|
107
|
+
"archive_url": "https://api.github.com/repos/joker1007/octogate/{archive_format}{/ref}",
|
108
|
+
"downloads_url": "https://api.github.com/repos/joker1007/octogate/downloads",
|
109
|
+
"issues_url": "https://api.github.com/repos/joker1007/octogate/issues{/number}",
|
110
|
+
"pulls_url": "https://api.github.com/repos/joker1007/octogate/pulls{/number}",
|
111
|
+
"milestones_url": "https://api.github.com/repos/joker1007/octogate/milestones{/number}",
|
112
|
+
"notifications_url": "https://api.github.com/repos/joker1007/octogate/notifications{?since,all,participating}",
|
113
|
+
"labels_url": "https://api.github.com/repos/joker1007/octogate/labels{/name}",
|
114
|
+
"releases_url": "https://api.github.com/repos/joker1007/octogate/releases{/id}",
|
115
|
+
"created_at": "2014-03-01T09:02:12Z",
|
116
|
+
"updated_at": "2014-03-02T16:17:22Z",
|
117
|
+
"pushed_at": "2014-03-02T16:17:22Z",
|
118
|
+
"git_url": "git://github.com/joker1007/octogate.git",
|
119
|
+
"ssh_url": "git@github.com:joker1007/octogate.git",
|
120
|
+
"clone_url": "https://github.com/joker1007/octogate.git",
|
121
|
+
"svn_url": "https://github.com/joker1007/octogate",
|
122
|
+
"homepage": "",
|
123
|
+
"size": 0,
|
124
|
+
"stargazers_count": 5,
|
125
|
+
"watchers_count": 5,
|
126
|
+
"language": "Ruby",
|
127
|
+
"has_issues": true,
|
128
|
+
"has_downloads": true,
|
129
|
+
"has_wiki": true,
|
130
|
+
"forks_count": 0,
|
131
|
+
"mirror_url": null,
|
132
|
+
"open_issues_count": 1,
|
133
|
+
"forks": 0,
|
134
|
+
"open_issues": 1,
|
135
|
+
"watchers": 5,
|
136
|
+
"default_branch": "master",
|
137
|
+
"master_branch": "master"
|
138
|
+
},
|
139
|
+
"sender": {
|
140
|
+
"login": "joker1007",
|
141
|
+
"id": 116996,
|
142
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/116996",
|
143
|
+
"gravatar_id": "a5e5ee2fb9e4ce3c728ed9e3ef6e916f",
|
144
|
+
"url": "https://api.github.com/users/joker1007",
|
145
|
+
"html_url": "https://github.com/joker1007",
|
146
|
+
"followers_url": "https://api.github.com/users/joker1007/followers",
|
147
|
+
"following_url": "https://api.github.com/users/joker1007/following{/other_user}",
|
148
|
+
"gists_url": "https://api.github.com/users/joker1007/gists{/gist_id}",
|
149
|
+
"starred_url": "https://api.github.com/users/joker1007/starred{/owner}{/repo}",
|
150
|
+
"subscriptions_url": "https://api.github.com/users/joker1007/subscriptions",
|
151
|
+
"organizations_url": "https://api.github.com/users/joker1007/orgs",
|
152
|
+
"repos_url": "https://api.github.com/users/joker1007/repos",
|
153
|
+
"events_url": "https://api.github.com/users/joker1007/events{/privacy}",
|
154
|
+
"received_events_url": "https://api.github.com/users/joker1007/received_events",
|
155
|
+
"type": "User",
|
156
|
+
"site_admin": false
|
157
|
+
}
|
158
|
+
}
|
@@ -63,7 +63,7 @@ describe Octogate::Client do
|
|
63
63
|
|
64
64
|
client = Octogate::Client.new(event)
|
65
65
|
client.request(Octogate.find_target("block params"))
|
66
|
-
expect(WebMock).to have_requested(:post, "http://targethost.dev/job/JobName").with(body: {ref: event.ref, head_commit_id: event.head_commit.id})
|
66
|
+
expect(WebMock).to have_requested(:post, "http://targethost.dev/job/JobName").with(body: {ref: event.ref, head_commit_id: event.head_commit.id, method: "post"})
|
67
67
|
end
|
68
68
|
|
69
69
|
it "request always to target that have no match rule" do
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Octogate::Event::IssueComment do
|
4
|
+
describe ".parse" do
|
5
|
+
subject { described_class.parse(read_payload(:issue_comment)) }
|
6
|
+
it { should be_a described_class }
|
7
|
+
|
8
|
+
it { expect(subject.action).to eq "created" }
|
9
|
+
it { expect(subject.issue).to be_a Octogate::GH::Issue }
|
10
|
+
it { expect(subject.issue.id).to eq 28599636 }
|
11
|
+
it { expect(subject.issue.labels.first).to be_a Octogate::GH::Label }
|
12
|
+
it { expect(subject.repository).to be_a Octogate::GH::Repository }
|
13
|
+
it { expect(subject.comment).to be_a Octogate::GH::IssueComment }
|
14
|
+
it { expect(subject.comment.body).to eq "IssueとIssue Commentを追加する。" }
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "registered" do
|
18
|
+
subject { Octogate::Event.get(:issue_comment) }
|
19
|
+
|
20
|
+
it { should eq Octogate::Event::IssueComment }
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Octogate::Event::Issue do
|
4
|
+
describe ".parse" do
|
5
|
+
subject { described_class.parse(read_payload(:issues)) }
|
6
|
+
it { should be_a described_class }
|
7
|
+
|
8
|
+
it { expect(subject.action).to eq "opened" }
|
9
|
+
it { expect(subject.issue).to be_a Octogate::GH::Issue }
|
10
|
+
it { expect(subject.issue.id).to eq 28599630 }
|
11
|
+
it { expect(subject.issue.labels.first).to be_a Octogate::GH::Label }
|
12
|
+
it { expect(subject.repository).to be_a Octogate::GH::Repository }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "registered" do
|
16
|
+
subject { Octogate::Event.get(:issues) }
|
17
|
+
|
18
|
+
it { should eq Octogate::Event::Issue }
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Octogate::Event::PullRequestReviewComment do
|
4
|
+
describe ".parse" do
|
5
|
+
subject { described_class.parse(read_payload(:pull_request_review_comment)) }
|
6
|
+
it { should be_a described_class }
|
7
|
+
|
8
|
+
it { expect(subject.comment).to be_a Octogate::GH::ReviewComment }
|
9
|
+
it { expect(subject.comment.id).to eq 10384812 }
|
10
|
+
it { expect(subject.comment.user).to be_a Octogate::GH::User }
|
11
|
+
it { expect(subject.repository).to be_a Octogate::GH::Repository }
|
12
|
+
it { expect(subject.comment.body).to eq "review comment test" }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "registered" do
|
16
|
+
subject { Octogate::Event.get(:pull_request_review_comment) }
|
17
|
+
|
18
|
+
it { should eq Octogate::Event::PullRequestReviewComment }
|
19
|
+
end
|
20
|
+
end
|
@@ -11,4 +11,10 @@ describe Octogate::Event::PullRequest do
|
|
11
11
|
it { expect(subject.pull_request.base).to be_a Octogate::GH::Commit }
|
12
12
|
it { expect(subject.pull_request.head).to be_a Octogate::GH::Commit }
|
13
13
|
end
|
14
|
+
|
15
|
+
describe "registered" do
|
16
|
+
subject { Octogate::Event.get(:pull_request) }
|
17
|
+
|
18
|
+
it { should eq Octogate::Event::PullRequest }
|
19
|
+
end
|
14
20
|
end
|
@@ -11,4 +11,10 @@ describe Octogate::Event::Push do
|
|
11
11
|
it { expect(subject.head_commit).to be_a Octogate::GH::Commit }
|
12
12
|
it { expect(subject.repository).to be_a Octogate::GH::Repository }
|
13
13
|
end
|
14
|
+
|
15
|
+
describe "registered" do
|
16
|
+
subject { Octogate::Event.get(:push) }
|
17
|
+
|
18
|
+
it { should eq Octogate::Event::Push }
|
19
|
+
end
|
14
20
|
end
|
@@ -0,0 +1,153 @@
|
|
1
|
+
{
|
2
|
+
"comment": {
|
3
|
+
"url": "https://api.github.com/repos/joker1007/octogate/pulls/comments/10384812",
|
4
|
+
"id": 10384812,
|
5
|
+
"diff_hunk": "@@ -20,3 +20,5 @@ class NotRegisteredEvent < StandardError; end\n \n require \"octogate/events/push\"\n require \"octogate/events/pull_request\"\n+require \"octogate/events/issue\"\n+require \"octogate/events/issue_comment\"",
|
6
|
+
"path": "lib/octogate/events.rb",
|
7
|
+
"position": 5,
|
8
|
+
"original_position": 5,
|
9
|
+
"commit_id": "f0b04fad2375d5da1113904f8bac7defc3064542",
|
10
|
+
"original_commit_id": "f0b04fad2375d5da1113904f8bac7defc3064542",
|
11
|
+
"user": {
|
12
|
+
"login": "joker1007",
|
13
|
+
"id": 116996,
|
14
|
+
"avatar_url": "https://gravatar.com/avatar/a5e5ee2fb9e4ce3c728ed9e3ef6e916f?d=https%3A%2F%2Fidenticons.github.com%2F6d9143d0e2f570b60020bc92f615e688.png&r=x",
|
15
|
+
"gravatar_id": "a5e5ee2fb9e4ce3c728ed9e3ef6e916f",
|
16
|
+
"url": "https://api.github.com/users/joker1007",
|
17
|
+
"html_url": "https://github.com/joker1007",
|
18
|
+
"followers_url": "https://api.github.com/users/joker1007/followers",
|
19
|
+
"following_url": "https://api.github.com/users/joker1007/following{/other_user}",
|
20
|
+
"gists_url": "https://api.github.com/users/joker1007/gists{/gist_id}",
|
21
|
+
"starred_url": "https://api.github.com/users/joker1007/starred{/owner}{/repo}",
|
22
|
+
"subscriptions_url": "https://api.github.com/users/joker1007/subscriptions",
|
23
|
+
"organizations_url": "https://api.github.com/users/joker1007/orgs",
|
24
|
+
"repos_url": "https://api.github.com/users/joker1007/repos",
|
25
|
+
"events_url": "https://api.github.com/users/joker1007/events{/privacy}",
|
26
|
+
"received_events_url": "https://api.github.com/users/joker1007/received_events",
|
27
|
+
"type": "User",
|
28
|
+
"site_admin": false
|
29
|
+
},
|
30
|
+
"body": "review comment test",
|
31
|
+
"created_at": "2014-03-07T14:43:55Z",
|
32
|
+
"updated_at": "2014-03-07T14:43:55Z",
|
33
|
+
"html_url": "https://github.com/joker1007/octogate/pull/7#discussion_r10384812",
|
34
|
+
"pull_request_url": "https://api.github.com/repos/joker1007/octogate/pulls/7",
|
35
|
+
"_links": {
|
36
|
+
"self": {
|
37
|
+
"href": "https://api.github.com/repos/joker1007/octogate/pulls/comments/10384812"
|
38
|
+
},
|
39
|
+
"html": {
|
40
|
+
"href": "https://github.com/joker1007/octogate/pull/7#discussion_r10384812"
|
41
|
+
},
|
42
|
+
"pull_request": {
|
43
|
+
"href": "https://api.github.com/repos/joker1007/octogate/pulls/7"
|
44
|
+
}
|
45
|
+
}
|
46
|
+
},
|
47
|
+
"repository": {
|
48
|
+
"id": 17311500,
|
49
|
+
"name": "octogate",
|
50
|
+
"full_name": "joker1007/octogate",
|
51
|
+
"owner": {
|
52
|
+
"login": "joker1007",
|
53
|
+
"id": 116996,
|
54
|
+
"avatar_url": "https://gravatar.com/avatar/a5e5ee2fb9e4ce3c728ed9e3ef6e916f?d=https%3A%2F%2Fidenticons.github.com%2F6d9143d0e2f570b60020bc92f615e688.png&r=x",
|
55
|
+
"gravatar_id": "a5e5ee2fb9e4ce3c728ed9e3ef6e916f",
|
56
|
+
"url": "https://api.github.com/users/joker1007",
|
57
|
+
"html_url": "https://github.com/joker1007",
|
58
|
+
"followers_url": "https://api.github.com/users/joker1007/followers",
|
59
|
+
"following_url": "https://api.github.com/users/joker1007/following{/other_user}",
|
60
|
+
"gists_url": "https://api.github.com/users/joker1007/gists{/gist_id}",
|
61
|
+
"starred_url": "https://api.github.com/users/joker1007/starred{/owner}{/repo}",
|
62
|
+
"subscriptions_url": "https://api.github.com/users/joker1007/subscriptions",
|
63
|
+
"organizations_url": "https://api.github.com/users/joker1007/orgs",
|
64
|
+
"repos_url": "https://api.github.com/users/joker1007/repos",
|
65
|
+
"events_url": "https://api.github.com/users/joker1007/events{/privacy}",
|
66
|
+
"received_events_url": "https://api.github.com/users/joker1007/received_events",
|
67
|
+
"type": "User",
|
68
|
+
"site_admin": false
|
69
|
+
},
|
70
|
+
"private": false,
|
71
|
+
"html_url": "https://github.com/joker1007/octogate",
|
72
|
+
"description": "Github hook proxy server",
|
73
|
+
"fork": false,
|
74
|
+
"url": "https://api.github.com/repos/joker1007/octogate",
|
75
|
+
"forks_url": "https://api.github.com/repos/joker1007/octogate/forks",
|
76
|
+
"keys_url": "https://api.github.com/repos/joker1007/octogate/keys{/key_id}",
|
77
|
+
"collaborators_url": "https://api.github.com/repos/joker1007/octogate/collaborators{/collaborator}",
|
78
|
+
"teams_url": "https://api.github.com/repos/joker1007/octogate/teams",
|
79
|
+
"hooks_url": "https://api.github.com/repos/joker1007/octogate/hooks",
|
80
|
+
"issue_events_url": "https://api.github.com/repos/joker1007/octogate/issues/events{/number}",
|
81
|
+
"events_url": "https://api.github.com/repos/joker1007/octogate/events",
|
82
|
+
"assignees_url": "https://api.github.com/repos/joker1007/octogate/assignees{/user}",
|
83
|
+
"branches_url": "https://api.github.com/repos/joker1007/octogate/branches{/branch}",
|
84
|
+
"tags_url": "https://api.github.com/repos/joker1007/octogate/tags",
|
85
|
+
"blobs_url": "https://api.github.com/repos/joker1007/octogate/git/blobs{/sha}",
|
86
|
+
"git_tags_url": "https://api.github.com/repos/joker1007/octogate/git/tags{/sha}",
|
87
|
+
"git_refs_url": "https://api.github.com/repos/joker1007/octogate/git/refs{/sha}",
|
88
|
+
"trees_url": "https://api.github.com/repos/joker1007/octogate/git/trees{/sha}",
|
89
|
+
"statuses_url": "https://api.github.com/repos/joker1007/octogate/statuses/{sha}",
|
90
|
+
"languages_url": "https://api.github.com/repos/joker1007/octogate/languages",
|
91
|
+
"stargazers_url": "https://api.github.com/repos/joker1007/octogate/stargazers",
|
92
|
+
"contributors_url": "https://api.github.com/repos/joker1007/octogate/contributors",
|
93
|
+
"subscribers_url": "https://api.github.com/repos/joker1007/octogate/subscribers",
|
94
|
+
"subscription_url": "https://api.github.com/repos/joker1007/octogate/subscription",
|
95
|
+
"commits_url": "https://api.github.com/repos/joker1007/octogate/commits{/sha}",
|
96
|
+
"git_commits_url": "https://api.github.com/repos/joker1007/octogate/git/commits{/sha}",
|
97
|
+
"comments_url": "https://api.github.com/repos/joker1007/octogate/comments{/number}",
|
98
|
+
"issue_comment_url": "https://api.github.com/repos/joker1007/octogate/issues/comments/{number}",
|
99
|
+
"contents_url": "https://api.github.com/repos/joker1007/octogate/contents/{+path}",
|
100
|
+
"compare_url": "https://api.github.com/repos/joker1007/octogate/compare/{base}...{head}",
|
101
|
+
"merges_url": "https://api.github.com/repos/joker1007/octogate/merges",
|
102
|
+
"archive_url": "https://api.github.com/repos/joker1007/octogate/{archive_format}{/ref}",
|
103
|
+
"downloads_url": "https://api.github.com/repos/joker1007/octogate/downloads",
|
104
|
+
"issues_url": "https://api.github.com/repos/joker1007/octogate/issues{/number}",
|
105
|
+
"pulls_url": "https://api.github.com/repos/joker1007/octogate/pulls{/number}",
|
106
|
+
"milestones_url": "https://api.github.com/repos/joker1007/octogate/milestones{/number}",
|
107
|
+
"notifications_url": "https://api.github.com/repos/joker1007/octogate/notifications{?since,all,participating}",
|
108
|
+
"labels_url": "https://api.github.com/repos/joker1007/octogate/labels{/name}",
|
109
|
+
"releases_url": "https://api.github.com/repos/joker1007/octogate/releases{/id}",
|
110
|
+
"created_at": "2014-03-01T09:02:12Z",
|
111
|
+
"updated_at": "2014-03-03T19:24:06Z",
|
112
|
+
"pushed_at": "2014-03-03T19:24:06Z",
|
113
|
+
"git_url": "git://github.com/joker1007/octogate.git",
|
114
|
+
"ssh_url": "git@github.com:joker1007/octogate.git",
|
115
|
+
"clone_url": "https://github.com/joker1007/octogate.git",
|
116
|
+
"svn_url": "https://github.com/joker1007/octogate",
|
117
|
+
"homepage": "",
|
118
|
+
"size": 0,
|
119
|
+
"stargazers_count": 8,
|
120
|
+
"watchers_count": 8,
|
121
|
+
"language": "Ruby",
|
122
|
+
"has_issues": true,
|
123
|
+
"has_downloads": true,
|
124
|
+
"has_wiki": true,
|
125
|
+
"forks_count": 0,
|
126
|
+
"mirror_url": null,
|
127
|
+
"open_issues_count": 3,
|
128
|
+
"forks": 0,
|
129
|
+
"open_issues": 3,
|
130
|
+
"watchers": 8,
|
131
|
+
"default_branch": "master",
|
132
|
+
"master_branch": "master"
|
133
|
+
},
|
134
|
+
"sender": {
|
135
|
+
"login": "joker1007",
|
136
|
+
"id": 116996,
|
137
|
+
"avatar_url": "https://gravatar.com/avatar/a5e5ee2fb9e4ce3c728ed9e3ef6e916f?d=https%3A%2F%2Fidenticons.github.com%2F6d9143d0e2f570b60020bc92f615e688.png&r=x",
|
138
|
+
"gravatar_id": "a5e5ee2fb9e4ce3c728ed9e3ef6e916f",
|
139
|
+
"url": "https://api.github.com/users/joker1007",
|
140
|
+
"html_url": "https://github.com/joker1007",
|
141
|
+
"followers_url": "https://api.github.com/users/joker1007/followers",
|
142
|
+
"following_url": "https://api.github.com/users/joker1007/following{/other_user}",
|
143
|
+
"gists_url": "https://api.github.com/users/joker1007/gists{/gist_id}",
|
144
|
+
"starred_url": "https://api.github.com/users/joker1007/starred{/owner}{/repo}",
|
145
|
+
"subscriptions_url": "https://api.github.com/users/joker1007/subscriptions",
|
146
|
+
"organizations_url": "https://api.github.com/users/joker1007/orgs",
|
147
|
+
"repos_url": "https://api.github.com/users/joker1007/repos",
|
148
|
+
"events_url": "https://api.github.com/users/joker1007/events{/privacy}",
|
149
|
+
"received_events_url": "https://api.github.com/users/joker1007/received_events",
|
150
|
+
"type": "User",
|
151
|
+
"site_admin": false
|
152
|
+
}
|
153
|
+
}
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octogate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joker1007
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -178,6 +178,20 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: coveralls
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
181
195
|
description: Github webhook proxy server. Request target is defined by Ruby DSL
|
182
196
|
email:
|
183
197
|
- kakyoin.hierophant@gmail.com
|
@@ -201,12 +215,19 @@ files:
|
|
201
215
|
- lib/octogate/configuration.rb
|
202
216
|
- lib/octogate/events.rb
|
203
217
|
- lib/octogate/events/base.rb
|
218
|
+
- lib/octogate/events/issue.rb
|
219
|
+
- lib/octogate/events/issue_comment.rb
|
204
220
|
- lib/octogate/events/pull_request.rb
|
221
|
+
- lib/octogate/events/pull_request_review_comment.rb
|
205
222
|
- lib/octogate/events/push.rb
|
206
223
|
- lib/octogate/gh.rb
|
207
224
|
- lib/octogate/gh/commit.rb
|
225
|
+
- lib/octogate/gh/issue.rb
|
226
|
+
- lib/octogate/gh/issue_comment.rb
|
227
|
+
- lib/octogate/gh/label.rb
|
208
228
|
- lib/octogate/gh/pull_request.rb
|
209
229
|
- lib/octogate/gh/repository.rb
|
230
|
+
- lib/octogate/gh/review_comment.rb
|
210
231
|
- lib/octogate/gh/user.rb
|
211
232
|
- lib/octogate/model.rb
|
212
233
|
- lib/octogate/server.rb
|
@@ -216,13 +237,19 @@ files:
|
|
216
237
|
- lib/octogate/version.rb
|
217
238
|
- octogate.gemspec
|
218
239
|
- spec/config_sample.rb
|
240
|
+
- spec/issue_comment_payload.json
|
241
|
+
- spec/issues_payload.json
|
219
242
|
- spec/lib/octogate/client_spec.rb
|
220
243
|
- spec/lib/octogate/config_loader_spec.rb
|
244
|
+
- spec/lib/octogate/events/issue_comment_spec.rb
|
245
|
+
- spec/lib/octogate/events/issue_spec.rb
|
246
|
+
- spec/lib/octogate/events/pull_request_review_comment_spec.rb
|
221
247
|
- spec/lib/octogate/events/pull_request_spec.rb
|
222
248
|
- spec/lib/octogate/events/push_spec.rb
|
223
249
|
- spec/lib/octogate/events_spec.rb
|
224
250
|
- spec/lib/octogate/target_spec.rb
|
225
251
|
- spec/pull_request_payload.json
|
252
|
+
- spec/pull_request_review_comment_payload.json
|
226
253
|
- spec/push_payload.json
|
227
254
|
- spec/spec_helper.rb
|
228
255
|
homepage: https://github.com/joker1007/octogate
|
@@ -251,12 +278,18 @@ specification_version: 4
|
|
251
278
|
summary: Github webhook proxy server
|
252
279
|
test_files:
|
253
280
|
- spec/config_sample.rb
|
281
|
+
- spec/issue_comment_payload.json
|
282
|
+
- spec/issues_payload.json
|
254
283
|
- spec/lib/octogate/client_spec.rb
|
255
284
|
- spec/lib/octogate/config_loader_spec.rb
|
285
|
+
- spec/lib/octogate/events/issue_comment_spec.rb
|
286
|
+
- spec/lib/octogate/events/issue_spec.rb
|
287
|
+
- spec/lib/octogate/events/pull_request_review_comment_spec.rb
|
256
288
|
- spec/lib/octogate/events/pull_request_spec.rb
|
257
289
|
- spec/lib/octogate/events/push_spec.rb
|
258
290
|
- spec/lib/octogate/events_spec.rb
|
259
291
|
- spec/lib/octogate/target_spec.rb
|
260
292
|
- spec/pull_request_payload.json
|
293
|
+
- spec/pull_request_review_comment_payload.json
|
261
294
|
- spec/push_payload.json
|
262
295
|
- spec/spec_helper.rb
|