Code review sweep (run 25139405527)#18424
Merged
Merged
Conversation
Automated code review of instrumentation/elasticsearch/elasticsearch-rest-5.0/javaagent.
Automated code review of instrumentation/elasticsearch/elasticsearch-rest-6.4/javaagent.
Automated code review of instrumentation/elasticsearch/elasticsearch-rest-7.0/javaagent.
Automated code review of instrumentation/elasticsearch/elasticsearch-rest-7.0/library.
Automated code review of instrumentation/elasticsearch/elasticsearch-rest-common-5.0/library.
Automated code review of instrumentation/elasticsearch/elasticsearch-transport-5.0/javaagent.
Automated code review of instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent.
trask
approved these changes
Apr 30, 2026
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.
Automated code review sweep walked the following modules in order
and stopped after accumulating at least 10 modified files:
elasticsearch-rest-5.0:javaagentelasticsearch-rest-6.4:javaagentelasticsearch-rest-7.0:javaagentelasticsearch-rest-7.0:libraryelasticsearch-rest-common-5.0:javaagentelasticsearch-rest-common-5.0:libraryelasticsearch-transport-5.0:javaagentelasticsearch-transport-5.3:javaagentModule:
elasticsearch-rest-5.0:javaagentModule path:
instrumentation/elasticsearch/elasticsearch-rest-5.0/javaagentSummary
Applied one safe repository-guideline fix in
elasticsearch-rest-5.0javaagent tests and committed it asReview fixes for elasticsearch-rest-5.0 javaagent.Applied Changes
Testing
File:
ElasticsearchRest5Test.java:48Change: Replaced separate class-scoped `@AfterAll` cleanup with `AutoCleanupExtension` and `deferAfterAll(...)` registrations next to `ElasticsearchContainer` and `RestClient` creation.
Reason: The repository testing guidance prefers `AutoCleanupExtension.deferAfterAll(...)` for shared resources created in `@BeforeAll`, keeping creation and cleanup together instead of maintaining a separate cleanup chain.
Module:
elasticsearch-rest-6.4:javaagentModule path:
instrumentation/elasticsearch/elasticsearch-rest-6.4/javaagentSummary
Applied safe review fixes to
elasticsearch-rest-6.4javaagent tests and committed them in7cb57ef5.Applied Changes
Testing
File:
ElasticsearchRest6Test.java:47Change: Replaced manual `@AfterAll` cleanup with `AutoCleanupExtension.deferAfterAll(...)` for `ElasticsearchContainer` and `RestClient`, and changed the async `CountDownLatch.await()` to `assertThat(countDownLatch.await(10, SECONDS)).isTrue()`.
Reason: Repository testing guidance prefers `AutoCleanupExtension` for class-scoped resources created in `@BeforeAll`; bounded async waits with assertions avoid tests hanging indefinitely and match sibling module patterns.
Module:
elasticsearch-rest-7.0:javaagentModule path:
instrumentation/elasticsearch/elasticsearch-rest-7.0/javaagentSummary
Applied safe review fixes for
elasticsearch-rest-7.0javaagent and committed them in5087ac94.Applied Changes
Style
File:
ElasticsearchRest7Singletons.java:22Change: Moved `ENDPOINT_DEFINITION` above the `instrumenter()` accessor so all static fields are declared before methods.
Reason: Repository style guide class organization prefers static fields before methods, and singleton guidance allows uppercase constant-like `VirtualField` fields to remain directly exposed.
Testing
File:
ElasticsearchRest7Test.java:48Change: Replaced manual `@AfterAll` cleanup with `AutoCleanupExtension.deferAfterAll(...)` for `ElasticsearchContainer` and `RestClient`, and narrowed `elasticsearchStatus()` from `throws Exception` to `throws IOException`.
Reason: Testing guidelines prefer `AutoCleanupExtension.deferAfterAll(...)` for class-scoped resources created in `@BeforeAll`, and `@Test` throws clauses should use the narrowest single checked exception type when clear.
Module:
elasticsearch-rest-7.0:libraryModule path:
instrumentation/elasticsearch/elasticsearch-rest-7.0/librarySummary
Applied one safe repository-guideline fix under
instrumentation/elasticsearch/elasticsearch-rest-7.0/libraryand committed it as5591e062(Review fixes for elasticsearch-rest-7.0 library).Applied Changes
Style
File:
RestClientWrapper.java:135Change: Added `@Nullable` to `getInstrumenter(...)` and imported `javax.annotation.Nullable`.
Reason: Repository nullability guidance requires annotating return types that can actually return `null`; `getInstrumenter(...)` returns `null` when the proxy supplier is absent.
Module:
elasticsearch-rest-common-5.0:javaagentModule path:
instrumentation/elasticsearch/elasticsearch-rest-common-5.0/javaagentSummary
No safe repository-guideline fixes were applied under
instrumentation/elasticsearch/elasticsearch-rest-common-5.0/javaagent. The reviewedbuild.gradle.ktsandElasticsearchRestJavaagentInstrumenterFactoryalign with existing common javaagent-module patterns, and related Elasticsearch RESTmetadata.yamlentries match the used config keys and defaults.Applied Changes
No safe automated changes were applied.
Module:
elasticsearch-rest-common-5.0:libraryModule path:
instrumentation/elasticsearch/elasticsearch-rest-common-5.0/librarySummary
Applied and committed one safe repository-guideline fix for
elasticsearch-rest-common-5.0library instrumentation.Applied Changes
Semconv
File:
ElasticsearchClientAttributeExtractor.java:28Change: Replaced direct static imports of semconv `AttributeKey` constants with copied local constants such as `HTTP_REQUEST_METHOD`, `SERVER_ADDRESS`, and `URL_FULL`.
Reason: Repository style guide requires library instrumentation to copy semantic convention constants directly instead of depending on semconv constants exposed by the semconv artifact.
Module:
elasticsearch-transport-5.0:javaagentModule path:
instrumentation/elasticsearch/elasticsearch-transport-5.0/javaagentSummary
Applied safe repository-guideline fixes in
elasticsearch-transport-5.0javaagent tests and source; one Gradle sibling-wiring issue remains unresolved because the deterministic fix failed local validation.Applied Changes
Style
File:
Elasticsearch5TransportAttributesGetter.java:26Change: Normalized annotation order so `@Override` precedes `@Nullable` on `getNetworkPeerPort()`.
Reason: Repository style favors consistent annotation ordering on overridden nullable methods.
Testing
File:
Elasticsearch5NodeClientTest.java:51Change: Replaced the class-scoped `@AfterAll` node close with `cleanup.deferAfterAll(testNode)`.
Reason: Testing guidance prefers `AutoCleanupExtension.deferAfterAll(...)` for class-scoped resources when the extension is already available.
File:
Elasticsearch5TransportClientTest.java:52Change: Replaced the class-scoped `@AfterAll` node close with `cleanup.deferAfterAll(testNode)` and added deferred cleanup for the `TransportClient`.
Reason: Testing guidance prefers `AutoCleanupExtension.deferAfterAll(...)` for class-scoped resources and avoids leaving `AutoCloseable` test clients unclosed.
Unresolved Items
File:
build.gradle.ktsReason: Needs manual fix: Gradle convention requires sibling `testInstrumentation` for `elasticsearch-transport-5.3` and `elasticsearch-transport-6.0`, but adding those entries made `:instrumentation:elasticsearch:elasticsearch-transport-5.0:javaagent:check` fail with muzzle failures from the sibling modules on the Elasticsearch 5.0 test classpath.
Module:
elasticsearch-transport-5.3:javaagentModule path:
instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagentSummary
Applied and committed one safe repository-guideline fix in
elasticsearch-transport-5.3javaagent tests. One build-wiring issue remains unresolved because the deterministic fix caused reproducible:instrumentation:elasticsearch:elasticsearch-transport-5.3:javaagent:checkmuzzle failures and was reverted.Applied Changes
Testing
File:
ElasticsearchSpringTest.java:8Change: Replaced repeated `Boolean.getBoolean(...)` reads with a cached `EXPERIMENTAL_ATTRIBUTES` flag in the shared experimental assertion helper.
Reason: `testing-experimental-flags.md` says experimental flags should be hoisted into an `EXPERIMENTAL_ATTRIBUTES` constant and reused by test assertions/helpers.
Unresolved Items
File:
build.gradle.ktsReason: Missing sibling `testInstrumentation` references for `elasticsearch-transport-5.0` and `elasticsearch-transport-6.0` match the `gradle-conventions.md` cross-version rule, but adding them caused `:instrumentation:elasticsearch:elasticsearch-transport-5.3:javaagent:check` to fail with `2 Muzzle failures during test`; the attempted fix was reverted and needs manual investigation.
Download code review diagnostics