fastlane 2.150.0.rc2 → 2.150.0.rc7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/deliver/lib/deliver/download_screenshots.rb +48 -26
  3. data/deliver/lib/deliver/runner.rb +4 -1
  4. data/deliver/lib/deliver/submit_for_review.rb +26 -7
  5. data/deliver/lib/deliver/upload_metadata.rb +18 -2
  6. data/deliver/lib/deliver/upload_screenshots.rb +34 -8
  7. data/fastlane/lib/fastlane/actions/.hockey.rb.swp +0 -0
  8. data/fastlane/lib/fastlane/actions/.slack.rb.swp +0 -0
  9. data/fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp +0 -0
  10. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +4 -0
  11. data/fastlane/lib/fastlane/version.rb +1 -1
  12. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  13. data/fastlane_core/lib/fastlane_core/build_watcher.rb +4 -4
  14. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +89 -52
  15. data/pilot/lib/pilot/.manager.rb.swp +0 -0
  16. data/produce/lib/produce/itunes_connect.rb +29 -2
  17. data/spaceship/lib/spaceship/{.DS_Store → connect_api/.DS_Store} +0 -0
  18. data/spaceship/lib/spaceship/connect_api/client.rb +1 -1
  19. data/spaceship/lib/spaceship/connect_api/file_uploader.rb +42 -10
  20. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +1 -1
  21. data/spaceship/lib/spaceship/connect_api/models/app.rb +47 -9
  22. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +4 -0
  23. data/spaceship/lib/spaceship/connect_api/models/app_preview.rb +62 -10
  24. data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +2 -2
  25. data/spaceship/lib/spaceship/connect_api/models/app_review_attachment.rb +18 -28
  26. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +86 -37
  27. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +26 -2
  28. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +20 -1
  29. data/spaceship/lib/spaceship/connect_api/models/user.rb +2 -1
  30. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +21 -9
  31. data/spaceship/lib/spaceship/connect_api/users/users.rb +13 -0
  32. metadata +12 -7
@@ -1,5 +1,8 @@
1
1
  require_relative '../model'
2
2
  require_relative '../file_uploader'
3
+ require 'spaceship/globals'
4
+
5
+ require 'digest/md5'
3
6
 
4
7
  module Spaceship
5
8
  class ConnectAPI
@@ -15,36 +18,6 @@ module Spaceship
15
18
  attr_accessor :asset_delivery_state
16
19
  attr_accessor :uploaded
17
20
 
