Repository navigation
Agent guidance for Gradle build logic #12872
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
Merged
gh-worker-dd-mergequeue-cf854d
merged 9 commits into
master
from
bdu/gradle-agent-guidance
Oct 22, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
aa5add1
docs: add Gradle agent guardrails
bric3 afbb780
docs: move shared Gradle guidance into the guide
bric3 8040547
docs: clarify project dependencies in build logic
bric3 e100ae4
docs: centralise build logic placement advice
bric3 47d23f4
docs: clarify Gradle guidance and skill setup
bric3 7f056e4
docs: Improve wording
bric3 81b6bf6
docs: Improve correctness and wording on the lazy API usage
bric3 2e7ce1f
docs: Reword paragraph in Project COnvention plugin
bric3 294b0b5
docs: keep Gradle guidance out of root agent instructions
bric3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Working in build-logic | ||
|
|
||
| Use `gradle-best-practices` before changing Gradle code here. If it is missing or incomplete, | ||
| follow the [skill setup](../docs/how_to_work_with_gradle.md#gradle-skills) before editing. | ||
|
|
||
| This included build holds project conventions and the smoke-test, tag-registry and | ||
| testcontainers plugins. Its settings import `../gradle/libs.versions.toml` and configure | ||
| repository proxies separately from the main build. | ||
|
|
||
| The smoke-test plugin runs nested builds with older Gradle versions. Its tests use Java 21 | ||
| for that reason; keep that launcher when changing the tests or toolchain configuration. | ||
|
|
||
| ## Tests | ||
|
|
||
| The plugin tests use JUnit 5 and Kotlin. Reuse the module's TestKit setup, including its | ||
| repository proxy handling and environment isolation. | ||
|
|
||
| Run the tests for the module you changed, for example: | ||
|
|
||
| ```shell | ||
| ./gradlew -p build-logic :smoke-test:test | ||
| ``` | ||
|
|
||
| For changes across modules, `./gradlew :build-logic:check` runs the included build's checks | ||
| from the repository root. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| @AGENTS.md | ||
|
bric3 marked this conversation as resolved.
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Working in buildSrc | ||
|
|
||
| Use `gradle-best-practices` before changing Gradle code here. If it is missing or incomplete, | ||
| follow the [skill setup](../docs/how_to_work_with_gradle.md#gradle-skills) before editing. | ||
|
|
||
| For new conventions, follow the [build logic placement advice](../docs/how_to_work_with_gradle.md#build-logic-location). | ||
|
|
||
| The Java 8 target in `build.gradle.kts` is needed by build-time instrumentation and Muzzle | ||
| workers. A newer Gradle daemon or compiler JVM does not remove that requirement. | ||
|
|
||
| JMH uses the consuming build's plugin classpath. Read the comments in | ||
| [its convention](src/main/kotlin/dd-trace-java.jmh-conventions.gradle.kts) before changing | ||
| that integration or adding JMH to `implementation`. | ||
|
|
||
| ## Tests | ||
|
|
||
| The plugin tests use JUnit 5 and Kotlin. Reuse | ||
| [GradleFixture](src/test/kotlin/datadog/gradle/plugin/GradleFixture.kt) for TestKit tests. | ||
| CLI tests need `-PrunBuildSrcTests`; see [the test commands](../docs/how_to_work_with_gradle.md#running-build-logic-tests). | ||
| Keep the `:test` selector when filtering so the filter does not reach unrelated subprojects. | ||
|
|
||
| Changes to `call-site-instrumentation-plugin` or `modifiable-config-agent` also need their | ||
| own subproject tests. Run `./gradlew -p buildSrc spotlessCheck` for formatting. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| @AGENTS.md |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.