fastlane 2.205.0 → 2.206.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +96 -96
  3. data/cert/lib/cert/runner.rb +15 -7
  4. data/deliver/lib/deliver/options.rb +5 -0
  5. data/deliver/lib/deliver/runner.rb +47 -2
  6. data/fastlane/lib/fastlane/actions/.supply.rb.swp +0 -0
  7. data/fastlane/lib/fastlane/actions/danger.rb +14 -0
  8. data/fastlane/lib/fastlane/actions/run_tests.rb +1 -7
  9. data/fastlane/lib/fastlane/actions/setup_ci.rb +13 -4
  10. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +9 -0
  11. data/fastlane/lib/fastlane/cli_tools_distributor.rb +20 -0
  12. data/fastlane/lib/fastlane/version.rb +1 -1
  13. data/fastlane/swift/Deliverfile.swift +1 -1
  14. data/fastlane/swift/DeliverfileProtocol.swift +5 -1
  15. data/fastlane/swift/Fastlane.swift +39 -3
  16. data/fastlane/swift/Gymfile.swift +1 -1
  17. data/fastlane/swift/GymfileProtocol.swift +1 -1
  18. data/fastlane/swift/Matchfile.swift +1 -1
  19. data/fastlane/swift/MatchfileProtocol.swift +5 -1
  20. data/fastlane/swift/Precheckfile.swift +1 -1
  21. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  22. data/fastlane/swift/Scanfile.swift +1 -1
  23. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  24. data/fastlane/swift/Screengrabfile.swift +1 -1
  25. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  26. data/fastlane/swift/Snapshotfile.swift +1 -1
  27. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  28. data/fastlane/swift/formatting/Brewfile.lock.json +13 -13
  29. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +90 -0
  30. data/frameit/lib/frameit/device_types.rb +7 -0
  31. data/match/lib/match/importer.rb +3 -1
  32. data/match/lib/match/options.rb +5 -0
  33. data/match/lib/match/runner.rb +9 -3
  34. data/match/lib/match/storage/google_cloud_storage.rb +7 -6
  35. data/scan/lib/scan/options.rb +6 -1
  36. data/scan/lib/scan/runner.rb +10 -2
  37. data/sigh/lib/sigh/runner.rb +2 -1
  38. data/spaceship/lib/spaceship/connect_api/api_client.rb +10 -5
  39. data/spaceship/lib/spaceship/connect_api/models/app.rb +1 -2
  40. data/spaceship/lib/spaceship/connect_api/models/build_delivery.rb +2 -1
  41. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +1 -0
  42. data/spaceship/lib/spaceship/connect_api/models/user.rb +5 -0
  43. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +24 -2
  44. data/spaceship/lib/spaceship/connect_api/token.rb +5 -2
  45. data/spaceship/lib/spaceship/tunes/tunes_client.rb +7 -7
  46. data/trainer/lib/trainer/test_parser.rb +1 -1
  47. metadata +22 -23
  48. data/spaceship/lib/spaceship/.client.rb.swp +0 -0
  49. data/spaceship/lib/spaceship/tunes/.tunes_client.rb.swp +0 -0
@@ -48,7 +48,8 @@ module Match
48
48
  team_id: params[:team_id],
49
49
  team_name: params[:team_name],
50
50
  api_key_path: params[:api_key_path],
51
- api_key: params[:api_key]
51
+ api_key: params[:api_key],
52
+ skip_google_cloud_account_confirmation: params[:skip_google_cloud_account_confirmation]
52
53
  )
53
54
  end
54
55
 
@@ -62,7 +63,8 @@ module Match
62
63
  team_id: nil,
63
64
  team_name: nil,
64
65
  api_key_path: nil,
65
- api_key: nil)
66
+ api_key: nil,
67
+ skip_google_cloud_account_confirmation: nil)
66
68
  @type = type if type
67
69
  @platform = platform if platform
68
70
  @google_cloud_project_id = google_cloud_project_id if google_cloud_project_id
@@ -76,8 +78,7 @@ module Match
76
78
  @api_key_path = api_key_path
77
79
  @api_key = api_key
78
80
 
