-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multi-module Android projects when sending Source Context #685
Comments
Hey @wzieba thanks for the suggestion, I think this makes sense, but it's not our top priority at the moment |
Let's investigate this first on our end, as in theory it should work:
|
The end goal would be for our gradle plugin to support applying on the root project level, so then we could have access to all modules, but this is a bit bigger initiative |
So as of right now, if we use Sentry in a multi module Android project, we cannot have source context outside of the main app module which applies the Sentry Gradle Plugin? Meaning we also cannot use a CODEOWNERS file for ownership rules to auto-assign issues that exist outside of the app module? |
yes that's correct
Nope, source context is not a prerequisite for code owners, stack trace linking is. However, if you have many modules, stacktrace linking is also not easy to set up, @wzieba came up with a nice solution in the other issue: #546 (comment) |
I created a similar issue here: getsentry/sentry#74435 IMHO this should be given higher priority. Most large/mature Android apps are multi-module. We have hundreds of Gradle modules, I've heard of apps with thousands. |
Our organization is adopting a multi-module project structure, which directly affects the use of Sentry within the app. This should be prioritized. Thanks. |
We're planning to focus on this this quarter, so stay tuned for updates! We're also doing some work on the backend side to automatically infer code mappings and in-app frames for multi-module apps. This should work particularly well with our github integration. |
Adding another use-case here that currently doesn't work for the multi-module case: native debug symbols are only collected/uploaded only from the app module at the moment, we should expand it and run the cli command on the root project level to collect all necessary symbols from the other modules |
Are your efforts this quarter also going to address the issue with "stack trace root" and "source code root" from code mappings? https://docs.sentry.io/product/issues/suspect-commits/#stack-trace-root-and-source-code-root Sentry's repository integration expects a single directory for stack trace and source code roots. As covered in this issue, in a multi-module Gradle project, there is no single source or stack trace root. |
@zsperske yes that's precisely what we're going to focus on! |
While we're waiting for this functionality, I wanted to share the temporary solution I came up with. Using
|
@zsperske thanks for sharing, this looks like a viable workaround for now. There's one other downside that it most likely won't work with the Isolated Projects feature of Gradle (which probably becomes a default sooner-or-later). |
Problem Statement
When sending Source Context via Sentry Gradle Plugin, I've noticed that the source is taken only from the main application module. This is problematic for multi-module setups, which are fairly common.
I've prepared a minimal reproduction project of what I have in mind.
Reproduction
An Android application with
x
app module andy
its dependency: https://github.com/wzieba/SentrySourceContextMultiModuleExpected behavior
Running
assembleRelease
prepares source context bundle with all classes fromx
and all classes fromy
modules.Current behavior
Running
assembleRelease
prepares source context bundle with only classes fromx
(proof: https://github.com/wzieba/SentrySourceContextMultiModule/actions/runs/8467510900/job/23198486580#step:5:20)Solution Brainstorm
I think it could be addressed manually with
additionalSourceDirsForSourceContext
, but I haven't prepared a working solution yet. Ideally, It'd be great if SAGP could do this internally (maybe as a non-default option?).The text was updated successfully, but these errors were encountered: