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.
@squirly
This was totally not meant to be a breaking change (our bad).
We'll look into this, sorry for the confusion.
No worries. Let me know if there is anything I can help with.
I saw the fix PR was closed. Is there a better way to fix this or something?
We will fix this by reverting the breaking change and improving usage docs around the matter. We haven鈥檛 had the time to fully assess this yet and will update the thread as soon as possible.
Is there a workaround we can use for now, without running this on a mac?
The only workaround for now would be to specify both the bundle and version on the command line.
After reverting, the proper usage will be to pass <bundle>-<version> to the 鈥攂undle-id option. We will point this out in the release notes.
What if we didn't use versions at all before?
Sentry requires versions to function properly, I would be curious how this might have worked before. What did you pass as bundle identifier in your case? My understanding always was that appcenter also always requires a version number.
The intention of that command line option was to specify a unique name for every new release, which includes a bundle name and said version. This was totally not clear from docs.
This was our command before:
SENTRY_PROPERTIES=./ios/sentry.properties ./node_modules/@sentry/cli/sentry-cli react-native appcenter Bla/BlaBla-ios ios ./output/js/ios --deployment Branch-123 --bundle-id com.ourcomp.app-Alpha
I think appcenter just autoincrements the version numbers, so it was working fine before.
As extra info, we used 1.41.0 of cli, and with 1.46.0 the same command does not work anymore.
Yes, we regressed in 1.44.4 and will most likely roll back the behavior.
facing the same issue on 1.47, when can we expect the fix to land?
Any news on this? We still have the old version because the new one is broken.
Hey, I just run into another issue, there is some regression break on the latest sentry-cli with codepush, the release name does not get matched properly, however with the latest version it works again, but that means this issue also started again.
tested on 1.49.0, any news on this?
Well, I got this working by manually adding the version name into the script, everytime I update the app version I now have to update this (I could probably script my way around this, but I don't want to), the final command is as follows:
export SENTRY_PROPERTIES=./ios/sentry.properties
npx sentry-cli react-native appcenter \
--bundle-id $IOS_BUNDLE_ID \
--version-name $APP_VERSION \
--deployment $CODEPUSH_ENV \
Capmo/mobileapp-ios-production ios ./build/CodePush
Sentry.init in your codebasecodePush.getUpdateMetadata().then((update) => {
if (update) {
Sentry.setDist(`codepush_${update.label}`);
}
});
appcenter codepush release-react --sourcemap-output --app APP_NAME --output-dir ./build -d DEPLOYMENT_NAME
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
I think the docs need to be updated:
https://docs.sentry.io/platforms/react-native/codepush/
Most helpful comment
facing the same issue on 1.47, when can we expect the fix to land?