fastlane-plugin-firebase_app_distribution 0.10.1 → 0.10.2.pre.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 789a32fce54326215942dfb99d0bb843887a36d84ca3ecfc474d4408b02c103d
4
- data.tar.gz: f2d3b26d638efddc8920e9df5b01bbb4efa176e26d91a33cb8ab781b2996ac11
3
+ metadata.gz: e3ac8eeeed71d57e777bcee0a974d0d23a1093a9d427b591150300c5cd8c36ff
4
+ data.tar.gz: 483d71f41ff6aee5b1da54a5308b89c3180d2bacdc1e0d58d24d6dd175340af6
5
5
  SHA512:
6
- metadata.gz: 72c6db99756504fc29a2e5ef24baf600a5bb13ddb3758385b240876fc5d3cf891c5c9bdc7037400aa3272d5aefe1fd2cdb2f2ea677b0dfa12f9fab78636012d3
7
- data.tar.gz: d8a9c0d7ffc1d44813d8f97944d3db5dc3d3bf0eedfb4af3f89d4353d4bb3483a7ce4e7ae39bd502f1a302cc2ac94572ddee07842974644bbff0e9d02cf25cec
6
+ metadata.gz: 2d8faa2d8fa9f3f9e6d776d4373644c47799fdca0497b2d07b73bef6b26ed6eaefa641e19ce9e0a8e4f50f881b4e972502d74c1c074e2d4272079693e6a42ef7
7
+ data.tar.gz: 6d38932bfc8842483e31706cdf116a11dfa1798c6ab0fb40dc769c8dda8ac73c4804f569c5ac1cd7c1a96676543d5288ba2de4453602ad94604b4dd466b14686
@@ -21,6 +21,7 @@ module Fastlane
21
21
  extend Helper::FirebaseAppDistributionHelper
22
22
 
23
23
  DEFAULT_UPLOAD_TIMEOUT_SECONDS = 300
24
+ DEFAULT_UPLOAD_RETRIES = 3
24
25
  UPLOAD_MAX_POLLING_RETRIES = 60
25
26
  UPLOAD_POLLING_INTERVAL_SECONDS = 5
26
27
  TEST_MAX_POLLING_RETRIES = 40
@@ -33,6 +34,7 @@ module Fastlane
33
34
  app_name = app_name_from_app_id(app_id)
34
35
  platform = lane_platform || platform_from_app_id(app_id)
35
36
  timeout = get_upload_timeout(params)
37
+ retries = get_upload_retries(params)
36
38
 
37
39
  binary_path = get_binary_path(platform, params)
38
40
  UI.user_error!("Couldn't determine path for #{platform} binary.") if binary_path.nil?
@@ -57,7 +59,7 @@ module Fastlane
57
59
 
58
60
  binary_type = binary_type_from_path(binary_path)
59
61
  UI.message("📡 Uploading the #{binary_type}.")
60
- operation = upload_binary(client, app_name, binary_path, binary_type, timeout)
62
+ operation = upload_binary(client, app_name, binary_path, binary_type, timeout, retries)
61
63
  UI.message("🕵️ Validating upload…")
62
64
  release = poll_upload_release_operation(client, operation, binary_type)
63
65
 
@@ -185,6 +187,14 @@ module Fastlane
185
187
  end
186
188
  end
187
189
 
190
+ def self.get_upload_retries(params)
191
+ if params[:upload_retries]
192
+ return params[:upload_retries]
193
+ else
194
+ return DEFAULT_UPLOAD_RETRIES
195
+ end
196
+ end
197
+
188
198
  def self.validate_aab_setup!(aab_info)
189
199
  if aab_info && aab_info.integration_state != 'INTEGRATED' && aab_info.integration_state != 'AAB_STATE_UNAVAILABLE'
190
200
  case aab_info.integration_state
@@ -252,27 +262,15 @@ module Fastlane
252
262
  extract_release(operation)
253
263
  end
254
264
 
255
- def self.upload_binary(client, app_name, binary_path, binary_type, timeout)
256
- options = Google::Apis::RequestOptions.new
257
- options.max_elapsed_time = timeout # includes retries (default = no retries)
265
+ def self.upload_binary(client, app_name, binary_path, binary_type, timeout, retries)
266
+ options = Google::Apis::RequestOptions.new(max_elapsed_time: timeout, retries: retries)
258
267
  options.header = {
259
268
  'Content-Type' => 'application/octet-stream',
260
- 'X-Goog-Upload-File-Name' => CGI.escape(File.basename(binary_path)),
261
- 'X-Goog-Upload-Protocol' => 'raw'
269
+ 'X-Goog-Upload-File-Name' => CGI.escape(File.basename(binary_path))
262
270
  }
263
271
 
264
- # For some reason calling the client.upload_medium returns nil when
265
- # it should return a long running operation object, so we make a
266
- # standard http call instead and convert it to a long running object
267
- # https://github.com/googleapis/google-api-ruby-client/blob/main/generated/google-apis-firebaseappdistribution_v1/lib/google/apis/firebaseappdistribution_v1/service.rb#L79
268
- # TODO(kbolay): Prefer client.upload_medium
269
- response = begin
270
- client.http(
271
- :post,
272
- "https://firebaseappdistribution.googleapis.com/upload/v1/#{app_name}/releases:upload",
273
- body: File.open(binary_path, 'rb'),
274
- options: options
275
- )
272
+ begin
273
+ client.upload_medium(app_name, File.open(binary_path, 'rb'), upload_source: binary_path, options: options)
276
274
  rescue Google::Apis::Error => err
277
275
  case err.status_code.to_i
278
276
  when 403
@@ -281,8 +279,6 @@ module Fastlane
281
279
  UI.crash!("#{ErrorMessage.upload_binary_error(binary_type)} (#{err}, status_code: #{err.status_code})")
282
280
  end
283
281
  end
284
-
285
- Google::Apis::FirebaseappdistributionV1::GoogleLongrunningOperation.from_json(response)
286
282
  end
287
283
 
288
284
  def self.extract_release(operation)
@@ -505,10 +501,15 @@ module Fastlane
505
501
 
506
502
  # Release Distribution
507
503
  FastlaneCore::ConfigItem.new(key: :upload_timeout,
508
- description: "Amount of seconds before the upload will timeout, if not completed",
504
+ description: "Amount of seconds before the upload will timeout, if not completed",
509
505
  optional: true,
510
506
  default_value: DEFAULT_UPLOAD_TIMEOUT_SECONDS,
511
507
  type: Integer),
508
+ FastlaneCore::ConfigItem.new(key: :upload_retries,
509
+ description: "Maximum number of times the upload will retry, if not completed",
510
+ optional: true,
511
+ default_value: DEFAULT_UPLOAD_RETRIES,
512
+ type: Integer),
512
513
  FastlaneCore::ConfigItem.new(key: :groups,
513
514
  env_name: "FIREBASEAPPDISTRO_GROUPS",
514
515
  description: "Group aliases used for distribution, separated by commas",
@@ -11,7 +11,7 @@ module ErrorMessage
11
11
  GET_RELEASE_TIMEOUT = "App Distribution failed to fetch release information."
12
12
  REFRESH_TOKEN_ERROR = "App Distribution could not generate credentials from the refresh token specified."
13
13
  APP_NOT_ONBOARDED_ERROR = "App Distribution not onboarded."
14
- INVALID_APP_ID = "App Distribution could not find your app. Make sure to onboard your app by pressing the \"Get started\" button on the App Distribution page in the Firebase console: https://console.firebase.google.com/project/_/appdistribution. App ID"
14
+ INVALID_APP_ID = "App Distribution could not find your app. Make sure to onboard your app by pressing the \"Get started\" button on the App Distribution page in the Firebase console: https://console.firebase.google.com/project/_/appdistribution."
15
15
  INVALID_PROJECT = "App Distribution could not find your Firebase project. Make sure to onboard an app in your project by pressing the \"Get started\" button on the App Distribution page in the Firebase console: https://console.firebase.google.com/project/_/appdistribution."
16
16
  INVALID_PATH = "Could not read content from"
17
17
  INVALID_TESTERS = "Could not enable access for testers. Check that the tester emails are formatted correctly, the groups exist and you are using group aliases (not group names) for specifying groups."
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module FirebaseAppDistribution
3
- VERSION = "0.10.1"
3
+ VERSION = "0.10.2.pre.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-firebase_app_distribution
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Natchev
@@ -9,7 +9,7 @@ authors:
9
9
  - Alonso Salas Infante
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-04-14 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-apis-firebaseappdistribution_v1
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  requirements: []
210
- rubygems_version: 3.6.2
210
+ rubygems_version: 3.6.9
211
211
  specification_version: 4
212
212
  summary: Release your beta builds to Firebase App Distribution. https://firebase.google.com/docs/app-distribution
213
213
  test_files: []