Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

appetize action reports successful upload when upload has actually failed #21786

Closed
4 tasks done
benferris-tl opened this issue Jan 5, 2024 · 1 comment · Fixed by #21816
Closed
4 tasks done

appetize action reports successful upload when upload has actually failed #21786

benferris-tl opened this issue Jan 5, 2024 · 1 comment · Fixed by #21816

Comments

@benferris-tl
Copy link
Contributor

New Issue Checklist

Issue Description

When using the appetize action it reports that the build has successfully uploaded when in reality the Appetize API returned an error response. This can happen when an invalid API token or public key is used.

Command executed

bundle exec fastlane run appetize api_token:"my_invalid_token" public_key:"my_invalid_key" path:"(valid path to an apk)" platform:"android"

Complete output when running fastlane, including the stack trace and command used
 
[14:14:21]: ----------------------
[14:14:21]: --- Step: appetize ---
[14:14:21]: ----------------------
[14:14:21]: Uploading apk to appetize... this might take a while
[14:14:27]: App URL: 
[14:14:27]: Manage URL: 
[14:14:27]: Public Key: 
[14:14:27]: Build successfully uploaded to Appetize.io
[14:14:27]: Result: true

Environment

 
✅ fastlane environment ✅

Stack

Key Value
OS 14.2
Ruby 2.7.6
Bundler? true
Git git version 2.41.0
Installation Source ~/.rbenv/versions/2.7.6/bin/fastlane
Host macOS 14.2 (23C64)
Ruby Lib Dir ~/.rbenv/versions/2.7.6/lib
OpenSSL Version OpenSSL 1.1.1n 15 Mar 2022
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode-15.0.1.app/Contents/Developer/
Xcode Version 15.0.1
Swift Version 5.9

System Locale

Variable Value
LANG
LC_ALL en_US.UTF-8
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
# Comment out the next line if you do not want fastlane to automatically update itself
# update_fastlane

default_platform(:android)

platform :android do

  desc "Run Lint for Dev Debug"
  lane :lint_dev_debug do
    build_android_app(
      task: "lint", 
      flavor: "Dev", 
      build_type: "Debug"
    )
  end

  desc "Runs all Dev Debug tests"
  lane :test_dev_debug do
    build_android_app(
      task: "test", 
      flavor: "Dev", 
      build_type: "DebugUnitTest"
    )
  end

  desc "Assemble Dev Debug"
  lane :assemble_dev_debug do
    build_android_app(
      task: "assemble", 
      flavor: "Dev", 
      build_type: "Debug"
    )
  end

  desc "Assemble White Label Debug"
  lane :assemble_white_label_debug do
    build_android_app(
      task: "assemble", 
      flavor: ENV["FLAVOR"], 
      build_type: "Debug"
    )
  end

  desc "Assemble Kraken Debug"
  lane :assemble_kraken_debug do
    build_android_app(
      task: "assemble", 
      flavor: "Kraken", 
      build_type: "Debug"
    )
  end

  desc "Assemble Mamlambo Debug"
  lane :assemble_mamlambo_debug do
    build_android_app(
      task: "assemble", 
      flavor: "Mamlambo", 
      build_type: "Debug"
    )
  end

  desc "Submit a Dev Debug build to Firebase Distribution"
  lane :distribute_dev_debug_to_firebase do
    firebase_app_distribution(
      app: ENV["FIREBASE_APP_ID_DEV"],
      groups: ENV["FIREBASE_GROUP"],
      release_notes: git_branch,
    )
  end

  desc "Assemble Stage Debug"
  lane :assemble_stage_debug do
    build_android_app(
      task: "assemble",
      flavor: "Stage",
      build_type: "Debug"
    )
  end

  desc "Submit a Stage Debug build to Firebase Distribution"
  lane :distribute_stage_debug_to_firebase do
    firebase_app_distribution(
      app: ENV["FIREBASE_APP_ID_STAGE"],
      groups: ENV["FIREBASE_GROUP"],
      release_notes: git_branch,
    )
  end

  desc "Deploy Release to Google Play"
  lane :deploy_release do
    build_android_app(
      task: "assemble",
      flavor: ENV["FLAVOR"],
      build_type: ENV["RELEASE_BUILD_TYPE"]
    )
    build_android_app(
      task: "bundle",
      flavor: ENV["FLAVOR"],
      build_type: ENV["RELEASE_BUILD_TYPE"]
    )
    upload_to_play_store(
      package_name: ENV["PACKAGE_NAME"],
      json_key: ENV["JSON_KEY_PATH"],
      aab: ENV["AAB_DIRECTORY"],
      track: ENV["TRACK"],
      rollout: ".5",
      skip_upload_apk: true,
      skip_upload_images: true,
      skip_upload_screenshots: true,
      skip_upload_metadata: true
    )
  end

  desc "Generate screenshots"
  lane :create_screenshots do
    build_android_app(
      task: "assemble",
      flavor: ENV["FLAVOR"],
      build_type: "Debug"
    )
    build_android_app(
      task: "assemble",
      flavor: ENV["FLAVOR"],
      build_type: "DebugAndroidTest"
    )
    screengrab
  end

  desc "Clean Directory"
  lane :clean do 
    build_android_app(
      task: "clean"
    )
  end

  desc "Distribute TransLoc Dev Debug To Firebase"
  lane :distribute_transloc_dev_debug do
    clean
    lint_dev_debug
    test_dev_debug
    assemble_dev_debug
    distribute_dev_debug_to_firebase
  end

  desc "Distribute TransLoc Stage To Firebase"
  lane :distribute_transloc_stage do
    clean
    assemble_stage_debug
    distribute_stage_debug_to_firebase
  end

  desc "Distribute Kraken Debug"
  lane :distribute_kraken_debug do
    clean
    assemble_kraken_debug
  end

  desc "Distribute Mamlambo Debug"
  lane :distribute_mamlambo_debug do
    clean
    assemble_mamlambo_debug
  end

  desc "Tag TransLoc Release"
  lane :tag_transloc_release do
    clean
    test_dev_debug
    assemble_stage_debug
    distribute_stage_debug_to_firebase
    deploy_release
    upload_to_appetize
  end

  desc "Tag White Label"
  lane :tag_white_label do
    clean
    deploy_release
  end

  desc "Upload Sample White Label"
  lane :upload_sample_white_label do
    clean
    build_android_app(
      task: "assemble",
      flavor: ENV["FLAVOR"],
      build_type: ENV["RELEASE_BUILD_TYPE"]
    )
    upload_to_appetize
  end

  desc "Upload to Appetize"
  lane :upload_to_appetize do
    appetize(
      platform: "android",
      path: ENV["APK_DIRECTORY"],
      api_token: ENV["APPETIZE_API_TOKEN"],
      public_key: ENV["APPETIZE_PUBLIC_KEY"]
    )
  end

end

No Appfile found

fastlane gems

Gem Version Update-Status
fastlane 2.219.0 ✅ Up-To-Date

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-firebase_app_distribution 0.8.0 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.4.0
bundler 2.3.15
uri 0.10.0
rake 13.1.0
rexml 3.2.6
CFPropertyList 3.0.6
public_suffix 5.0.4
addressable 2.8.6
artifactory 3.0.15
atomos 0.1.3
aws-eventstream 1.3.0
aws-partitions 1.877.0
aws-sigv4 1.8.0
jmespath 1.6.2
aws-sdk-core 3.190.1
aws-sdk-kms 1.75.0
aws-sdk-s3 1.142.0
babosa 1.0.4
claide 1.1.0
colored 1.2
colored2 3.1.2
highline 2.0.3
commander 4.6.0
declarative 0.0.20
digest-crc 0.6.5
domain_name 0.6.20231109
dotenv 2.8.1
emoji_regex 3.2.3
excon 0.109.0
faraday-em_http 1.0.0
faraday-em_synchrony 1.0.0
faraday-excon 1.1.0
faraday-httpclient 1.0.1
multipart-post 2.3.0
faraday-multipart 1.0.4
faraday-net_http 1.0.1
faraday-net_http_persistent 1.2.0
faraday-patron 1.0.0
faraday-rack 1.0.0
faraday-retry 1.0.3
ruby2_keywords 0.0.5
faraday 1.10.3
http-cookie 1.0.5
faraday-cookie_jar 0.0.7
faraday_middleware 1.2.0
fastimage 2.3.0
gh_inspector 1.1.3
jwt 2.7.1
multi_json 1.15.0
os 1.1.4
signet 0.18.0
googleauth 1.8.1
httpclient 2.8.3
mini_mime 1.1.5
trailblazer-option 0.1.2
uber 0.1.0
representable 3.2.0
retriable 3.1.2
webrick 1.8.1
google-apis-core 0.11.2
google-apis-androidpublisher_v3 0.54.0
google-apis-playcustomapp_v1 0.13.0
google-cloud-env 1.6.0
google-apis-iamcredentials_v1 0.17.0
google-apis-storage_v1 0.29.0
google-cloud-errors 1.3.1
google-cloud-core 1.6.1
google-cloud-storage 1.45.0
json 2.7.1
mini_magick 4.12.0
naturally 2.2.1
optparse 0.4.0
plist 3.7.1
rubyzip 2.3.2
security 0.1.3
simctl 1.6.10
terminal-notifier 2.0.0
unicode-display_width 2.5.0
terminal-table 3.0.2
tty-screen 0.8.2
tty-cursor 0.7.1
tty-spinner 0.9.3
word_wrap 1.0.0
nanaimo 0.3.0
xcodeproj 1.23.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.1
google-apis-firebaseappdistribution_v1 0.3.0
google-apis-firebaseappdistribution_v1alpha 0.2.0
fastlane-plugin-firebase_app_distribution 0.8.0

generated on: 2024-01-05

@lacostej
Copy link
Collaborator

lacostej commented Jan 6, 2024

Hello @benferris-tl

Happy new year and thanks for the report!

It looks like the appetize action doesn't check if the response code was indeed different from 200.

Is this something you would be willing to fix yourself? It should be pretty straightforward. There are many examples in the fastlane code base on how to handle response codes. Here's the first I found.

If you do fix it, could you also add a test?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants