sentry-docs icon indicating copy to clipboard operation
sentry-docs copied to clipboard

Failure to locate `sentry-cli` should result in error, not warning

Open armcknight opened this issue 3 years ago • 7 comments

If a customer has already integrated the invocation of sentry-cli into their Xcode project, we should break their build instead of simply emitting a warning if the executable cannot be located/run (as described here). If we allow their build to succeed, then they will wind up with unsymbolicated results in their dashboard, which is not desirable. In a worse case, they may run a deploy to beta/production on a remote machine where sentry-cli has not been installed, and not know that they are going to encounter these unsymbolicatable results until it's too late. I would want that build to fail if it were me.

A possible additional option that I've used in the past is to allow certain warnings/errors to be configured to be escalated/downgraded with an option like --warnings-as-errors or --errors-as-warnings.

armcknight avatar Dec 29 '21 00:12 armcknight

@getsentry/team-mobile

armcknight avatar Dec 29 '21 00:12 armcknight

I think this should be solved in the bash script for Xcode in our docs: https://docs.sentry.io/platforms/apple/dsym/#uploading-symbols-with-sentry-cli:

if which sentry-cli >/dev/null; then
export SENTRY_ORG=example-org
export SENTRY_PROJECT=example-project
export SENTRY_AUTH_TOKEN=YOUR_AUTH_TOKEN
ERROR=$(sentry-cli upload-dif "$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null)
if [ ! $? -eq 0 ]; then
echo "warning: sentry-cli - $ERROR"
fi
else
echo "warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases"
fi

If so, I think we should move this issue to the docs.

philipphofmann avatar Dec 30 '21 07:12 philipphofmann

SGTM! Then if it’s ever decided to take on https://github.com/getsentry/sentry-cli/issues/1092, we can revisit other flags/options to provide as mentioned in the description.

armcknight avatar Dec 31 '21 01:12 armcknight

Hey @armcknight, https://github.com/getsentry/sentry-cli/issues/1092 is completed now. Do you want to revisit this issue now?

philipphofmann avatar May 18 '22 08:05 philipphofmann

So it sounds like we can leave the onus on the consumer for whether to emit a warning or error, depending on their preferences. We could just include that tidbit in the docs like you said, maybe providing an alternate example.

Did you have anything else in mind for that @philipphofmann ?

armcknight avatar Jun 01 '22 14:06 armcknight

No, this makes sense. Are you up for a PR maybe @armcknight?

philipphofmann avatar Jun 09 '22 13:06 philipphofmann

@philipphofmann absolutely, here's the draft: https://github.com/getsentry/sentry-docs/pull/5147

armcknight avatar Jun 15 '22 19:06 armcknight