79
- @google_cloud_keys_file = ensure_keys_file_exists(google_cloud_keys_file, google_cloud_project_id)
80
-
81
+ @google_cloud_keys_file = ensure_keys_file_exists(google_cloud_keys_file, google_cloud_project_id, skip_google_cloud_account_confirmation)
81
82
  if self.google_cloud_keys_file.to_s.length > 0
82
83
  # Extract the Project ID from the `JSON` file
83
84
  # so the user doesn't have to provide it manually
@@ -223,7 +224,7 @@ module Match
223
224
 
224
225
  # This method will make sure the keys file exists
225
226
  # If it's missing, it will help the user set things up
226
- def ensure_keys_file_exists(google_cloud_keys_file, google_cloud_project_id)
227
+ def ensure_keys_file_exists(google_cloud_keys_file, google_cloud_project_id, skip_google_cloud_account_confirmation)
227
228
  if google_cloud_keys_file && File.exist?(google_cloud_keys_file)
228
229
  return google_cloud_keys_file
229
230
  end
@@ -251,7 +252,7 @@ module Match
251
252
  # we can continue and ask the user if they want to use a keys file.
252
253
  end
253
254
 
254
- if application_default_keys && UI.confirm("Do you want to use this system's Google Cloud application default keys?")
255
+ if application_default_keys && (skip_google_cloud_account_confirmation || UI.confirm("Do you want to use this system's Google Cloud application default keys?"))
255
256
  return nil
256
257
  end
257
258
  end
@@ -522,7 +522,12 @@ module Scan
522
522
  env_name: 'SCAN_NUMBER_OF_RETRIES',
523
523
  description: "The number of times a test can fail",
524
524
  type: Integer,
525
- default_value: 0)
525
+ default_value: 0),
526
+ FastlaneCore::ConfigItem.new(key: :fail_build,
527
+ env_name: "SCAN_FAIL_BUILD",
528
+ description: "Should this step stop the build if the tests fail? Set this to false if you're using trainer",
529
+ type: Boolean,
530
+ default_value: true)
526
531
 
527
532
  ]
528
533
  end
@@ -305,11 +305,19 @@ module Scan
305
305
  if number_of_failures > 0
306
306
  open_report
307
307
 
308
- UI.test_failure!("Tests have failed")
308
+ if Scan.config[:fail_build]
309
+ UI.test_failure!("Tests have failed")
310
+ else
311
+ UI.error("Tests have failed")
312
+ end
309
313
  end
310
314
 
311
315
  unless tests_exit_status == 0
312
- UI.test_failure!("Test execution failed. Exit status: #{tests_exit_status}")
316
+ if Scan.config[:fail_build]
317
+ UI.test_failure!("Test execution failed. Exit status: #{tests_exit_status}")
318
+ else
319
+ UI.error("Test execution failed. Exit status: #{tests_exit_status}")
320
+ end
313
321
  end
314
322
 
315
323
  open_report
@@ -251,7 +251,8 @@ module Sigh
251
251
  ]
252
252
  elsif profile_type == Spaceship::ConnectAPI::Profile::ProfileType::MAC_APP_DIRECT || profile_type == Spaceship::ConnectAPI::Profile::ProfileType::MAC_CATALYST_APP_DIRECT
253
253
  types = [
254
- Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPER_ID_APPLICATION
254
+ Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPER_ID_APPLICATION,
255
+ Spaceship::ConnectAPI::Certificate::CertificateType::DEVELOPER_ID_APPLICATION_G2
255
256
  ]
256
257
  else
257
258
  types = [
@@ -157,8 +157,6 @@ module Spaceship
157
157
  end
158
158
 
159
159
  def with_asc_retry(tries = 5, &_block)
160
- tries = 1 if Object.const_defined?("SpecHelper")
161
-
162
160
  response = yield
163
161
 
164
162
  status = response.status if response
@@ -170,9 +168,16 @@ module Spaceship
170
168
 
171
169
  return response
172
170
  rescue UnauthorizedAccessError => error
173
- # Catch unathorized access and re-raising
174
- # There is no need to try again
175
- raise error
171
+ tries -= 1
172
+ puts(error) if Spaceship::Globals.verbose?
173
+ if tries.zero?
174
+ raise error
175
+ else
176
+ msg = "Token has expired or has been revoked! Trying to refresh..."
177
+ puts(msg) if Spaceship::Globals.verbose?
178
+ @token.refresh!
179
+ retry
180
+ end
176
181
  rescue TimeoutRetryError => error
177
182
  tries -= 1
178
183
  puts(error) if Spaceship::Globals.verbose?
@@ -362,9 +362,8 @@ module Spaceship
362
362
  def get_build_deliveries(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
363
363
  client ||= Spaceship::ConnectAPI
364
364
  filter ||= {}
365
- filter[:app] = id
366
365
 
367
- resps = client.get_build_deliveries(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
366
+ resps = client.get_build_deliveries(app_id: id, filter: filter, includes: includes, limit: limit, sort: sort).all_pages
368
367
  return resps.flat_map(&:to_models)
369
368
  end
370
369
 
@@ -27,7 +27,8 @@ module Spaceship
27
27
  def self.all(client: nil, app_id: nil, version: nil, build_number: nil)
28
28
  client ||= Spaceship::ConnectAPI
29
29
  resps = client.get_build_deliveries(
30
- filter: { app: app_id, cfBundleShortVersionString: version, cfBundleVersion: build_number },
30
+ app_id: app_id,
31
+ filter: { cfBundleShortVersionString: version, cfBundleVersion: build_number },
31
32
  limit: 1
32
33
  ).all_pages
33
34
  return resps.flat_map(&:to_models)
@@ -41,6 +41,7 @@ module Spaceship
41
41
  MAC_APP_DEVELOPMENT = "MAC_APP_DEVELOPMENT"
42
42
  DEVELOPER_ID_KEXT = "DEVELOPER_ID_KEXT"
43
43
  DEVELOPER_ID_APPLICATION = "DEVELOPER_ID_APPLICATION"
44
+ DEVELOPER_ID_APPLICATION_G2 = "DEVELOPER_ID_APPLICATION_G2"
44
45
 
45
46
  # As of 2021-11-09, this is only available with Apple ID auth
46
47
  DEVELOPER_ID_INSTALLER = "DEVELOPER_ID_INSTALLER"
@@ -57,6 +57,11 @@ module Spaceship
57
57
  return all(client: client, filter: { email: email }, includes: includes)
58
58
  end
59
59
 
60
+ def delete!(client: nil)
61
+ client ||= Spaceship::ConnectAPI
62
+ client.delete_user(user_id: id)
63
+ end
64
+
60
65
  def get_visible_apps(client: nil, limit: nil)
61
66
  client ||= Spaceship::ConnectAPI
62
67
  resp = client.get_user_visible_apps(user_id: id, limit: limit)
@@ -290,6 +290,28 @@ module Spaceship
290
290
  test_flight_request_client.post("bulkBetaTesterAssignments", body)
291
291
  end
292
292
 
293
+ # attributes - {email: "", firstName: "", lastName: ""}
294
+ def post_beta_tester_assignment(beta_group_ids: [], attributes: {})
295
+ body = {
296
+ data: {
297
+ attributes: attributes,
298
+ relationships: {
299
+ betaGroups: {
300
+ data: beta_group_ids.map do |id|
301
+ {
302
+ type: "betaGroups",
303
+ id: id
304
+ }
305
+ end
306
+ }
307
+ },
308
+ type: "betaTesters"
309
+ }
310
+ }
311
+
312
+ test_flight_request_client.post("betaTesters", body)
313
+ end
314
+
293
315
  def add_beta_tester_to_group(beta_group_id: nil, beta_tester_ids: nil)
294
316
  beta_tester_ids || []
295
317
  body = {
@@ -448,9 +470,9 @@ module Spaceship
448
470
  # buildDeliveries
449
471
  #
450
472
 
451
- def get_build_deliveries(filter: {}, includes: nil, limit: nil, sort: nil)
473
+ def get_build_deliveries(app_id:, filter: {}, includes: nil, limit: nil, sort: nil)
452
474
  params = test_flight_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
453
- test_flight_request_client.get("buildDeliveries", params)
475
+ test_flight_request_client.get("apps/#{app_id}/buildDeliveries", params)
454
476
  end
455
477
 
456
478
  #
@@ -90,14 +90,17 @@ module Spaceship
90
90
  end
91
91
 
92
92
  def refresh!
93
- @expiration = Time.now + @duration
93
+ now = Time.now
94
+ @expiration = now + @duration
94
95
 
95
96
  header = {
96
- kid: key_id
97
+ kid: key_id,
98
+ typ: 'JWT'
97
99
  }
98
100
 
99
101
  payload = {
100
102
  iss: issuer_id,
103
+ iat: now.to_i,
101
104
  exp: @expiration.to_i,
102
105
  aud: 'appstoreconnect-v1'
103
106
  }
@@ -91,11 +91,11 @@ module Spaceship
91
91
  loop do
92
92
  puts("Multiple #{'App Store Connect teams'.yellow} found, please enter the number of the team you want to use: ")
93
93
  if ENV["FASTLANE_HIDE_TEAM_INFORMATION"].to_s.length == 0
94
+ first_team = teams.first
94
95
  puts("Note: to automatically choose the team, provide either the App Store Connect Team ID, or the Team Name in your fastlane/Appfile:")
95
96
  puts("Alternatively you can pass the team name or team ID using the `FASTLANE_ITC_TEAM_ID` or `FASTLANE_ITC_TEAM_NAME` environment variable")
96
- first_team = teams.first["contentProvider"]
97
97
  puts("")
98
- puts(" itc_team_id \"#{first_team['contentProviderId']}\"")
98
+ puts(" itc_team_id \"#{first_team['providerId']}\"")
99
99
  puts("")
100
100
  puts("or")
101
101
  puts("")
@@ -105,7 +105,7 @@ module Spaceship
105
105
 
106
106
  # We're not using highline here, as spaceship doesn't have a dependency to fastlane_core or highline
107
107
  teams.each_with_index do |team, i|
108
- puts("#{i + 1}) \"#{team['contentProvider']['name']}\" (#{team['contentProvider']['contentProviderId']})")
108
+ puts("#{i + 1}) \"#{team['name']}\" (#{team['providerId']})")
109
109
  end
110
110
 
111
111
  unless Spaceship::Client::UserInterface.interactive?
@@ -118,7 +118,7 @@ module Spaceship
118
118
  team_to_use = teams[selected] if selected >= 0
119
119
 
120
120
  if team_to_use
121
- self.team_id = team_to_use['contentProvider']['contentProviderId'].to_s # actually set the team id here
121
+ self.team_id = team_to_use['providerId'].to_s # actually set the team id here
122
122
  return self.team_id
123
123
  end
124
124
  end
@@ -984,7 +984,7 @@ module Spaceship
984
984
  tries -= 1
985
985
  if tries > 0
986
986
  logger.warn("Received temporary server error from App Store Connect. Retrying the request...")
987
- sleep(3) unless Object.const_defined?("SpecHelper")
987
+ sleep(3) unless Object.const_defined?(:SpecHelper)
988
988
  retry
989
989
  end
990
990
  end
@@ -1552,7 +1552,7 @@ module Spaceship
1552
1552
  msg = "App Store Connect temporary error received: '#{ex.message}'. Retrying after #{seconds_to_sleep} seconds (remaining: #{tries})..."
1553
1553
  puts(msg)
1554
1554
  logger.warn(msg)
1555
- sleep(seconds_to_sleep) unless Object.const_defined?("SpecHelper")
1555
+ sleep(seconds_to_sleep) unless Object.const_defined?(:SpecHelper)
1556
1556
  retry
1557
1557
  end
1558
1558
  raise ex # re-raise the exception
@@ -1562,7 +1562,7 @@ module Spaceship
1562
1562
  msg = "Potential server error received: '#{ex.message}'. Retrying after 10 seconds (remaining: #{potential_server_error_tries})..."
1563
1563
  puts(msg)
1564
1564
  logger.warn(msg)
1565
- sleep(seconds_to_sleep) unless Object.const_defined?("SpecHelper")
1565
+ sleep(seconds_to_sleep) unless Object.const_defined?(:SpecHelper)
1566
1566
  retry
1567
1567
  end
1568
1568
  raise ex
@@ -136,7 +136,7 @@ module Trainer
136
136
 
137
137
  # @return [Bool] were all tests successful? Is false if at least one test failed
138
138
  def tests_successful?
139
- self.data.collect { |a| a[:number_of_failures] }.all?(&:zero?)
139
+ self.data.collect { |a| a[:number_of_failures_excluding_retries] }.all?(&:zero?)
140
140
  end
141
141
 
142
142
  private
metadata CHANGED
@@ -1,39 +1,39 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.205.0
4
+ version: 2.206.0
5
5
  platform: ruby
6
6
  authors:
7
- - Łukasz Grabowski
8
- - Luka Mirosevic
9
- - Max Ott
10
- - Danielle Tomlinson
11
- - Andrew McBurney
12
- - Jérôme Lacoste
13
- - Manu Wallner
14
- - Stefan Natchev
15
- - Josh Holtz
7
+ - Satoshi Namai
16
8
  - Fumiya Nakamura
17
- - Helmut Januschka
18
- - Jimmy Dee
19
- - Maksym Grebenets
20
- - Daniel Jankowski
9
+ - Matthew Ellis
21
10
  - Roger Oba
22
- - Jorge Revuelta H
11
+ - Jimmy Dee
12
+ - Luka Mirosevic
23
13
  - Iulian Onofrei
24
- - Aaron Brager
25
- - Satoshi Namai
26
14
  - Jan Piotrowski
15
+ - Aaron Brager
16
+ - Maksym Grebenets
17
+ - Josh Holtz
18
+ - Danielle Tomlinson
19
+ - Daniel Jankowski
20
+ - Jérôme Lacoste
21
+ - Andrew McBurney
22
+ - Manish Rathi
27
23
  - Olivier Halligon
28
- - Matthew Ellis
29
- - Joshua Liebowitz
24
+ - Łukasz Grabowski
25
+ - Manu Wallner
26
+ - Jorge Revuelta H
27
+ - Stefan Natchev
30
28
  - Felix Krause
31
- - Manish Rathi
29
+ - Joshua Liebowitz
30
+ - Max Ott
32
31
  - Kohki Miki
32
+ - Helmut Januschka
33
33
  autorequire:
34
34
  bindir: bin
35
35
  cert_chain: []
36
- date: 2022-03-18 00:00:00.000000000 Z
36
+ date: 2022-05-18 00:00:00.000000000 Z
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: xcodeproj
@@ -1017,6 +1017,7 @@ files:
1017
1017
  - fastlane/lib/fastlane/action.rb
1018
1018
  - fastlane/lib/fastlane/action_collector.rb
1019
1019
  - fastlane/lib/fastlane/actions/.DS_Store
1020
+ - fastlane/lib/fastlane/actions/.supply.rb.swp
1020
1021
  - fastlane/lib/fastlane/actions/README.md
1021
1022
  - fastlane/lib/fastlane/actions/actions_helper.rb
1022
1023
  - fastlane/lib/fastlane/actions/adb.rb
@@ -1653,7 +1654,6 @@ files:
1653
1654
  - spaceship/lib/assets/languageMapping.json
1654
1655
  - spaceship/lib/assets/languageMappingReadable.json
1655
1656
  - spaceship/lib/spaceship.rb
1656
- - spaceship/lib/spaceship/.client.rb.swp
1657
1657
  - spaceship/lib/spaceship/base.rb
1658
1658
  - spaceship/lib/spaceship/client.rb
1659
1659
  - spaceship/lib/spaceship/commands_generator.rb
@@ -1780,7 +1780,6 @@ files:
1780
1780
  - spaceship/lib/spaceship/test_flight/group.rb
1781
1781
  - spaceship/lib/spaceship/test_flight/test_info.rb
1782
1782
  - spaceship/lib/spaceship/test_flight/tester.rb
1783
- - spaceship/lib/spaceship/tunes/.tunes_client.rb.swp
1784
1783
  - spaceship/lib/spaceship/tunes/app_analytics.rb
1785
1784
  - spaceship/lib/spaceship/tunes/app_details.rb
1786
1785
  - spaceship/lib/spaceship/tunes/app_image.rb
Binary file