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
Draft
bric3
wants to merge
6
commits into
master
Choose a base branch
from
bdu/gradle-agent-guidance
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+227
−30
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d9ed185
docs: add Gradle agent guardrails
bric3 b770d54
docs: move shared Gradle guidance into the guide
bric3 a63d334
docs: clarify project dependencies in build logic
bric3 e7dfd30
docs: centralise build logic placement advice
bric3 a26719e
docs: clarify Gradle guidance and skill setup
bric3 ebf3040
docs: Improve wording
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
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 |
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 |
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
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.