Skip to content

fix(plugin): Make instrumentation log dir variant-specific#1236

Merged
runningcode merged 5 commits into
mainfrom
no/variant-specific-instrumentation-log-dir
May 28, 2026
Merged

fix(plugin): Make instrumentation log dir variant-specific#1236
runningcode merged 5 commits into
mainfrom
no/variant-specific-instrumentation-log-dir

Conversation

@runningcode

@runningcode runningcode commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The debug instrumentation log directory (build/tmp/sentry) was shared across all variants, which could cause log file corruption when AGP runs variant transforms in parallel
  • Each variant now writes to its own directory: build/sentry-logs/instrumentation/<variantName>
  • Removes the eager mkdirs() at configuration time — CommonClassVisitor already creates the directory at execution time
  • Migrates tmpDir from Property<File> to DirectoryProperty using the Gradle layout API
  • Updates integration tests to reference the new variant-specific path

🤖 Generated with Claude Code

@runningcode
runningcode marked this pull request as ready for review May 27, 2026 13:52
@runningcode
runningcode force-pushed the no/variant-specific-instrumentation-log-dir branch from d4f48f0 to 5895218 Compare May 28, 2026 09:16

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

)
params.tmpDir.set(tmpDir)
params.tmpDir.set(
project.layout.buildDirectory.dir("sentry-logs/instrumentation/${variant.name}")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any specific reason we're going away from the /tmp/sentry pattern?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@romtsn romtsn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one Q, but LGTM otherwise!

runningcode and others added 5 commits May 28, 2026 12:53
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]>
@runningcode
runningcode force-pushed the no/variant-specific-instrumentation-log-dir branch from 1565b3e to cd4d730 Compare May 28, 2026 10:53
@runningcode
runningcode merged commit f150200 into main May 28, 2026
23 checks passed
@runningcode
runningcode deleted the no/variant-specific-instrumentation-log-dir branch May 28, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants