Skip to content

[DNM] Add Develocity build scan plugin#5379

Open
runningcode wants to merge 8 commits intomainfrom
no/add-develocity-build-scans
Open

[DNM] Add Develocity build scan plugin#5379
runningcode wants to merge 8 commits intomainfrom
no/add-develocity-build-scans

Conversation

@runningcode
Copy link
Copy Markdown
Contributor

Summary

  • Adds the Develocity Gradle plugin (v4.4.1) to settings.gradle.kts
  • Publishes build scans on every build for easier debugging and performance analysis
  • Accepts Gradle terms of service automatically

🤖 Generated with Claude Code

Adds the Develocity Gradle plugin (v4.4.1) to publish build scans on
every build, making it easier to debug and analyze build performance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sentry
Copy link
Copy Markdown

sentry Bot commented May 6, 2026

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.40.0 (1) release

⚙️ sentry-android Build Distribution Settings

@runningcode runningcode changed the title chore: Add Develocity build scan plugin [DNM] Add Develocity build scan plugin May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- [DNM] Add Develocity build scan plugin ([#5379](https://github.com/getsentry/sentry-java/pull/5379))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against d89823c

Copy link
Copy Markdown
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

i'm not sure but I feel like this potentially needs to go through #discuss-legal first?

Lower maxHeapSize from 2g to 1g for all tests in the root build.
Remove duplicated maxParallelForks and heap settings from sample
project systemTest tasks since they inherit from the root config.
Use typed tasks.named<Test> where applicable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@runningcode runningcode requested a review from 0xadam-brown as a code owner May 6, 2026 18:24
Comment thread build.gradle.kts Outdated
Comment thread settings.gradle.kts
termsOfUseAgree.set("yes")
publishing.onlyIf { true }
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Build scans unconditionally published to external service

Medium Severity

The Develocity configuration uses publishing.onlyIf { true }, which unconditionally publishes build scan data to Gradle's cloud servers on every build. Build scans can include environment variables, system properties, and file paths. This also automatically accepts the terms of service via termsOfUseAgree.set("yes") without any user awareness, which affects all contributors.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9b87d20. Configure here.

Comment thread settings.gradle.kts
Comment on lines +14 to +19
develocity {
buildScan {
termsOfUseUrl.set("https://gradle.com/help/legal-terms-of-use")
termsOfUseAgree.set("yes")
publishing.onlyIf { true }
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The Develocity configuration unconditionally publishes build scans to a public server for all builds, including local ones, exposing potentially sensitive environment data.
Severity: HIGH

Suggested Fix

Modify the publishing.onlyIf condition to only be true for CI/CD environments, not local builds. For example, check for a specific environment variable like CI. This will prevent local developer build data from being publicly uploaded.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: settings.gradle.kts#L14-L19

Potential issue: The Develocity build scan configuration in `settings.gradle.kts` is set
to always publish scans by using `publishing.onlyIf { true }`. Since a private server is
not specified, these scans are uploaded to the public Gradle server
(`scans.gradle.com`). This applies to all builds, including those run on local developer
machines, and can expose sensitive information like local usernames, file paths, and
operating system details without explicit user consent for each build.

Did we get this right? 👍 / 👎 to inform future reviews.

@runningcode runningcode closed this May 6, 2026
@runningcode runningcode reopened this May 6, 2026
Let Gradle use its default heap settings for test JVMs rather
than explicitly capping them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
outputs.upToDateWhen { false }

maxParallelForks = 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

System tests lose sequential execution guarantee

Medium Severity

maxParallelForks = 1 was removed from all system test task configurations across ~20 sample modules. System tests interact with real servers and shared resources like network ports. Without this constraint, Gradle may fork multiple test processes in parallel (default is based on CPU count), causing port conflicts and flaky test failures. This change is unrelated to the Develocity plugin and appears accidental.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0d72252. Configure here.

runningcode and others added 2 commits May 6, 2026 22:00
Run tests + coverage and lint/verification as separate parallel CI
jobs to reduce wall-clock time. Spotless will move to its own workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Configure minHeapSize, maxHeapSize, and maxParallelForks for
sentry-android-core, sentry-spring-boot, and sentry-spring-boot-4.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
koverXmlReportRelease
-x :sentry-spring-boot:test
-x :sentry-spring-boot-jakarta:test
-x :sentry-spring-boot-4:test
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Spring Boot module unit tests excluded from CI

High Severity

The test job explicitly excludes unit tests for :sentry-spring-boot, :sentry-spring-boot-jakarta, and :sentry-spring-boot-4 via -x flags. Previously, make preMerge ran ./gradlew check which included all module tests. The Spring Boot matrix workflows only run system tests (Python-based), not these Gradle unit tests, so these unit tests are no longer executed anywhere in CI.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 72134fd. Configure here.

./gradlew
apiCheck
animalsnifferMain
lint
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CI lint job missing detekt static analysis checks

Medium Severity

The new lint job only runs apiCheck, animalsnifferMain, and lint. The old workflow ran ./gradlew check which also executed detekt (configured in build.gradle.kts with custom rules from detekt.yml). The detekt static analysis is no longer run in CI, allowing code quality regressions to pass undetected.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 72134fd. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 333.87 ms 397.67 ms 63.79 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
2195398 319.02 ms 342.38 ms 23.36 ms
d364ace 411.72 ms 430.81 ms 19.10 ms
d15471f 286.65 ms 314.68 ms 28.03 ms
ff8eea4 313.42 ms 337.08 ms 23.66 ms
17a0955 372.53 ms 446.70 ms 74.17 ms
23d6b12 354.10 ms 408.38 ms 54.28 ms
cf708bd 408.35 ms 458.98 ms 50.63 ms
6edfca2 305.52 ms 432.78 ms 127.26 ms
72020f8 312.32 ms 370.94 ms 58.62 ms
6b019b7 343.31 ms 417.23 ms 73.91 ms

App size

Revision Plain With Sentry Diff
2195398 0 B 0 B 0 B
d364ace 1.58 MiB 2.11 MiB 539.75 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
ff8eea4 1.58 MiB 2.28 MiB 718.64 KiB
17a0955 1.58 MiB 2.10 MiB 533.20 KiB
23d6b12 1.58 MiB 2.10 MiB 532.31 KiB
cf708bd 1.58 MiB 2.11 MiB 539.71 KiB
6edfca2 1.58 MiB 2.13 MiB 559.07 KiB
72020f8 1.58 MiB 2.19 MiB 620.21 KiB
6b019b7 0 B 0 B 0 B

Previous results on branch: no/add-develocity-build-scans

Startup times

Revision Plain With Sentry Diff
187e556 305.39 ms 366.15 ms 60.75 ms
93b1892 329.00 ms 381.96 ms 52.96 ms

App size

Revision Plain With Sentry Diff
187e556 0 B 0 B 0 B
93b1892 0 B 0 B 0 B

runningcode and others added 2 commits May 6, 2026 22:23
Remove maxParallelForks from per-module test config and add
heap size settings to sentry-android-replay.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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.

There are 5 total unresolved issues (including 4 from previous reviews).

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 d89823c. Configure here.

}
}

tasks.withType<Test>().configureEach {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty no-op test configuration block is dead code

Low Severity

tasks.withType<Test>().configureEach {} is an empty configuration block that has no effect. It likely was intended to contain heap size settings (like the similar blocks added to sentry-android-replay and sentry-spring-boot), but was left empty. The allprojects block in the root build.gradle.kts already configures heap sizes for all test tasks, so this block is redundant dead code.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d89823c. Configure here.

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.

3 participants