Is there a recommended way to upload sourcemaps with the latest react-native-sentry (0.10.0) when using react-native-code-push?
I am trying to put together a deploy script that builds the apk, pushes a release to code-push and uploads artifacts to sentry, but I keep hitting mismatches in releases.
code-push creates a new label every time a version is released with code-push release-react
but I can’t seem to get sentry to use that label as a release number, so that the correct sourcemap file is used. (at the moment, sentry uses the release number from build.gradle, which in my understanding relates more to the java code than the javascript version provided by code-push updates)
Has anybody managed to hack this together?
Good timing. I just started looking into code push the last two days. The CLI has an open pull request to manage uploads: https://github.com/getsentry/sentry-cli/pull/75
However there are a few open questions on out side how to best support it. In particular we are not sure if we want to treat code pushes as releases or as distributions below already existing releases.
Right now my thinking is that we should upload the releases named BUNDLE_ID-APP_VERSION:CODEPUSH_LABEL
. So for instance com.myapp.Foo-2.1:v42
. In the client we would then either automatically detect the codepush package and add the label to the release or we let users manually do that.
I was also thinking of just naming the releases with the codepush label instead. Not entirely sure yet.
I couldn’t find the docs about distributions, but from what I gather, they seem to work like “sub-releases”, is that right?
In that case, I’d say your initial idea of app_version -> release
and codepush_label -> distribution
seems to make a lot of sense as it matches pretty well the fact that each JS bundle can only work on certain java “base layer” if I can call it so.
At the moment I am using the --targetBinaryVersion ">=app_version
option of code-push CLI to limit which js bundles can get pushed to which releases, I think your mapping to sentry’s release:distribution
would work pretty well with that.
The issue with distributions is that we can’t associate the thing with commits. So you lose some of the ability of the releases feature. On the other hand the question is if all commits are relevant since only JS updates …
I think your mapping to sentry’s release:distribution would work pretty well with that.
Sadly not really because distributions live within a release. So if you pin losely it would not work directly. That’s another reason I was investigating making new releases rather than distributions.
Distributions are mostly used to permit APK splitting on Android.