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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca471671e75ec4f31500012af36283b453356fb9
4
- data.tar.gz: 9da8cbc4717cf7207a59d25623951a4b6c338e62
3
+ metadata.gz: c4d16845570b8f0a590c3a650df7a166125ceed3
4
+ data.tar.gz: af38d8c131297173381eaf7665584c43a1cf567f
5
5
  SHA512:
6
- metadata.gz: 3fa7febab44227d34e6b89d7ddcadaa4973461c43988bc4487d41fab7a559d1d99ab5109e7b2f390f906840e3199b9d6a925f25af3055ad4ebf17705783ba9f5
7
- data.tar.gz: a8ffd9fc3ed0457e7f6d8c68d05cf95f5311c2952ee6e0a6f800648f1af9fcab2f118dd20edb2d525d41dd6c48fc6ec42d7712c42e172b0fb3e55d4a4ef07ca2
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
 
@@ -13,8 +13,7 @@ module Vx
13
13
  description: description,
14
14
  target_url: build_url
15
15
  )
16
- rescue Octokit::UnprocessableEntity => e
17
- STDERR.puts "ERROR: #{e.inspect}"
16
+ rescue Octokit::UnprocessableEntity, Octokit::Unauthorized
18
17
  end
19
18
  end
20
19
  end
@@ -1,5 +1,5 @@
1
1
  module Vx
2
2
  module ServiceConnector
3
- VERSION = "0.2.17"
3
+ VERSION = "0.2.18"
4
4
  end
5
5
  end
@@ -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.17
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-10-24 00:00:00.000000000 Z
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