fastlane 2.168.0 → 2.169.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +84 -84
  3. data/cert/lib/cert/.options.rb.swp +0 -0
  4. data/cert/lib/cert/.runner.rb.swp +0 -0
  5. data/cert/lib/cert/options.rb +2 -2
  6. data/deliver/lib/deliver/loader.rb +136 -18
  7. data/deliver/lib/deliver/upload_metadata.rb +4 -10
  8. data/deliver/lib/deliver/upload_screenshots.rb +1 -64
  9. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +1 -1
  10. data/fastlane/lib/fastlane/actions/xcode_install.rb +8 -5
  11. data/fastlane/lib/fastlane/version.rb +1 -1
  12. data/fastlane/swift/Deliverfile.swift +1 -1
  13. data/fastlane/swift/DeliverfileProtocol.swift +1 -1
  14. data/fastlane/swift/Fastlane.swift +35 -14
  15. data/fastlane/swift/Gymfile.swift +1 -1
  16. data/fastlane/swift/GymfileProtocol.swift +5 -1
  17. data/fastlane/swift/Matchfile.swift +1 -1
  18. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  19. data/fastlane/swift/Precheckfile.swift +1 -1
  20. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  21. data/fastlane/swift/Scanfile.swift +1 -1
  22. data/fastlane/swift/ScanfileProtocol.swift +5 -1
  23. data/fastlane/swift/Screengrabfile.swift +1 -1
  24. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  25. data/fastlane/swift/Snapshotfile.swift +1 -1
  26. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  27. data/gym/lib/gym/generators/build_command_generator.rb +1 -0
  28. data/gym/lib/gym/options.rb +7 -1
  29. data/{spaceship/lib/spaceship/connect_api/models/.app_screenshot.rb.swp → match/lib/match/.options.rb.swp} +0 -0
  30. data/scan/lib/scan/options.rb +7 -1
  31. data/scan/lib/scan/test_command_generator.rb +1 -0
  32. data/{spaceship/lib/spaceship/connect_api/models/.build.rb.swp → sigh/lib/sigh/.options.rb.swp} +0 -0
  33. data/snapshot/lib/assets/SnapshotHelper.swift +5 -1
  34. data/spaceship/lib/spaceship/client.rb +14 -0
  35. data/spaceship/lib/spaceship/connect_api/models/app.rb +13 -4
  36. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +1 -0
  37. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +2 -0
  38. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +1 -0
  39. data/spaceship/lib/spaceship/errors.rb +19 -0
  40. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +18 -6
  41. metadata +22 -21
  42. data/spaceship/lib/spaceship/connect_api/models/.app.rb.swp +0 -0
@@ -184,4 +184,4 @@ public extension SnapshotfileProtocol {
184
184
 
185
185
  // Please don't remove the lines below
186
186
  // They are used to detect outdated files
187
- // FastlaneRunnerAPIVersion [0.9.43]
187
+ // FastlaneRunnerAPIVersion [0.9.44]
@@ -39,6 +39,7 @@ module Gym
39
39
  options << "-destination '#{config[:destination]}'" if config[:destination]
40
40
  options << "-archivePath #{archive_path.shellescape}" unless config[:skip_archive]
41
41
  options << "-resultBundlePath '#{result_bundle_path}'" if config[:result_bundle]
42
+ options << "-scmProvider system" if config[:use_system_scm]
42
43
  options << config[:xcargs] if config[:xcargs]
43
44
  options << "OTHER_SWIFT_FLAGS=\"-Xfrontend -debug-time-function-bodies\"" if config[:analyze_build_time]
44
45
 
@@ -279,7 +279,13 @@ module Gym
279
279
  env_name: "GYM_CLONED_SOURCE_PACKAGES_PATH",
280
280
  description: "Sets a custom path for Swift Package Manager dependencies",
281
281
  type: String,
282
- optional: true)
282
+ optional: true),
283
+ FastlaneCore::ConfigItem.new(key: :use_system_scm,
284
+ env_name: "GYM_USE_SYSTEM_SCM",
285
+ description: "Lets xcodebuild use system's scm configuration",
286
+ optional: true,
287
+ type: Boolean,
288
+ default_value: false)
283
289
  ]
