Open wzieba opened 5 months ago
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?
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?
yes that's correct
Meaning we also cannot use a CODEOWNERS file for ownership rules to auto-assign issues that exist outside of the app module?
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: https://github.com/getsentry/sentry-android-gradle-plugin/issues/546#issuecomment-2035085154
I created a similar issue here: https://github.com/getsentry/sentry/issues/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.
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?).