18
- # "fileSize": 92542,
19
- # "fileName": "ftl_3241d62418767c0aa9b889b020c4f8db_45455763d4aaf7b18ee0045bc787f3de.png",
20
- # "sourceFileChecksum": "c237fd7852ed8f9285d16d9a28d2ec25",
21
- # "imageAsset": {
22
- # "templateUrl": "https://is4-ssl.mzstatic.com/image/thumb/Purple113/v4/61/18/68/61186886-b234-5bd0-1f4a-563124f18511/pr_source.png/{w}x{h}bb.{f}",
23
- # "width": 2048,
24
- # "height": 2732
25
- # },
26
- # "assetToken": "Purple113/v4/61/18/68/61186886-b234-5bd0-1f4a-563124f18511/pr_source.png",
27
- # "assetType": "SortedJ99ScreenShot",
28
- # "uploadOperations": null,
29
- # "assetDeliveryState": {
30
- # "errors": [],
31
- # "warnings": null,
32
- # "state": "COMPLETE"
33
- # },
34
- # "uploaded": null
35
-
36
- # "assetDeliveryState": {
37
- # "errors": [],
38
- # "warnings": null,
39
- # "state": "AWAITING_UPLOAD"
40
- # },
41
-
42
- # "assetDeliveryState": {
43
- # "errors": [],
44
- # "warnings": null,
45
- # "state": "UPLOAD_COMPLETE"
46
- # },
47
-
48
21
  attr_mapping({
49
22
  "fileName" => "file_name",
50
23
  "sourceFileChecksum" => "source_file_checksum",
@@ -60,33 +33,109 @@ module Spaceship
60
33
  return "appScreenshots"
61
34
  end
62
35
 
36
+ def complete?
37
+ (asset_delivery_state || {})["state"] == "COMPLETE"
38
+ end
39
+
40
+ def error?
41
+ (asset_delivery_state || {})["state"] == "FAILED"
42
+ end
43
+
44
+ def error_messages
45
+ errors = (asset_delivery_state || {})["errors"]
46
+ (errors || []).map do |error|
47
+ [error["code"], error["description"]].compact.join(" - ")
48
+ end
49
+ end
50
+
51
+ # This does not download the source image (exact image that was uploaded)
52
+ # This downloads a modified version.
53
+ # This image won't have the same checksums as source_file_checksum.
54
+ #
55
+ # There is an open radar for allowing downloading of source file.
56
+ # https://openradar.appspot.com/radar?id=4980344105205760
57
+ def image_asset_url(width: nil, height: nil, type: "png")
58
+ return nil if image_asset.nil?
59
+
60
+ template_url = image_asset["templateUrl"]
61
+ width ||= image_asset["width"]
62
+ height ||= image_asset["height"]
63
+
64
+ return template_url
65
+ .gsub("{w}", width.to_s)
66
+ .gsub("{h}", height.to_s)
67
+ .gsub("{f}", type)
68
+ end
69
+
63
70
  #
64
71
  # API
65
72
  #
73
+ #
66
74
 
67
- def self.create(app_screenshot_set_id: nil, path: nil)
75
+ def self.create(app_screenshot_set_id: nil, path: nil, wait_for_processing: true)
68
76
  require 'faraday'
69
77
 
70
78
  filename = File.basename(path)
71
79
  filesize = File.size(path)
72
- payload = File.binread(path)
80
+ bytes = File.binread(path)
73
81
 
74
82
  post_attributes = {
75
83
  fileSize: filesize,
76
84
  fileName: filename
77
85
  }
78
86
 
79
- post_resp = Spaceship::ConnectAPI.post_app_screenshot(app_screenshot_set_id: app_screenshot_set_id, attributes: post_attributes).to_models.first
87
+ # Create placeholder
88
+ screenshot = Spaceship::ConnectAPI.post_app_screenshot(
89
+ app_screenshot_set_id: app_screenshot_set_id,
90
+ attributes: post_attributes
91
+ ).first
80
92
 
81
- upload_operation = post_resp.upload_operations.first
82
- Spaceship::ConnectAPI::FileUploader.upload(upload_operation, payload)
93
+ # Upload the file
94
+ upload_operations = screenshot.upload_operations
95
+ Spaceship::ConnectAPI::FileUploader.upload(upload_operations, bytes)
83
96
 
97
+ # Update file uploading complete
84
98
  patch_attributes = {
85
99
  uploaded: true,
86
- sourceFileChecksum: "checksum-holder"
100
+ sourceFileChecksum: Digest::MD5.hexdigest(bytes)
87
101
  }
88
102
 
89
- Spaceship::ConnectAPI.patch_app_screenshot(app_screenshot_id: post_resp.id, attributes: patch_attributes).to_models.first
103
+ # Patch screenshot that file upload is complete
104
+ # Catch error if patch retries due to 504. Origal patch
105
+ # may go through by return response as 504.
106
+ begin
107
+ screenshot = Spaceship::ConnectAPI.patch_app_screenshot(
108
+ app_screenshot_id: screenshot.id,
109
+ attributes: patch_attributes
110
+ ).first
111
+ rescue => error
112
+ puts("Failed to patch app screenshot. Update may have gone through so verifying") if Spaceship::Globals.verbose?
113
+
114
+ screenshot = Spaceship::ConnectAPI.get_app_screenshot(app_screenshot_id: screenshot.id).first
115
+ raise error unless screenshot.complete?
116
+ end
117
+
118
+ # Wait for processing
119
+ if wait_for_processing
120
+ loop do
121
+ if screenshot.complete?
122
+ puts("Screenshot processing complete!") if Spaceship::Globals.verbose?
123
+ break
124
+ elsif screenshot.error?
125
+ messages = ["Error processing screenshot '#{screenshot.file_name}'"] + screenshot.error_messages
126
+ raise messages.join(". ")
127
+ end
128
+
129
+ # Poll every 2 seconds
130
+ sleep_time = 2
131
+ puts("Waiting #{sleep_time} seconds before checking status of processing...") if Spaceship::Globals.verbose?
132
+ sleep(sleep_time)
133
+
134
+ screenshot = Spaceship::ConnectAPI.get_app_screenshot(app_screenshot_id: screenshot.id).first
135
+ end
136
+ end
137
+
138
+ return screenshot
90
139
  end
91
140
 
92
141
  def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
@@ -39,8 +39,24 @@ module Spaceship
39
39
  APP_WATCH_SERIES_3 = "APP_WATCH_SERIES_3"
40
40
  APP_WATCH_SERIES_4 = "APP_WATCH_SERIES_4"
41
41
 
42
+ APP_APPLE_TV = "APP_APPLE_TV"
43
+
42
44
  APP_DESKTOP = "APP_DESKTOP"
43
45
 
46
+ ALL_IMESSAGE = [
47
+ IMESSAGE_APP_IPHONE_40,
48
+ IMESSAGE_APP_IPHONE_47,
49
+ IMESSAGE_APP_IPHONE_55,
50
+ IMESSAGE_APP_IPHONE_58,
51
+ IMESSAGE_APP_IPHONE_65,
52
+
53
+ IMESSAGE_APP_IPAD_97,
54
+ IMESSAGE_APP_IPAD_105,
55
+ IMESSAGE_APP_IPAD_PRO_129,
56
+ IMESSAGE_APP_IPAD_PRO_3GEN_11,
57
+ IMESSAGE_APP_IPAD_PRO_3GEN_129
58
+ ]
59
+
44
60
  ALL = [
45
61
  APP_IPHONE_35,
46
62
  APP_IPHONE_40,
@@ -84,6 +100,14 @@ module Spaceship
84
100
  return "appScreenshotSets"
85
101
  end
86
102
 
103
+ def apple_tv?
104
+ DisplayType::APP_APPLE_TV == screenshot_display_type
105
+ end
106
+
107
+ def imessage?
108
+ DisplayType::ALL_IMESSAGE.include?(screenshot_display_type)
109
+ end
110
+
87
111
  #
88
112
  # API
89
113
  #
@@ -93,8 +117,8 @@ module Spaceship
93
117
  return resp.to_models
94
118
  end
95
119
 
96
- def upload_screenshot(path: nil)
97
- return Spaceship::ConnectAPI::AppScreenshot.create(app_screenshot_set_id: id, path: path)
120
+ def upload_screenshot(path: nil, wait_for_processing: true)
121
+ return Spaceship::ConnectAPI::AppScreenshot.create(app_screenshot_set_id: id, path: path, wait_for_processing: wait_for_processing)
98
122
  end
99
123
  end
100
124
  end
@@ -19,13 +19,19 @@ module Spaceship
19
19
  attr_accessor :downloadable
20
20
  attr_accessor :created_date
21
21
 
22
+ attr_accessor :app_store_version_submission
23
+
22
24
  module AppStoreState
23
25
  READY_FOR_SALE = "READY_FOR_SALE"
26
+ PROCESSING_FOR_APP_STORE = "PROCESSING_FOR_APP_STORE"
27
+ PENDING_DEVELOPER_RELEASE = "PENDING_DEVELOPER_RELEASE"
28
+ IN_REVIEW = "IN_REVIEW"
24
29
  WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
25
30
  DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
26
31
  REJECTED = "REJECTED"
27
32
  PREPARE_FOR_SUBMISSION = "PREPARE_FOR_SUBMISSION"
28
33
  METADATA_REJECTED = "METADATA_REJECTED"
34
+ INVALID_BINARY = "INVALID_BINARY"
29
35
  end
30
36
 
31
37
  module ReleaseType
@@ -46,13 +52,26 @@ module Spaceship
46
52
  "usesIdfa" => "uses_idfa",
47
53
  "isWatchOnly" => "is_watch_only",
48
54
  "downloadable" => "downloadable",
49
- "createdDate" => "created_date"
55
+ "createdDate" => "created_date",
56
+
57
+ "appStoreVersionSubmission" => "app_store_version_submission"
50
58
  })
51
59
 
52
60
  def self.type
53
61
  return "appStoreVersions"
54
62
  end
55
63
 
64
+ def can_reject?
65
+ raise "No app_store_version_submission included" unless app_store_version_submission
66
+ return app_store_version_submission.can_reject
67
+ end
68
+
69
+ def reject!
70
+ return false unless can_reject?
71
+ app_store_version_submission.delete!
72
+ return true
73
+ end
74
+
56
75
  #
57
76
  # API
58
77
  #
@@ -39,7 +39,8 @@ module Spaceship
39
39
  #
40
40
 
41
41
  def self.all(filter: {}, includes: nil, limit: nil, sort: nil)
42
- return Spaceship::ConnectAPI.get_users(filter: filter, includes: includes)
42
+ resps = Spaceship::ConnectAPI.get_users(filter: filter, includes: includes).all_pages
43
+ return resps.flat_map(&:to_models)
43
44
  end
44
45
 
45
46
  def self.find(email: nil, includes: nil)
@@ -28,7 +28,7 @@ module Spaceship
28
28
  # app
29
29
  #
30
30
 
31
- def post_app(name: nil, version_string: nil, sku: nil, primary_locale: nil, bundle_id: nil, platforms: nil, territory_ids: nil, available_in_new_territories: true)
31
+ def post_app(name: nil, version_string: nil, sku: nil, primary_locale: nil, bundle_id: nil, platforms: nil, company_name: nil)
32
32
  included = []
33
33
  included << {
34
34
  type: "appInfos",
@@ -103,15 +103,17 @@ module Spaceship
103
103
  }
104
104
  }
105
105
 
106
+ app_attributes = {
107
+ sku: sku,
108
+ primaryLocale: primary_locale,
109
+ bundleId: bundle_id
110
+ }
111
+ app_attributes[:companyName] = company_name if company_name
112
+
106
113
  body = {
107
114
  data: {
108
115
  type: "apps",
109
- attributes: {
110
- sku: sku,
111
- primaryLocale: primary_locale,
112
- bundleId: bundle_id,
113
- availableInNewTerritories: !!available_in_new_territories
114
- },
116
+ attributes: app_attributes,
115
117
  relationships: relationships
116
118
  },
117
119
  included: included
@@ -189,6 +191,11 @@ module Spaceship
189
191
  # appPreview
190
192
  #
191
193
 
194
+ def get_app_preview(app_preview_id: nil)
195
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
196
+ Client.instance.get("appPreviews/#{app_preview_id}", params)
197
+ end
198
+
192
199
  def post_app_preview(app_preview_set_id: nil, attributes: {})
193
200
  body = {
194
201
  data: {
@@ -339,6 +346,11 @@ module Spaceship
339
346
  # appScreenshots
340
347
  #
341
348
 
349
+ def get_app_screenshot(app_screenshot_id: nil)
350
+ params = Client.instance.build_params(filter: nil, includes: nil, limit: nil, sort: nil)
351
+ Client.instance.get("appScreenshots/#{app_screenshot_id}", params)
352
+ end
353
+
342
354
  def post_app_screenshot(app_screenshot_set_id: nil, attributes: {})
343
355
  body = {
344
356
  data: {
@@ -379,9 +391,9 @@ module Spaceship
379
391
  # appInfos
380
392
  #
381
393
 
382
- def get_app_infos(app_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
394
+ def get_app_infos(filter: {}, includes: nil, limit: nil, sort: nil)
383
395
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
384
- Client.instance.get("apps/#{app_id}/appInfos", params)
396
+ Client.instance.get("appInfos", params)
385
397
  end
386
398
 
387
399
  def patch_app_info(app_info_id: nil, attributes: {})
@@ -11,6 +11,19 @@ module Spaceship
11
11
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
12
12
  Client.instance.get("users", params)
13
13
  end
14
+
15
+ def add_user_visible_apps(user_id: nil, app_ids: nil)
16
+ body = {
17
+ data: app_ids.map do |app_id|
18
+ {
19
+ type: "apps",
20
+ id: app_id
21
+ }
22
+ end
23
+ }
24
+
25
+ Client.instance.post("users/#{user_id}/relationships/visibleApps", body)
26
+ end
14
27
  end
15
28
  end
16
29
  end
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.150.0.rc2
4
+ version: 2.150.0.rc7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manu Wallner
@@ -26,10 +26,10 @@ authors:
26
26
  - Aaron Brager
27
27
  - Josh Holtz
28
28
  - Joshua Liebowitz
29
- autorequire:
29
+ autorequire:
30
30
  bindir: bin
31
31
  cert_chain: []
32
- date: 2020-06-25 00:00:00.000000000 Z
32
+ date: 2020-07-01 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: slack-notifier
@@ -1013,6 +1013,9 @@ files:
1013
1013
  - fastlane/lib/fastlane.rb
1014
1014
  - fastlane/lib/fastlane/action.rb
1015
1015
  - fastlane/lib/fastlane/action_collector.rb
1016
+ - fastlane/lib/fastlane/actions/.hockey.rb.swp
1017
+ - fastlane/lib/fastlane/actions/.slack.rb.swp
1018
+ - fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp
1016
1019
  - fastlane/lib/fastlane/actions/README.md
1017
1020
  - fastlane/lib/fastlane/actions/actions_helper.rb
1018
1021
  - fastlane/lib/fastlane/actions/adb.rb
@@ -1349,6 +1352,7 @@ files:
1349
1352
  - fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj
1350
1353
  - fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
1351
1354
  - fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
1355
+ - fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate
1352
1356
  - fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme
1353
1357
  - fastlane/swift/FastlaneSwiftRunner/README.txt
1354
1358
  - fastlane/swift/Gymfile.swift
@@ -1505,6 +1509,7 @@ files:
1505
1509
  - pem/lib/pem/options.rb
1506
1510
  - pilot/README.md
1507
1511
  - pilot/lib/pilot.rb
1512
+ - pilot/lib/pilot/.manager.rb.swp
1508
1513
  - pilot/lib/pilot/build_manager.rb
1509
1514
  - pilot/lib/pilot/commands_generator.rb
1510
1515
  - pilot/lib/pilot/features.rb
@@ -1632,12 +1637,12 @@ files:
1632
1637
  - spaceship/lib/assets/languageMapping.json
1633
1638
  - spaceship/lib/assets/languageMappingReadable.json
1634
1639
  - spaceship/lib/spaceship.rb
1635
- - spaceship/lib/spaceship/.DS_Store
1636
1640
  - spaceship/lib/spaceship/babosa_fix.rb
1637
1641
  - spaceship/lib/spaceship/base.rb
1638
1642
  - spaceship/lib/spaceship/client.rb
1639
1643
  - spaceship/lib/spaceship/commands_generator.rb
1640
1644
  - spaceship/lib/spaceship/connect_api.rb
1645
+ - spaceship/lib/spaceship/connect_api/.DS_Store
1641
1646
  - spaceship/lib/spaceship/connect_api/client.rb
1642
1647
  - spaceship/lib/spaceship/connect_api/file_uploader.rb
1643
1648
  - spaceship/lib/spaceship/connect_api/model.rb
@@ -1809,7 +1814,7 @@ licenses:
1809
1814
  - MIT
1810
1815
  metadata:
1811
1816
  docs_url: https://docs.fastlane.tools
1812
- post_install_message:
1817
+ post_install_message:
1813
1818
  rdoc_options: []
1814
1819
  require_paths:
1815
1820
  - credentials_manager/lib
@@ -1841,8 +1846,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1841
1846
  - !ruby/object:Gem::Version
1842
1847
  version: 1.3.1
1843
1848
  requirements: []
1844
- rubygems_version: 3.0.6
1845
- signing_key:
1849
+ rubygems_version: 3.0.3
1850
+ signing_key:
1846
1851
  specification_version: 4
1847
1852
  summary: The easiest way to automate beta deployments and releases for your iOS and
1848
1853
  Android apps