vx-service_connector 0.2.17 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vx/service_connector/bitbucket/payload.rb +6 -2
- data/lib/vx/service_connector/github/notices.rb +1 -2
- data/lib/vx/service_connector/version.rb +1 -1
- data/spec/fixtures/bitbucket/payload/bug_1_empty_commits.json +18 -0
- data/spec/lib/bitbucket_payload_spec.rb +7 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4d16845570b8f0a590c3a650df7a166125ceed3
|
4
|
+
data.tar.gz: af38d8c131297173381eaf7665584c43a1cf567f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 048f1d236438443d4b24515e9d3896df1e971ab40b03cead9341b293d56440abbaac66c984f743a2669bceb655d876da318c1ca5cceaec6d240490ef48275821
|
7
|
+
data.tar.gz: a4c4faa4ff87610eca86bb38953aefb28f4d1fd612944339fbf58ae5949da282b3a6ee63250f93b8e5588ba1ee59f7d6ab32910b45130facac9aeae8dff83525
|
@@ -76,11 +76,15 @@ module Vx
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
+
def commits?
|
80
|
+
not params["commits"].empty?
|
81
|
+
end
|
82
|
+
|
79
83
|
def author_email
|
80
84
|
if pull_request?
|
81
85
|
commit_for_pull_request["author"]["raw"][/.*<([^>]*)/,1]
|
82
86
|
else
|
83
|
-
head_commit['raw_author'][/.*<([^>]*)/,1]
|
87
|
+
commits? && head_commit['raw_author'][/.*<([^>]*)/,1]
|
84
88
|
end
|
85
89
|
end
|
86
90
|
|
@@ -104,7 +108,7 @@ module Vx
|
|
104
108
|
if pull_request?
|
105
109
|
close_pull_request? || !foreign_pull_request?
|
106
110
|
else
|
107
|
-
sha == '0000000000000000000000000000000000000000'
|
111
|
+
sha == '0000000000000000000000000000000000000000' || !commits?
|
108
112
|
end
|
109
113
|
end
|
110
114
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"repository": {
|
3
|
+
"website": "",
|
4
|
+
"fork": false,
|
5
|
+
"name": "preacc",
|
6
|
+
"scm": "git",
|
7
|
+
"owner": "yeticoders",
|
8
|
+
"absolute_url": "/yeticoders/preacc/",
|
9
|
+
"slug": "preacc",
|
10
|
+
"is_private": true
|
11
|
+
},
|
12
|
+
"truncated": false,
|
13
|
+
"commits": [
|
14
|
+
|
15
|
+
],
|
16
|
+
"canon_url": "https://bitbucket.org",
|
17
|
+
"user": "eagleas"
|
18
|
+
}
|
@@ -79,4 +79,11 @@ describe Vx::ServiceConnector::Bitbucket::Payload do
|
|
79
79
|
its(:ignore?) { should be_true }
|
80
80
|
end
|
81
81
|
|
82
|
+
context 'push with empty commits' do
|
83
|
+
|
84
|
+
let(:content) { read_json_fixture 'bitbucket/payload/bug_1_empty_commits' }
|
85
|
+
|
86
|
+
its(:ignore?) { should be_true }
|
87
|
+
end
|
88
|
+
|
82
89
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vx-service_connector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Galinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -174,6 +174,7 @@ files:
|
|
174
174
|
- spec/fixtures/bitbucket/create_hook.json
|
175
175
|
- spec/fixtures/bitbucket/deploy_keys.json
|
176
176
|
- spec/fixtures/bitbucket/hooks.json
|
177
|
+
- spec/fixtures/bitbucket/payload/bug_1_empty_commits.json
|
177
178
|
- spec/fixtures/bitbucket/payload/created_pull_request.json
|
178
179
|
- spec/fixtures/bitbucket/payload/declined_pull_request.json
|
179
180
|
- spec/fixtures/bitbucket/payload/foreign_pull_request.json
|
@@ -262,6 +263,7 @@ test_files:
|
|
262
263
|
- spec/fixtures/bitbucket/create_hook.json
|
263
264
|
- spec/fixtures/bitbucket/deploy_keys.json
|
264
265
|
- spec/fixtures/bitbucket/hooks.json
|
266
|
+
- spec/fixtures/bitbucket/payload/bug_1_empty_commits.json
|
265
267
|
- spec/fixtures/bitbucket/payload/created_pull_request.json
|
266
268
|
- spec/fixtures/bitbucket/payload/declined_pull_request.json
|
267
269
|
- spec/fixtures/bitbucket/payload/foreign_pull_request.json
|