sentry-cli: [Breaking change] React Native symbol upload iOS now requires version name parameter

Previously only --bundle-id was required when running in a non macOS environment, now --version-name is also required.

Error after upgrading:

$ sentry-cli "react-native" "appcenter" "-o" "storr" "-p" "mobile" "--deployment" "master" "--bundle-id" "app.storr" "storr/app.storr-ios" "ios" "./build/ios/CodePush"

> Fetching latest AppCenter deployment info
error: AppCenter codepush releases for iOS require macOS if no bundle ID is specified

Code where this is checked https://github.com/getsentry/sentry-cli/blob/585f41ea4b7c0e6f1a1a591c56fffa649f6a6070/src/utils/appcenter.rs#L138-L143

Change introduced in https://github.com/getsentry/sentry-cli/commit/585f41ea4b7c0e6f1a1a591c56fffa649f6a6070#diff-8e4c8496f8f401a0cebfddf00bcdc705R138

The following line is now being triggered because the above condition is no longer being met: https://github.com/getsentry/sentry-cli/blob/585f41ea4b7c0e6f1a1a591c56fffa649f6a6070/src/utils/appcenter.rs#L147

At a minimum, the above error should be updated; and this breaking change should be added to the changelog (version 1.44.4), to prevent future confusion.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 29 (12 by maintainers)

Most upvoted comments

facing the same issue on 1.47, when can we expect the fix to land?

  1. Put this just below Sentry.init in your codebase
codePush.getUpdateMetadata().then((update) => {
      if (update) {
        Sentry.setDist(`codepush_${update.label}`);
      }
    });
  1. To deploy changes via codepush, run the following command
appcenter codepush release-react --sourcemap-output --app APP_NAME --output-dir ./build -d DEPLOYMENT_NAME
  1. To upload the sourcemaps of the deployed codebase to sentry, run the following commands
export SENTRY_PROPERTIES=./PLATFORM/sentry.properties
./node_modules/@sentry/cli/bin/sentry-cli react-native appcenter APP_NAME PLATFORM ./build/CodePush --deployment DEPLOYMENT_NAME --release-name RELEASE_NAME --dist DIST_NAME

where, APP_NAME is ${owner_name}/${codepush_app_name}.

DEPLOYMENT_NAME is the name of the deployment you want to deploy the changes under i.e. Staging/Production/etc. defined in your codepush app settings.

PLATFORM is the platform you want to deploy the changes for i.e. ios/android.

RELEASE_NAME for android is: ${applicationId}@${versionName}+${versionCode} and for iOS is: ${bundleIdentifier}@${version}+${build}. This naming convention is mandatory for RELEASE_NAME because otherwise sentry’s RELEASE Health feature won’t work properly. For more details, look at https://github.com/getsentry/sentry-cli/issues/577#issuecomment-610272845 Also, because, when we build our release/staging app via XCode/Android Studio, Sentry always uses that release name (hardcoded by sentry) to upload our sourcemaps and so as not to make a new release on sentry for each codepushed version, we will put them all under one release name, divided by different distribution names i.e. DIST_NAME

DIST_NAME is codepush_${codePushUpdateLabel} where codePushUpdateLabel is the name of your codepush release eg. v21, v22, etc. You can check this out by going into your codepush app webpage on appcenter website and then Distribute -> CodePush -> Select your respective deployment codePushUpdateLabel will be at the top of of the list since which is the update you just deployed on codepush. eg. codepush_v22

Any news on this? We still have the old version because the new one is broken.

Yes, we regressed in 1.44.4 and will most likely roll back the behavior.

Closing the issue, as it seems like the original issue has been partially resolved or there is a working solution. We will update the docs accordingly. I’d prefer someone to create a new issue with a fresh description if it’ll still persist to be an issue. Cheers!

@marandaneto Yes, both the codepush release command and appcenter sourcemap upload command.

This is completely stupid. Can we get clear and non-ambiguous docs already? Do I really have to write a 30 line bash script just so that I can make Sentry work with CP?