fastlane 2.54.0.beta.20170818010002 → 2.54.0.beta.20170819010003

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: 31f9f6b75b0447f30db831da38095ef3345a17a8
4
- data.tar.gz: 3cfe94056b73a9d8c54262c62d134a4ebc6489df
3
+ metadata.gz: aa60520a646d56ac9ebd6c8fc6140053cae322a0
4
+ data.tar.gz: 0b1d7bc82b5e0053a73e6fcb58d1af7422edfe7e
5
5
  SHA512:
6
- metadata.gz: 8212eb5a555c454e525c53264811ee6ea3b758e61d0ebcadcd7bf8fa3b7b6aab9faa43f64a3487d4db7d4042f50f592d1f5935be216f6da632ed924fe5361d6f
7
- data.tar.gz: 9ac733a3f8a14e9230d6b92d403f53ad677287b382f56ad9ae830828deed0c2c33f982d8ed8d16f871cdffea23884294cc09c626e66f7e4e6d741cab53999e87
6
+ metadata.gz: 38a18c29a23bb28aafb75028f6133ed4b213550848c6fd26fecbadd02bc3e11d84d9e81a4a3d6957d2afd39c5aa82a8487064afbf12ec12b5cef1fe5b12cf5a4
7
+ data.tar.gz: 8ac94195d4046a98e71d880f6e9046d82a8dc09cba32a1aa202ab2d474c2bbf90364c682d81be7a70d301bf49b377ac462c8e8a6148ef0202d75eec529a5a798
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.54.0.beta.20170818010002'.freeze
2
+ VERSION = '2.54.0.beta.20170819010003'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  MINIMUM_XCODE_RELEASE = "7.0".freeze
5
5
  end
@@ -10,6 +10,10 @@ module Spaceship
10
10
  class ITunesConnectTemporaryError < ITunesConnectError
11
11
  end
12
12
 
13
+ # raised if the server failed to save, and it might be caused by an invisible server error
14
+ class ITunesConnectPotentialServerError < ITunesConnectError
15
+ end
16
+
13
17
  attr_reader :du_client
14
18
 
15
19
  def initialize
@@ -108,7 +112,9 @@ module Spaceship
108
112
  end
109
113
 
110
114
  # rubocop:disable Metrics/PerceivedComplexity
111
- def handle_itc_response(raw)
115
+ # If the response is coming from a flaky api, set flaky_api_call to true so we retry a little.
116
+ # Patience is a virtue.
117
+ def handle_itc_response(raw, flaky_api_call: false)
112
118
  return unless raw
113
119
  return unless raw.kind_of? Hash
114
120
 
@@ -164,6 +170,8 @@ module Spaceship
164
170
  raise ITunesConnectTemporaryError.new, errors.first
165
171
  elsif errors.count == 1 and errors.first.include?("Forbidden")
166
172
  raise_insuffient_permission_error!
173
+ elsif flaky_api_call
174
+ raise ITunesConnectPotentialServerError.new, errors.join(' ')
167
175
  else
168
176
  raise ITunesConnectError.new, errors.join(' ')
169
177
  end
@@ -343,7 +351,7 @@ module Spaceship
343
351
  req.headers['Content-Type'] = 'application/json'
344
352
  end
345
353
 
346
- handle_itc_response(r.body)
354
+ handle_itc_response(r.body, flaky_api_call: true)
347
355
  end
348
356
  end
349
357
 
@@ -1315,7 +1323,7 @@ module Spaceship
1315
1323
 
1316
1324
  private
1317
1325
 
1318
- def with_tunes_retry(tries = 5, &_block)
1326
+ def with_tunes_retry(tries = 5, potential_server_error_tries = 3, &_block)
1319
1327
  return yield
1320
1328
  rescue Spaceship::TunesClient::ITunesConnectTemporaryError => ex
1321
1329
  unless (tries -= 1).zero?
@@ -1326,6 +1334,15 @@ module Spaceship
1326
1334
  retry
1327
1335
  end
1328
1336
  raise ex # re-raise the exception
1337
+ rescue Spaceship::TunesClient::ITunesConnectPotentialServerError => ex
1338
+ unless (potential_server_error_tries -= 1).zero?
1339
+ msg = "Potential server error received: '#{ex.message}'. Retrying after 10 seconds (remaining: #{tries})..."
1340
+ puts msg
1341
+ logger.warn msg
1342
+ sleep 10 unless defined? SpecHelper # unless FastlaneCore::Helper.is_test?
1343
+ retry
1344
+ end
1345
+ raise ex
1329
1346
  end
1330
1347
 
1331
1348
  def clear_user_cached_data
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.54.0.beta.20170818010002
4
+ version: 2.54.0.beta.20170819010003
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2017-08-18 00:00:00.000000000 Z
18
+ date: 2017-08-19 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: slack-notifier