From 31a7ce15b3ba9a62d352e0ffb9c54284473ad73a Mon Sep 17 00:00:00 2001 From: Avery Dingler Date: Wed, 26 Jun 2019 22:17:55 -0400 Subject: [PATCH 1/4] add timeout option and use when uploading build --- .../plugin/appcenter/actions/appcenter_upload_action.rb | 9 ++++++++- lib/fastlane/plugin/appcenter/helper/appcenter_helper.rb | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/fastlane/plugin/appcenter/actions/appcenter_upload_action.rb b/lib/fastlane/plugin/appcenter/actions/appcenter_upload_action.rb index b157941..1b63e17 100644 --- a/lib/fastlane/plugin/appcenter/actions/appcenter_upload_action.rb +++ b/lib/fastlane/plugin/appcenter/actions/appcenter_upload_action.rb @@ -102,6 +102,7 @@ module Fastlane release_notes = params[:release_notes] should_clip = params[:should_clip] release_notes_link = params[:release_notes_link] + timeout = params[:timeout] if release_notes.length >= Constants::MAX_RELEASE_NOTES_LENGTH unless should_clip @@ -129,7 +130,7 @@ module Fastlane upload_url = upload_details['upload_url'] UI.message("Uploading release binary...") - uploaded = Helper::AppcenterHelper.upload_build(api_token, owner_name, app_name, file, upload_id, upload_url) + uploaded = Helper::AppcenterHelper.upload_build(api_token, owner_name, app_name, file, upload_id, upload_url, timeout) if uploaded release_id = uploaded['release_id'] @@ -412,6 +413,12 @@ module Fastlane description: "The version number. Used (and required) for uploading Android ProGuard mapping file", optional: true, type: String), + + FastlaneCore::ConfigItem.new(key: :timeout, + env_name: "APPCENTER_TIMEOUT", + description: "Request timeout in seconds", + optional: true, + type: Integer), ] end diff --git a/lib/fastlane/plugin/appcenter/helper/appcenter_helper.rb b/lib/fastlane/plugin/appcenter/helper/appcenter_helper.rb index 11d96a8..114f372 100644 --- a/lib/fastlane/plugin/appcenter/helper/appcenter_helper.rb +++ b/lib/fastlane/plugin/appcenter/helper/appcenter_helper.rb @@ -125,7 +125,7 @@ module Fastlane end end - # committs or aborts symbol upload + # commits or aborts symbol upload def self.update_symbol_upload(api_token, owner_name, app_name, symbol_upload_id, status) connection = self.connection @@ -179,7 +179,7 @@ module Fastlane # upload binary for specified upload_url # if succeed, then commits the release # otherwise aborts - def self.upload_build(api_token, owner_name, app_name, file, upload_id, upload_url) + def self.upload_build(api_token, owner_name, app_name, file, upload_id, upload_url, timeout) connection = self.connection(upload_url) options = {} @@ -188,6 +188,7 @@ module Fastlane options[:ipa] = Faraday::UploadIO.new(file, 'application/octet-stream') if file && File.exist?(file) response = connection.post do |req| + req.options.timeout = timeout req.headers['internal-request-source'] = "fastlane" req.body = options end From 9e32ebeee55956dcb1bdf077f9146d2b411974c1 Mon Sep 17 00:00:00 2001 From: Avery Dingler Date: Wed, 26 Jun 2019 22:21:56 -0400 Subject: [PATCH 2/4] add timeout info to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9399986..f00b464 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ The action parameters `api_token` and `owner_name` can also be omitted when thei - `APPCENTER_DISTRIBUTE_RELEASE_NOTES` - Release notes - `APPCENTER_DISTRIBUTE_RELEASE_NOTES_CLIPPING` - Clip release notes if its length is more then 5000, `true` by default - `APPCENTER_DISTRIBUTE_RELEASE_NOTES_LINK` - Additional release notes link +- `APPCENTER_TIMEOUT` - Sets the request timeout in seconds. Used when uploading builds to App Center. ## Example From 714ea5e25d01ee373b8f92845978227329684c1c Mon Sep 17 00:00:00 2001 From: Avery Dingler Date: Thu, 27 Jun 2019 17:38:41 -0400 Subject: [PATCH 3/4] update timeout option name --- README.md | 2 +- .../plugin/appcenter/actions/appcenter_upload_action.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f00b464..04d87f9 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ The action parameters `api_token` and `owner_name` can also be omitted when thei - `APPCENTER_DISTRIBUTE_RELEASE_NOTES` - Release notes - `APPCENTER_DISTRIBUTE_RELEASE_NOTES_CLIPPING` - Clip release notes if its length is more then 5000, `true` by default - `APPCENTER_DISTRIBUTE_RELEASE_NOTES_LINK` - Additional release notes link -- `APPCENTER_TIMEOUT` - Sets the request timeout in seconds. Used when uploading builds to App Center. +- `APPCENTER_DISTRIBUTE_TIMEOUT` - Sets the request timeout in seconds. Used when uploading builds to App Center. ## Example diff --git a/lib/fastlane/plugin/appcenter/actions/appcenter_upload_action.rb b/lib/fastlane/plugin/appcenter/actions/appcenter_upload_action.rb index 1b63e17..c8b9d75 100644 --- a/lib/fastlane/plugin/appcenter/actions/appcenter_upload_action.rb +++ b/lib/fastlane/plugin/appcenter/actions/appcenter_upload_action.rb @@ -415,7 +415,7 @@ module Fastlane type: String), FastlaneCore::ConfigItem.new(key: :timeout, - env_name: "APPCENTER_TIMEOUT", + env_name: "APPCENTER_DISTRIBUTE_TIMEOUT", description: "Request timeout in seconds", optional: true, type: Integer), From f78aaa7b3e8a7053213a39c278369b224bb6dfba Mon Sep 17 00:00:00 2001 From: Evgenii Khramkov Date: Tue, 9 Jul 2019 09:05:07 -0700 Subject: [PATCH 4/4] release 1.1.1 --- lib/fastlane/plugin/appcenter/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fastlane/plugin/appcenter/version.rb b/lib/fastlane/plugin/appcenter/version.rb index ee2d8c3..35d9fd2 100644 --- a/lib/fastlane/plugin/appcenter/version.rb +++ b/lib/fastlane/plugin/appcenter/version.rb @@ -1,5 +1,5 @@ module Fastlane module Appcenter - VERSION = "1.1.0" + VERSION = "1.1.1" end end