Skip to content

Commit

Permalink
Retry on http status unauthorized (#152)
Browse files Browse the repository at this point in the history
Similar workaround to fastlane/fastlane#21507 (comment).
Retry HTTP calls when 401 is (randomly) returned by Google, that causes customer impact.
  • Loading branch information
lpusok authored Sep 18, 2023
1 parent 2049e42 commit 19a3fb5
Show file tree
Hide file tree
Showing 855 changed files with 130,028 additions and 32,464 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.bitrise*
_tmp/
.idea
steps-google-play-deploy
1 change: 0 additions & 1 deletion .gows.user.yml

This file was deleted.

1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Configs struct {
Status string `env:"status"`
RetryWithoutSendingToReview bool `env:"retry_without_sending_to_review,opt[true,false]"`
AckBundleInstallationWarning bool `env:"ack_bundle_installation_warning,opt[true,false]"`
IsDebugLog bool `env:"verbose_log,opt[true,false]"`
}

// validate validates the Configs.
Expand Down
26 changes: 7 additions & 19 deletions e2e/bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ app:
- GOOGLE_PLAY_SERVICE_ACCOUNT_KEY_URL: $GOOGLE_PLAY_SERVICE_ACCOUNT_KEY_URL

workflows:
test_multiple_aab_deploy:
test_wearos_deploy:
summary: Builds and deploys a main app and a wearable app as AAB
envs:
- TEST_APP_URL: https://github.com/bitrise-io/sample-apps-wear-os.git
Expand All @@ -30,7 +30,7 @@ workflows:
- PACKAGE_NAME: io.bitrise.android.sample_xyztouristattractions

- SERVICE_ACCOUNT_KEY_URL: $GOOGLE_PLAY_SERVICE_ACCOUNT_KEY_URL
- TRACK: internal
- TRACK: wear:internal
before_run:
- _setup
steps:
Expand All @@ -48,26 +48,11 @@ workflows:
set -ex
envman add --key VERSION_CODE --value $(( $BITRISE_BUILD_NUMBER * 10 ))
- change-android-versioncode-and-versionname:
inputs:
- new_version_code: $VERSION_CODE
- version_code_offset: "0"
- build_gradle_path: $BITRISE_SOURCE_DIR/Application/build.gradle
- change-android-versioncode-and-versionname:
inputs:
- new_version_code: $VERSION_CODE
- version_code_offset: "1"
- build_gradle_path: $BITRISE_SOURCE_DIR/Wearable/build.gradle
- android-build:
title: Build main app
inputs:
- variant: release
- build_type: aab
- module: Application
- sign-apk:
inputs:
- android_app: $BITRISE_AAB_PATH
- use_apk_signer: true
- android-build:
title: Build wearable app
inputs:
Expand All @@ -87,9 +72,10 @@ workflows:
inputs:
- service_account_json_key_path: $SERVICE_ACCOUNT_KEY_URL
- package_name: $PACKAGE_NAME
- app_path: $BITRISE_DEPLOY_DIR/Wearable-release-bitrise-signed.aab|$BITRISE_DEPLOY_DIR/Application-release-bitrise-signed.aab
- app_path: $BITRISE_DEPLOY_DIR/Wearable-release-bitrise-signed.aab
- track: $TRACK
- mapping_file: $BITRISE_DEPLOY_DIR/Wearable-mapping.txt|$BITRISE_DEPLOY_DIR/Application-mapping.txt
- mapping_file: $BITRISE_DEPLOY_DIR/Wearable-mapping.txt
- verbose_log: true

test_aab_deploy:
envs:
Expand Down Expand Up @@ -133,6 +119,7 @@ workflows:
- track: $TRACK
- user_fraction: 0.6
- release_name: Overwritten release name
- verbose_log: true

test_apk_deploy_custom_track:
summary: Tests deploying an APK to a user-defined track
Expand Down Expand Up @@ -179,6 +166,7 @@ workflows:
- mapping_file: ""
- user_fraction: ""
- retry_without_sending_to_review: true
- verbose_log: true
_setup:
steps:
- script:
Expand Down
40 changes: 29 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
module github.com/bitrise-steplib/steps-google-play-deploy

go 1.16
go 1.20

require (
cloud.google.com/go v0.90.0 // indirect
github.com/bitrise-io/go-steputils v0.0.0-20210527075147-910ce7a105a1
github.com/bitrise-io/go-utils v0.0.0-20210713111255-08be784d45d0
github.com/bitrise-io/go-steputils v1.0.6
github.com/bitrise-io/go-utils v1.0.9
github.com/stretchr/testify v1.8.4
golang.org/x/oauth2 v0.12.0
google.golang.org/api v0.141.0
)

require (
cloud.google.com/go/compute v1.23.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
github.com/stretchr/testify v1.7.0
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e // indirect
google.golang.org/api v0.52.0
google.golang.org/genproto v0.0.0-20210809142519-0135a39c2737 // indirect
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect
google.golang.org/grpc v1.58.1 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 19a3fb5

Please sign in to comment.