vx-service_connector 0.2.12 → 0.2.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/lib/vx/service_connector.rb +3 -0
- data/lib/vx/service_connector/bitbucket.rb +51 -0
- data/lib/vx/service_connector/bitbucket/commits.rb +30 -0
- data/lib/vx/service_connector/bitbucket/deploy_keys.rb +29 -0
- data/lib/vx/service_connector/bitbucket/files.rb +21 -0
- data/lib/vx/service_connector/bitbucket/hooks.rb +58 -0
- data/lib/vx/service_connector/bitbucket/notices.rb +11 -0
- data/lib/vx/service_connector/bitbucket/payload.rb +136 -0
- data/lib/vx/service_connector/bitbucket/repos.rb +56 -0
- data/lib/vx/service_connector/bitbucket/session.rb +113 -0
- data/lib/vx/service_connector/error.rb +1 -0
- data/lib/vx/service_connector/version.rb +1 -1
- data/spec/fixtures/bitbucket/add_deploy_key.json +7 -0
- data/spec/fixtures/bitbucket/commit.json +72 -0
- data/spec/fixtures/bitbucket/create_hook.json +12 -0
- data/spec/fixtures/bitbucket/deploy_keys.json +1 -0
- data/spec/fixtures/bitbucket/hooks.json +38 -0
- data/spec/fixtures/bitbucket/payload/created_pull_request.json +120 -0
- data/spec/fixtures/bitbucket/payload/declined_pull_request.json +80 -0
- data/spec/fixtures/bitbucket/payload/foreign_pull_request.json +120 -0
- data/spec/fixtures/bitbucket/payload/push.json +38 -0
- data/spec/fixtures/bitbucket/payload/updated_pull_request.json +80 -0
- data/spec/fixtures/bitbucket/repos.json +206 -0
- data/spec/fixtures/bitbucket/user_privileges.json +6 -0
- data/spec/fixtures/bitbucket/user_repo.json +63 -0
- data/spec/fixtures/bitbucket/user_repos.json +197 -0
- data/spec/lib/bitbucket_payload_spec.rb +82 -0
- data/spec/lib/bitbucket_spec.rb +144 -0
- data/spec/support/bitbucket_web_mocks.rb +87 -0
- data/vx-service_connector.gemspec +4 -3
- metadata +59 -2
@@ -0,0 +1,72 @@
|
|
1
|
+
{
|
2
|
+
"hash": "0a1fb3a24b8ceb48a16fb09a5759cd6f8a930463",
|
3
|
+
"links": {
|
4
|
+
"self": {
|
5
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/commit/0a1fb3a24b8ceb48a16fb09a5759cd6f8a930463"
|
6
|
+
},
|
7
|
+
"comments": {
|
8
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/commit/0a1fb3a24b8ceb48a16fb09a5759cd6f8a930463/comments"
|
9
|
+
},
|
10
|
+
"patch": {
|
11
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/patch/0a1fb3a24b8ceb48a16fb09a5759cd6f8a930463"
|
12
|
+
},
|
13
|
+
"html": {
|
14
|
+
"href": "https://bitbucket.org/login/api-test/commits/0a1fb3a24b8ceb48a16fb09a5759cd6f8a930463"
|
15
|
+
},
|
16
|
+
"diff": {
|
17
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/diff/0a1fb3a24b8ceb48a16fb09a5759cd6f8a930463"
|
18
|
+
},
|
19
|
+
"approve": {
|
20
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/commit/0a1fb3a24b8ceb48a16fb09a5759cd6f8a930463/approve"
|
21
|
+
}
|
22
|
+
},
|
23
|
+
"repository": {
|
24
|
+
"links": {
|
25
|
+
"self": {
|
26
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test"
|
27
|
+
},
|
28
|
+
"html": {
|
29
|
+
"href": "https://bitbucket.org/login/api-test"
|
30
|
+
},
|
31
|
+
"avatar": {
|
32
|
+
"href": "https://d3oaxc4q5k2d6q.cloudfront.net/m/76ef4a8a61d5/img/language-avatars/ruby_16.png"
|
33
|
+
}
|
34
|
+
},
|
35
|
+
"full_name": "login/api-test",
|
36
|
+
"name": "api-test"
|
37
|
+
},
|
38
|
+
"author": {
|
39
|
+
"raw": "login <example@gmail.com>",
|
40
|
+
"user": {
|
41
|
+
"username": "login",
|
42
|
+
"display_name": "login",
|
43
|
+
"links": {
|
44
|
+
"self": {
|
45
|
+
"href": "https://bitbucket.org/api/2.0/users/login"
|
46
|
+
},
|
47
|
+
"html": {
|
48
|
+
"href": "https://bitbucket.org/login"
|
49
|
+
},
|
50
|
+
"avatar": {
|
51
|
+
"href": "https://secure.gravatar.com/avatar/760fd901769630ef0628e7064eb01fbd?d=https%3A%2F%2Fd3oaxc4q5k2d6q.cloudfront.net%2Fm%2F76ef4a8a61d5%2Fimg%2Fdefault_avatar%2F32%2Fuser_blue.png&s=32"
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
},
|
56
|
+
"participants": [],
|
57
|
+
"parents": [
|
58
|
+
{
|
59
|
+
"hash": "26a59dea8bb1bf207d8607b1c58a077872c9f28f",
|
60
|
+
"links": {
|
61
|
+
"self": {
|
62
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/commit/26a59dea8bb1bf207d8607b1c58a077872c9f28f"
|
63
|
+
},
|
64
|
+
"html": {
|
65
|
+
"href": "https://bitbucket.org/login/api-test/commits/26a59dea8bb1bf207d8607b1c58a077872c9f28f"
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
],
|
70
|
+
"date": "2014-10-11T18:55:21+00:00",
|
71
|
+
"message": "Fix all the bugs"
|
72
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
[{"pk": 929688, "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAujgHcOFLwW9f7tJq9KkyhwpuiiLOhb82GEaeArer7gfeL7nP3PaickJ/MRRKAFYIGHMYJA2PIphuHJbjBsblrLUnFXD0ICa2mavJJrZmBVpQRfaPUyi3x3slhTv0gK6fDICu58Cb6rXDGTj1OS/0NGt5tuwZHn9FnDix/uh+aa6JA/rgctJ6HT2qxEdWOMATNgOEgSed8tB9a7+oR9+vmU29gbznV+gipZERsikAe0npkTH7dt0JSy0O2CQWm+Qs8NkEpsioVvFhoL40pmi1SSOrDrVSdZWHLg1vvxZ8FvrpdzY3UwA4CbW6iKHXw00Yug+fy1U4fVlCrCIkNeok0Q== dima@iMac-Dmitry-Galinsky.local", "label": "foo"}]
|
@@ -0,0 +1,38 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"id": 4115444,
|
4
|
+
"service": {
|
5
|
+
"fields": [
|
6
|
+
{
|
7
|
+
"name": "approve/unapprove",
|
8
|
+
"value": "on"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"name": "comments",
|
12
|
+
"value": "on"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "create/edit/merge/decline",
|
16
|
+
"value": "on"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"name": "URL",
|
20
|
+
"value": "http://example.com"
|
21
|
+
}
|
22
|
+
],
|
23
|
+
"type": "Pull Request POST"
|
24
|
+
}
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"id": 4115443,
|
28
|
+
"service": {
|
29
|
+
"fields": [
|
30
|
+
{
|
31
|
+
"name": "URL",
|
32
|
+
"value": "http://example.com"
|
33
|
+
}
|
34
|
+
],
|
35
|
+
"type": "POST"
|
36
|
+
}
|
37
|
+
}
|
38
|
+
]
|
@@ -0,0 +1,120 @@
|
|
1
|
+
{
|
2
|
+
"pullrequest_created": {
|
3
|
+
"description": "...",
|
4
|
+
"links": {
|
5
|
+
"decline": {
|
6
|
+
"href": "https://bitbucket.org/api/2.0/repositories/121111foobar/vx-promo/pullrequests/1/decline"
|
7
|
+
},
|
8
|
+
"commits": {
|
9
|
+
"href": "https://bitbucket.org/api/2.0/repositories/121111foobar/vx-promo/pullrequests/1/commits"
|
10
|
+
},
|
11
|
+
"self": {
|
12
|
+
"href": "https://bitbucket.org/api/2.0/repositories/121111foobar/vx-promo/pullrequests/1"
|
13
|
+
},
|
14
|
+
"comments": {
|
15
|
+
"href": "https://bitbucket.org/api/2.0/repositories/121111foobar/vx-promo/pullrequests/1/comments"
|
16
|
+
},
|
17
|
+
"merge": {
|
18
|
+
"href": "https://bitbucket.org/api/2.0/repositories/121111foobar/vx-promo/pullrequests/1/merge"
|
19
|
+
},
|
20
|
+
"html": {
|
21
|
+
"href": "https://bitbucket.org/121111foobar/vx-promo/pull-request/1"
|
22
|
+
},
|
23
|
+
"activity": {
|
24
|
+
"href": "https://bitbucket.org/api/2.0/repositories/121111foobar/vx-promo/pullrequests/1/activity"
|
25
|
+
},
|
26
|
+
"diff": {
|
27
|
+
"href": "https://bitbucket.org/api/2.0/repositories/121111foobar/vx-promo/pullrequests/1/diff"
|
28
|
+
},
|
29
|
+
"approve": {
|
30
|
+
"href": "https://bitbucket.org/api/2.0/repositories/121111foobar/vx-promo/pullrequests/1/approve"
|
31
|
+
}
|
32
|
+
},
|
33
|
+
"title": "PL test",
|
34
|
+
"close_source_branch": false,
|
35
|
+
"reviewers": [
|
36
|
+
|
37
|
+
],
|
38
|
+
"destination": {
|
39
|
+
"commit": {
|
40
|
+
"hash": "e4958d88c905",
|
41
|
+
"links": {
|
42
|
+
"self": {
|
43
|
+
"href": "https://bitbucket.org/api/2.0/repositories/121111foobar/vx-promo/commit/e4958d88c905"
|
44
|
+
}
|
45
|
+
}
|
46
|
+
},
|
47
|
+
"branch": {
|
48
|
+
"name": "master"
|
49
|
+
},
|
50
|
+
"repository": {
|
51
|
+
"full_name": "121111foobar/vx-promo",
|
52
|
+
"links": {
|
53
|
+
"self": {
|
54
|
+
"href": "https://bitbucket.org/api/2.0/repositories/121111foobar/vx-promo"
|
55
|
+
},
|
56
|
+
"html": {
|
57
|
+
"href": "https://bitbucket.org/121111foobar/vx-promo"
|
58
|
+
},
|
59
|
+
"avatar": {
|
60
|
+
"href": "https://d3oaxc4q5k2d6q.cloudfront.net/m/bc2c3d924a20/img/language-avatars/default_16.png"
|
61
|
+
}
|
62
|
+
},
|
63
|
+
"name": "vx-promo"
|
64
|
+
}
|
65
|
+
},
|
66
|
+
"state": "OPEN",
|
67
|
+
"id": 1,
|
68
|
+
"source": {
|
69
|
+
"commit": {
|
70
|
+
"hash": "b14806535f5e",
|
71
|
+
"links": {
|
72
|
+
"self": {
|
73
|
+
"href": "https://bitbucket.org/api/2.0/repositories/121111foobar/vx-promo/commit/b14806535f5e"
|
74
|
+
}
|
75
|
+
}
|
76
|
+
},
|
77
|
+
"branch": {
|
78
|
+
"name": "test"
|
79
|
+
},
|
80
|
+
"repository": {
|
81
|
+
"full_name": "121111foobar/vx-promo",
|
82
|
+
"links": {
|
83
|
+
"self": {
|
84
|
+
"href": "https://bitbucket.org/api/2.0/repositories/121111foobar/vx-promo"
|
85
|
+
},
|
86
|
+
"html": {
|
87
|
+
"href": "https://bitbucket.org/121111foobar/vx-promo"
|
88
|
+
},
|
89
|
+
"avatar": {
|
90
|
+
"href": "https://d3oaxc4q5k2d6q.cloudfront.net/m/bc2c3d924a20/img/language-avatars/default_16.png"
|
91
|
+
}
|
92
|
+
},
|
93
|
+
"name": "vx-promo"
|
94
|
+
}
|
95
|
+
},
|
96
|
+
"reason": "",
|
97
|
+
"author": {
|
98
|
+
"username": "dmexe",
|
99
|
+
"display_name": "Dmitry Galinsky",
|
100
|
+
"links": {
|
101
|
+
"self": {
|
102
|
+
"href": "https://bitbucket.org/api/2.0/users/dmexe"
|
103
|
+
},
|
104
|
+
"html": {
|
105
|
+
"href": "https://bitbucket.org/dmexe"
|
106
|
+
},
|
107
|
+
"avatar": {
|
108
|
+
"href": "https://secure.gravatar.com/avatar/b155fd1e7432c77594588c79f49d2168?d=https%3A%2F%2Fd3oaxc4q5k2d6q.cloudfront.net%2Fm%2Fbc2c3d924a20%2Fimg%2Fdefault_avatar%2F32%2Fuser_blue.png&s=32"
|
109
|
+
}
|
110
|
+
}
|
111
|
+
},
|
112
|
+
"created_on": "2014-10-22T20:10:18.501731+00:00",
|
113
|
+
"participants": [
|
114
|
+
|
115
|
+
],
|
116
|
+
"updated_on": "2014-10-22T20:10:18.535203+00:00",
|
117
|
+
"merge_commit": null,
|
118
|
+
"closed_by": null
|
119
|
+
}
|
120
|
+
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
{
|
2
|
+
"pullrequest_declined": {
|
3
|
+
"description": "",
|
4
|
+
"title": "test pull request 2",
|
5
|
+
"destination": {
|
6
|
+
"commit": {
|
7
|
+
"hash": "7a715c783d90",
|
8
|
+
"links": {
|
9
|
+
"self": {
|
10
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/commit/7a715c783d90"
|
11
|
+
}
|
12
|
+
}
|
13
|
+
},
|
14
|
+
"branch": {
|
15
|
+
"name": "master"
|
16
|
+
},
|
17
|
+
"repository": {
|
18
|
+
"full_name": "login/api-test",
|
19
|
+
"links": {
|
20
|
+
"self": {
|
21
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test"
|
22
|
+
},
|
23
|
+
"html": {
|
24
|
+
"href": "https://bitbucket.org/login/api-test"
|
25
|
+
},
|
26
|
+
"avatar": {
|
27
|
+
"href": "https://d3oaxc4q5k2d6q.cloudfront.net/m/76ef4a8a61d5/img/language-avatars/ruby_16.png"
|
28
|
+
}
|
29
|
+
},
|
30
|
+
"name": "api-test"
|
31
|
+
}
|
32
|
+
},
|
33
|
+
"reason": "",
|
34
|
+
"source": {
|
35
|
+
"commit": {
|
36
|
+
"hash": "b8aed32b8a30",
|
37
|
+
"links": {
|
38
|
+
"self": {
|
39
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/commit/b8aed32b8a30"
|
40
|
+
}
|
41
|
+
}
|
42
|
+
},
|
43
|
+
"branch": {
|
44
|
+
"name": "fix"
|
45
|
+
},
|
46
|
+
"repository": {
|
47
|
+
"full_name": "login/api-test",
|
48
|
+
"links": {
|
49
|
+
"self": {
|
50
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test"
|
51
|
+
},
|
52
|
+
"html": {
|
53
|
+
"href": "https://bitbucket.org/login/api-test"
|
54
|
+
},
|
55
|
+
"avatar": {
|
56
|
+
"href": "https://d3oaxc4q5k2d6q.cloudfront.net/m/76ef4a8a61d5/img/language-avatars/ruby_16.png"
|
57
|
+
}
|
58
|
+
},
|
59
|
+
"name": "api-test"
|
60
|
+
}
|
61
|
+
},
|
62
|
+
"state": "DECLINED",
|
63
|
+
"author": {
|
64
|
+
"username": "login",
|
65
|
+
"display_name": "login",
|
66
|
+
"links": {
|
67
|
+
"self": {
|
68
|
+
"href": "https://bitbucket.org/api/2.0/users/login"
|
69
|
+
},
|
70
|
+
"html": {
|
71
|
+
"href": "https://bitbucket.org/login"
|
72
|
+
},
|
73
|
+
"avatar": {
|
74
|
+
"href": "https://secure.gravatar.com/avatar/760fd901769630ef0628e7064eb01fbd?d=https%3A%2F%2Fd3oaxc4q5k2d6q.cloudfront.net%2Fm%2F76ef4a8a61d5%2Fimg%2Fdefault_avatar%2F32%2Fuser_blue.png&s=32"
|
75
|
+
}
|
76
|
+
}
|
77
|
+
},
|
78
|
+
"date": "2014-10-16T09:32:29.057692+00:00"
|
79
|
+
}
|
80
|
+
}
|
@@ -0,0 +1,120 @@
|
|
1
|
+
{
|
2
|
+
"pullrequest_created": {
|
3
|
+
"description": "",
|
4
|
+
"links": {
|
5
|
+
"decline": {
|
6
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/pullrequests/5/decline"
|
7
|
+
},
|
8
|
+
"commits": {
|
9
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/pullrequests/5/commits"
|
10
|
+
},
|
11
|
+
"self": {
|
12
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/pullrequests/5"
|
13
|
+
},
|
14
|
+
"comments": {
|
15
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/pullrequests/5/comments"
|
16
|
+
},
|
17
|
+
"merge": {
|
18
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/pullrequests/5/merge"
|
19
|
+
},
|
20
|
+
"html": {
|
21
|
+
"href": "https://bitbucket.org/login/api-test/pull-request/5"
|
22
|
+
},
|
23
|
+
"activity": {
|
24
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/pullrequests/5/activity"
|
25
|
+
},
|
26
|
+
"diff": {
|
27
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/pullrequests/5/diff"
|
28
|
+
},
|
29
|
+
"approve": {
|
30
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/pullrequests/5/approve"
|
31
|
+
}
|
32
|
+
},
|
33
|
+
"title": "dddddddd",
|
34
|
+
"close_source_branch": false,
|
35
|
+
"reviewers": [
|
36
|
+
|
37
|
+
],
|
38
|
+
"destination": {
|
39
|
+
"commit": {
|
40
|
+
"hash": "7a715c783d90",
|
41
|
+
"links": {
|
42
|
+
"self": {
|
43
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test/commit/7a715c783d90"
|
44
|
+
}
|
45
|
+
}
|
46
|
+
},
|
47
|
+
"branch": {
|
48
|
+
"name": "master"
|
49
|
+
},
|
50
|
+
"repository": {
|
51
|
+
"full_name": "login/api-test",
|
52
|
+
"links": {
|
53
|
+
"self": {
|
54
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test"
|
55
|
+
},
|
56
|
+
"html": {
|
57
|
+
"href": "https://bitbucket.org/login/api-test"
|
58
|
+
},
|
59
|
+
"avatar": {
|
60
|
+
"href": "https://d3oaxc4q5k2d6q.cloudfront.net/m/76ef4a8a61d5/img/language-avatars/ruby_16.png"
|
61
|
+
}
|
62
|
+
},
|
63
|
+
"name": "api-test"
|
64
|
+
}
|
65
|
+
},
|
66
|
+
"state": "OPEN",
|
67
|
+
"id": 5,
|
68
|
+
"source": {
|
69
|
+
"commit": {
|
70
|
+
"hash": "b8aed32b8a30",
|
71
|
+
"links": {
|
72
|
+
"self": {
|
73
|
+
"href": "https://bitbucket.org/api/2.0/repositories/other_login/api-test/commit/b8aed32b8a30"
|
74
|
+
}
|
75
|
+
}
|
76
|
+
},
|
77
|
+
"branch": {
|
78
|
+
"name": "fix"
|
79
|
+
},
|
80
|
+
"repository": {
|
81
|
+
"full_name": "other_login/api-test",
|
82
|
+
"links": {
|
83
|
+
"self": {
|
84
|
+
"href": "https://bitbucket.org/api/2.0/repositories/login/api-test"
|
85
|
+
},
|
86
|
+
"html": {
|
87
|
+
"href": "https://bitbucket.org/login/api-test"
|
88
|
+
},
|
89
|
+
"avatar": {
|
90
|
+
"href": "https://d3oaxc4q5k2d6q.cloudfront.net/m/76ef4a8a61d5/img/language-avatars/ruby_16.png"
|
91
|
+
}
|
92
|
+
},
|
93
|
+
"name": "api-test"
|
94
|
+
}
|
95
|
+
},
|
96
|
+
"reason": "",
|
97
|
+
"author": {
|
98
|
+
"username": "login",
|
99
|
+
"display_name": "login",
|
100
|
+
"links": {
|
101
|
+
"self": {
|
102
|
+
"href": "https://bitbucket.org/api/2.0/users/login"
|
103
|
+
},
|
104
|
+
"html": {
|
105
|
+
"href": "https://bitbucket.org/login"
|
106
|
+
},
|
107
|
+
"avatar": {
|
108
|
+
"href": "https://secure.gravatar.com/avatar/760fd901769630ef0628e7064eb01fbd?d=https%3A%2F%2Fd3oaxc4q5k2d6q.cloudfront.net%2Fm%2F76ef4a8a61d5%2Fimg%2Fdefault_avatar%2F32%2Fuser_blue.png&s=32"
|
109
|
+
}
|
110
|
+
}
|
111
|
+
},
|
112
|
+
"created_on": "2014-10-16T09:35:02.083446+00:00",
|
113
|
+
"participants": [
|
114
|
+
|
115
|
+
],
|
116
|
+
"updated_on": "2014-10-16T09:35:02.389230+00:00",
|
117
|
+
"merge_commit": null,
|
118
|
+
"closed_by": null
|
119
|
+
}
|
120
|
+
}
|