284
290
  end
285
291
  end
@@ -445,7 +445,13 @@ module Scan
445
445
  env_name: "SCAN_CLONED_SOURCE_PACKAGES_PATH",
446
446
  description: "Sets a custom path for Swift Package Manager dependencies",
447
447
  type: String,
448
- optional: true)
448
+ optional: true),
449
+ FastlaneCore::ConfigItem.new(key: :use_system_scm,
450
+ env_name: "SCAN_USE_SYSTEM_SCM",
451
+ description: "Lets xcodebuild use system's scm configuration",
452
+ optional: true,
453
+ type: Boolean,
454
+ default_value: false)
449
455
 
450
456
  ]
451
457
  end
@@ -32,6 +32,7 @@ module Scan
32
32
 
33
33
  options = []
34
34
  options += project_path_array unless config[:xctestrun]
35
+ options << "-scmProvider system" if config[:use_system_scm]
35
36
  options << "-sdk '#{config[:sdk]}'" if config[:sdk]
36
37
  options << destination # generated in `detect_values`
37
38
  options << "-toolchain '#{config[:toolchain]}'" if config[:toolchain]
@@ -180,7 +180,11 @@ open class Snapshot: NSObject {
180
180
  simulator = regex.stringByReplacingMatches(in: simulator, range: range, withTemplate: "")
181
181
 
182
182
  let path = screenshotsDir.appendingPathComponent("\(simulator)-\(name).png")
183
- try image.pngData()?.write(to: path, options: .atomic)
183
+ #if swift(<5.0)
184
+ UIImagePNGRepresentation(image)?.write(to: path, options: .atomic)
185
+ #else
186
+ try image.pngData()?.write(to: path, options: .atomic)
187
+ #endif
184
188
  } catch let error {
185
189
  NSLog("Problem writing screenshot: \(name) to \(screenshotsDir)/\(simulator)-\(name).png")
186
190
  NSLog(error.localizedDescription)
@@ -57,6 +57,7 @@ module Spaceship
57
57
  InternalServerError = Spaceship::InternalServerError
58
58
  BadGatewayError = Spaceship::BadGatewayError
59
59
  AccessForbiddenError = Spaceship::AccessForbiddenError
60
+ TooManyRequestsError = Spaceship::TooManyRequestsError
60
61
 
61
62
  def self.hostname
62
63
  raise "You must implement self.hostname"
@@ -645,6 +646,17 @@ module Spaceship
645
646
  retry
646
647
  end
647
648
  raise ex # re-raise the exception
649
+ rescue TooManyRequestsError => ex
650
+ tries -= 1
651
+ unless tries.zero?
652
+ msg = "Timeout received: '#{ex.class}', '#{ex.message}'. Retrying after #{ex.retry_after} seconds (remaining: #{tries})..."
653
+ puts(msg) if Spaceship::Globals.verbose?
654
+ logger.warn(msg)
655
+
656
+ sleep(ex.retry_after) unless Object.const_defined?("SpecHelper")
657
+ retry
658
+ end
659
+ raise ex # re-raise the exception
648
660
  rescue \
649
661
  Faraday::ParsingError, # <h2>Internal Server Error</h2> with content type json
650
662
  InternalServerError => ex
@@ -873,6 +885,8 @@ module Spaceship
873
885
  msg = "Access forbidden"
874
886
  logger.warn(msg)
875
887
  raise AccessForbiddenError.new, msg
888
+ elsif resp_hash[:status] == 429
889
+ raise TooManyRequestsError, resp_hash
876
890
  end
877
891
 
878
892
  return response
@@ -117,7 +117,8 @@ module Spaceship
117
117
  Spaceship::ConnectAPI::AppInfo::AppStoreState::PENDING_APPLE_RELEASE,
118
118
  Spaceship::ConnectAPI::AppInfo::AppStoreState::PENDING_DEVELOPER_RELEASE,
119
119
  Spaceship::ConnectAPI::AppInfo::AppStoreState::PROCESSING_FOR_APP_STORE,
120
- Spaceship::ConnectAPI::AppInfo::AppStoreState::IN_REVIEW
120
+ Spaceship::ConnectAPI::AppInfo::AppStoreState::IN_REVIEW,
121
+ Spaceship::ConnectAPI::AppInfo::AppStoreState::DEVELOPER_REMOVED_FROM_SALE
121
122
  ]
122
123
 
123
124
  resp = client.get_app_infos(app_id: id, includes: includes)
@@ -230,7 +231,10 @@ module Spaceship
230
231
  client ||= Spaceship::ConnectAPI
231
232
  platform ||= Spaceship::ConnectAPI::Platform::IOS
232
233
  filter = {
233
- appStoreState: Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::READY_FOR_SALE,
234
+ appStoreState: [
235
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::READY_FOR_SALE,
236
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::DEVELOPER_REMOVED_FROM_SALE
237
+ ].join(","),
234
238
  platform: platform
235
239
  }
236
240
  return get_app_store_versions(client: client, filter: filter, includes: includes).first
@@ -282,8 +286,13 @@ module Spaceship
282
286
 
283
287
  def get_app_store_versions(client: nil, filter: {}, includes: Spaceship::ConnectAPI::AppStoreVersion::ESSENTIAL_INCLUDES, limit: nil, sort: nil)
284
288
  client ||= Spaceship::ConnectAPI
285
- resps = client.get_app_store_versions(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
286
- return resps.flat_map(&:to_models)
289
+ if limit.nil?
290
+ resps = client.get_app_store_versions(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
291
+ return resps.flat_map(&:to_models)
292
+ else
293
+ resp = client.get_app_store_versions(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
294
+ return resp.to_models
295
+ end
287
296
  end
288
297
 
289
298
  #
@@ -24,6 +24,7 @@ module Spaceship
24
24
  IN_REVIEW = "IN_REVIEW"
25
25
  WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
26
26
  DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
27
+ DEVELOPER_REMOVED_FROM_SALE = "DEVELOPER_REMOVED_FROM_SALE"
27
28
  REJECTED = "REJECTED"
28
29
  PREPARE_FOR_SUBMISSION = "PREPARE_FOR_SUBMISSION"
29
30
  METADATA_REJECTED = "METADATA_REJECTED"
@@ -8,6 +8,7 @@ module Spaceship
8
8
  attr_accessor :name
9
9
  attr_accessor :subtitle
10
10
  attr_accessor :privacy_policy_url
11
+ attr_accessor :privacy_choices_url
11
12
  attr_accessor :privacy_policy_text
12
13
 
13
14
  attr_mapping({
@@ -15,6 +16,7 @@ module Spaceship
15
16
  "name" => "name",
16
17
  "subtitle" => "subtitle",
17
18
  "privacyPolicyUrl" => "privacy_policy_url",
19
+ "privacyChoicesUrl" => "privacy_choices_url",
18
20
  "privacyPolicyText" => "privacy_policy_text"
19
21
  })
20
22
 
@@ -30,6 +30,7 @@ module Spaceship
30
30
  IN_REVIEW = "IN_REVIEW"
31
31
  WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
32
32
  DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
33
+ DEVELOPER_REMOVED_FROM_SALE = "DEVELOPER_REMOVED_FROM_SALE"
33
34
  REJECTED = "REJECTED"
34
35
  PREPARE_FOR_SUBMISSION = "PREPARE_FOR_SUBMISSION"
35
36
  METADATA_REJECTED = "METADATA_REJECTED"
@@ -43,6 +43,25 @@ module Spaceship
43
43
  end
44
44
  end
45
45
 
46
+ # Raised when 429 is received from App Store Connect
47
+ class TooManyRequestsError < BasicPreferredInfoError
48
+ attr_reader :retry_after
49
+ attr_reader :rate_limit_user
50
+
51
+ def initialize(resp_hash)
52
+ headers = resp_hash[:response_headers] || {}
53
+ @retry_after = (headers['retry-after'] || 60).to_i
54
+ @rate_limit_user = headers['x-daiquiri-rate-limit-user']
55
+ message = 'Apple 429 detected'
56
+ message += " - #{rate_limit_user}" if rate_limit_user
57
+ super(message)
58
+ end
59
+
60
+ def show_github_issues
61
+ false
62
+ end
63
+ end
64
+
46
65
  class UnexpectedResponse < StandardError
47
66
  attr_reader :error_info
48
67
 
@@ -134,18 +134,20 @@ module Spaceship
134
134
 
135
135
  phone_number = env_2fa_sms_default_phone_number
136
136
  phone_id = phone_id_from_number(response.body["trustedPhoneNumbers"], phone_number)
137
+ push_mode = push_mode_from_masked_number(response.body["trustedPhoneNumbers"], phone_number)
137
138
  # don't request sms if no trusted devices and env default is the only trusted number,
138
139
  # code was automatically sent
139
140
  should_request_code = !sms_automatically_sent(response)
140
141
  code_type = 'phone'
141
- body = request_two_factor_code_from_phone(phone_id, phone_number, code_length, should_request_code)
142
+ body = request_two_factor_code_from_phone(phone_id, phone_number, code_length, push_mode, should_request_code)
142
143
  elsif sms_automatically_sent(response) # sms fallback, code was automatically sent
143
144
  fallback_number = response.body["trustedPhoneNumbers"].first
144
145
  phone_number = fallback_number["numberWithDialCode"]
145
146
  phone_id = fallback_number["id"]
147
+ push_mode = fallback_number['pushMode']
146
148
 
147
149
  code_type = 'phone'
148
- body = request_two_factor_code_from_phone(phone_id, phone_number, code_length, false)
150
+ body = request_two_factor_code_from_phone(phone_id, phone_number, code_length, push_mode, false)
149
151
  elsif sms_fallback(response) # sms fallback but code wasn't sent bec > 1 phone number
150
152
  code_type = 'phone'
151
153
  body = request_two_factor_code_from_phone_choose(response.body["trustedPhoneNumbers"], code_length)
@@ -275,6 +277,15 @@ If it is, please open an issue at https://github.com/fastlane/fastlane/issues/ne
275
277
  end
276
278
  end
277
279
 
280
+ def push_mode_from_masked_number(phone_numbers, masked_number)
281
+ phone_numbers.each do |phone|
282
+ return phone['pushMode'] if phone['numberWithDialCode'] == masked_number
283
+ end
284
+
285
+ # If no pushMode was supplied, assume sms
286
+ return "sms"
287
+ end
288
+
278
289
  def request_two_factor_code_from_phone_choose(phone_numbers, code_length)
279
290
  puts("Please select a trusted phone number to send code to:")
280
291
 
@@ -283,18 +294,19 @@ If it is, please open an issue at https://github.com/fastlane/fastlane/issues/ne
283
294
  end
284
295
  chosen = choose_phone_number(available)
285
296
  phone_id = phone_id_from_masked_number(phone_numbers, chosen)
297
+ push_mode = push_mode_from_masked_number(phone_numbers, chosen)
286
298
 
287
- request_two_factor_code_from_phone(phone_id, chosen, code_length)
299
+ request_two_factor_code_from_phone(phone_id, chosen, code_length, push_mode)
288
300
  end
289
301
 
290
302
  # this is used in two places: after choosing a phone number and when a phone number is set via ENV var
291
- def request_two_factor_code_from_phone(phone_id, phone_number, code_length, should_request_code = true)
303
+ def request_two_factor_code_from_phone(phone_id, phone_number, code_length, push_mode = "sms", should_request_code = true)
292
304
  if should_request_code
293
305
  # Request code
294
306
  r = request(:put) do |req|
295
307
  req.url("https://idmsa.apple.com/appleauth/auth/verify/phone")
296
308
  req.headers['Content-Type'] = 'application/json'
297
- req.body = { "phoneNumber" => { "id" => phone_id }, "mode" => "sms" }.to_json
309
+ req.body = { "phoneNumber" => { "id" => phone_id }, "mode" => push_mode }.to_json
298
310
  update_request_headers(req)
299
311
  end
300
312
 
@@ -307,7 +319,7 @@ If it is, please open an issue at https://github.com/fastlane/fastlane/issues/ne
307
319
 
308
320
  code = ask_for_2fa_code("Please enter the #{code_length} digit code you received at #{phone_number}:")
309
321
 
310
- return { "securityCode" => { "code" => code.to_s }, "phoneNumber" => { "id" => phone_id }, "mode" => "sms" }.to_json
322
+ return { "securityCode" => { "code" => code.to_s }, "phoneNumber" => { "id" => phone_id }, "mode" => push_mode }.to_json
311
323
  end
312
324
 
313
325
  def store_session
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.168.0
4
+ version: 2.169.0
5
5
  platform: ruby
6
6
  authors:
7
- - Aaron Brager
8
- - Danielle Tomlinson
9
- - Matthew Ellis
7
+ - Jimmy Dee
8
+ - Stefan Natchev
10
9
  - Joshua Liebowitz
11
- - Felix Krause
12
- - Manu Wallner
13
- - Daniel Jankowski
14
- - Iulian Onofrei
15
- - Josh Holtz
16
- - Jérôme Lacoste
10
+ - Kohki Miki
11
+ - Danielle Tomlinson
17
12
  - Fumiya Nakamura
13
+ - Daniel Jankowski
14
+ - Manu Wallner
15
+ - Olivier Halligon
16
+ - Maksym Grebenets
18
17
  - Andrew McBurney
18
+ - Luka Mirosevic
19
+ - Felix Krause
20
+ - Iulian Onofrei
21
+ - Matthew Ellis
22
+ - Aaron Brager
19
23
  - Max Ott
24
+ - Helmut Januschka
20
25
  - Jan Piotrowski
26
+ - Jérôme Lacoste
21
27
  - Jorge Revuelta H
22
- - Stefan Natchev
23
- - Luka Mirosevic
24
- - Jimmy Dee
25
- - Maksym Grebenets
26
- - Kohki Miki
27
- - Helmut Januschka
28
- - Olivier Halligon
28
+ - Josh Holtz
29
29
  autorequire:
30
30
  bindir: bin
31
31
  cert_chain: []
32
- date: 2020-11-19 00:00:00.000000000 Z
32
+ date: 2020-12-01 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: slack-notifier
@@ -928,6 +928,8 @@ files:
928
928
  - bin/fastlane
929
929
  - cert/README.md
930
930
  - cert/lib/cert.rb
931
+ - cert/lib/cert/.options.rb.swp
932
+ - cert/lib/cert/.runner.rb.swp
931
933
  - cert/lib/cert/commands_generator.rb
932
934
  - cert/lib/cert/module.rb
933
935
  - cert/lib/cert/options.rb
@@ -1454,6 +1456,7 @@ files:
1454
1456
  - match/lib/assets/MatchfileTemplate.swift
1455
1457
  - match/lib/assets/READMETemplate.md
1456
1458
  - match/lib/match.rb
1459
+ - match/lib/match/.options.rb.swp
1457
1460
  - match/lib/match/change_password.rb
1458
1461
  - match/lib/match/commands_generator.rb
1459
1462
  - match/lib/match/encryption.rb
@@ -1563,6 +1566,7 @@ files:
1563
1566
  - sigh/README.md
1564
1567
  - sigh/lib/assets/resign.sh
1565
1568
  - sigh/lib/sigh.rb
1569
+ - sigh/lib/sigh/.options.rb.swp
1566
1570
  - sigh/lib/sigh/commands_generator.rb
1567
1571
  - sigh/lib/sigh/download_all.rb
1568
1572
  - sigh/lib/sigh/local_manage.rb
@@ -1619,10 +1623,7 @@ files:
1619
1623
  - spaceship/lib/spaceship/connect_api/client.rb
1620
1624
  - spaceship/lib/spaceship/connect_api/file_uploader.rb
1621
1625
  - spaceship/lib/spaceship/connect_api/model.rb
1622
- - spaceship/lib/spaceship/connect_api/models/.app.rb.swp
1623
- - spaceship/lib/spaceship/connect_api/models/.app_screenshot.rb.swp
1624
1626
  - spaceship/lib/spaceship/connect_api/models/.app_store_version_submission.rb.swp
1625
- - spaceship/lib/spaceship/connect_api/models/.build.rb.swp
1626
1627
  - spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb
1627
1628
  - spaceship/lib/spaceship/connect_api/models/app.rb
1628
1629
  - spaceship/lib/spaceship/connect_api/models/app_category.rb