Xcode cloud sentry tweaks (#1459)

* Increase the sentry log level used in debug symbol uploading

* Set sentry max http retries to 5

* Revert: set sentry max http retries to 5 as it doesn't work

* Implement automatic sentry_upload_dif retries
This commit is contained in:
Stefan Ceriu 2023-08-08 12:07:55 +03:00 committed by GitHub
parent dd6d1f6e63
commit 611baf194a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 23 deletions

View File

@ -6,6 +6,7 @@ before_all do
ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "180" ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "180"
ENV["FASTLANE_XCODE_LIST_TIMEOUT"] = "180" ENV["FASTLANE_XCODE_LIST_TIMEOUT"] = "180"
ENV["SENTRY_LOG_LEVEL"] = "DEBUG"
end end
lane :alpha do lane :alpha do
@ -183,6 +184,7 @@ lane :config_production do
xcodegen(spec: "project.yml") xcodegen(spec: "project.yml")
end end
$sentry_retry=0
lane :upload_dsyms_to_sentry do |options| lane :upload_dsyms_to_sentry do |options|
auth_token = ENV["SENTRY_AUTH_TOKEN"] auth_token = ENV["SENTRY_AUTH_TOKEN"]
UI.user_error!("Invalid Sentry Auth token.") unless !auth_token.to_s.empty? UI.user_error!("Invalid Sentry Auth token.") unless !auth_token.to_s.empty?
@ -190,13 +192,24 @@ lane :upload_dsyms_to_sentry do |options|
dsym_path = options[:dsym_path] dsym_path = options[:dsym_path]
UI.user_error!("Invalid DSYM path.") unless !dsym_path.to_s.empty? UI.user_error!("Invalid DSYM path.") unless !dsym_path.to_s.empty?
sentry_upload_dif( begin
auth_token: auth_token, sentry_upload_dif(
org_slug: 'element', auth_token: auth_token,
project_slug: 'element-x-ios', org_slug: 'element',
url: 'https://sentry.tools.element.io/', project_slug: 'element-x-ios',
path: dsym_path, url: 'https://sentry.tools.element.io/',
) path: dsym_path,
)
rescue => exception
$sentry_retry += 1
if $sentry_retry <= 5
UI.message "Sentry failed, retrying."
upload_dsyms_to_sentry options
else
raise exception
end
end
end end
lane :release_to_github do lane :release_to_github do

View File

@ -21,22 +21,6 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do
### app_store_release
```sh
[bundle exec] fastlane app_store_release
```
### build_release
```sh
[bundle exec] fastlane build_release
```
### unit_tests ### unit_tests
```sh ```sh