fix(plugin): Make instrumentation log dir variant-specific#1236
Merged
Conversation
runningcode
marked this pull request as ready for review
May 27, 2026 13:52
runningcode
requested review from
0xadam-brown,
adinauer,
markushi and
romtsn
as code owners
May 27, 2026 13:52
runningcode
force-pushed
the
no/variant-specific-instrumentation-log-dir
branch
from
May 28, 2026 09:16
d4f48f0 to
5895218
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1565b3e. Configure here.
romtsn
reviewed
May 28, 2026
| ) | ||
| params.tmpDir.set(tmpDir) | ||
| params.tmpDir.set( | ||
| project.layout.buildDirectory.dir("sentry-logs/instrumentation/${variant.name}") |
Member
There was a problem hiding this comment.
any specific reason we're going away from the /tmp/sentry pattern?
Contributor
Author
There was a problem hiding this comment.
Yeah, I think it is a bad practice since it isn't specific to our plugin. If someone else creates a tmp folder and uses it as input or output then we'll have changed the other tasks inputs or have overlapping outputs which would affect caching.
The debug instrumentation log directory was shared across all variants (`build/tmp/sentry`), which could cause log file corruption when AGP runs variant transforms in parallel. Each variant now writes to its own directory under `build/sentry-logs/instrumentation/<variantName>`. Also removes the eager `mkdirs()` call at configuration time (CommonClassVisitor already creates the directory at execution time) and migrates tmpDir from `Property<File>` to `DirectoryProperty` using the Gradle layout API. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
runningcode
force-pushed
the
no/variant-specific-instrumentation-log-dir
branch
from
May 28, 2026 10:53
1565b3e to
cd4d730
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
build/tmp/sentry) was shared across all variants, which could cause log file corruption when AGP runs variant transforms in parallelbuild/sentry-logs/instrumentation/<variantName>mkdirs()at configuration time —CommonClassVisitoralready creates the directory at execution timetmpDirfromProperty<File>toDirectoryPropertyusing the Gradle layout API🤖 Generated with Claude Code