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

Attribute issues from enterprise builds with build_type "enterprise" instead of "test"

Open koenpunt opened this issue 4 years ago • 7 comments

Platform:

  • [x] iOS
  • [ ] tvOS
  • [ ] MacOS
  • [ ] watchOS

Swift:

  • [ ] Yes -> If yes, which version?
  • [x] No

sentry-cocoa installed with:

  • [x] CocoaPods
  • [ ] Carthage
  • [ ] Manually

Version of sentry-cocoa: 6.0.0


Currently apps signed and distributed as enterprise apps, are attributed with build_type "test". I'm not completely sure if there's a good way for determining this, but I believe enterprise apps include the embedded.mobileprovision file in the bundle, so maybe that can be used to determine the app is an enterprise build?

koenpunt avatar Oct 12 '20 16:10 koenpunt

Would it make sense to send that as an environment instead? Are you currently setting environment programatically? We're evaluating how/what to send there automatically if nothing is set by the user.

bruno-garcia avatar Oct 12 '20 22:10 bruno-garcia

@bruno-garcia just as an internal note this comes from SentryCrash in SentryCrashMonitor_System . We set the build_type to test when the build is a testing build as for example Testflight.

This data ends up in the event.context https://github.com/getsentry/sentry-cocoa/blob/a0f1ed4298cf0fedd36fabc7ec17e220df8c59e7/Sources/Sentry/SentryCrashIntegration.m#L171-L173

@koenpunt you could override build_type in beforeSend with something like this

SentrySDK.start { options in
    options.dsn = "Your DSN"
    options.beforeSend = { event in
        event.context?["app"]?["build_type"] = "enterprise"
        return event
    }
}

philipphofmann avatar Oct 15 '20 15:10 philipphofmann

I already set environment to production, but the app is released both as enterprise deployment and the App Store, so it would be nice to have the sdk determine that automatically.

@philipphofmann I'll try and see if that works for us.

koenpunt avatar Oct 15 '20 21:10 koenpunt

@koenpunt How do you currently detect if it was installed via enterprise deployment? Is there an OOTB way to detect that?

bruno-garcia avatar Oct 16 '20 00:10 bruno-garcia

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Nov 08 '21 09:11 github-actions[bot]

@koenpunt, can you please reply to @bruno-garcia question:

@koenpunt How do you currently detect if it was installed via enterprise deployment? Is there an OOTB way to detect that?

philipphofmann avatar Nov 08 '21 09:11 philipphofmann

@koenpunt How do you currently detect if it was installed via enterprise deployment? Is there an OOTB way to detect that?

I'm no longer working on the project that required this, but AppStore builds won't have a embedded.mobileprovison file in the app bundle, so that could be a way to distinguish them from enterprise builds.

koenpunt avatar Nov 08 '21 13:11 koenpunt