Skip to content

Code review sweep (run 25201305534)#18477

Merged
trask merged 10 commits into
mainfrom
otelbot/code-review-sweep-25201305534
May 1, 2026
Merged

Code review sweep (run 25201305534)#18477
trask merged 10 commits into
mainfrom
otelbot/code-review-sweep-25201305534

Conversation

@otelbot

@otelbot otelbot Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Automated code review sweep walked the following modules in order
and stopped after accumulating at least 10 modified files:

  • mongo-async-3.3:javaagent
  • mongo-common:testing
  • mybatis-3.2:javaagent
  • nats-2.17:javaagent
  • nats-2.17:library
  • nats-2.17:testing
  • netty-3.8:javaagent
  • netty-4.0:javaagent
  • netty-4.1:javaagent

Module: mongo-async-3.3:javaagent

Module path: instrumentation/mongo/mongo-async-3.3/javaagent

Summary

Reviewed all reviewable files under instrumentation/mongo/mongo-async-3.3/javaagent; no safe repository-guideline fixes were needed.

Applied Changes

No safe automated changes were applied.

Module: mongo-common:testing

Module path: instrumentation/mongo/mongo-common/testing

Summary

Applied one safe review fix and committed it as 99bb6032 (Review fixes for mongo-common testing).

Applied Changes

Semconv

File: AbstractMongoClientTest.java:50
Change: Moved the existing `@SuppressWarnings("deprecation")` for deprecated database semconv usage from `mongoSpan(...)` to the `AbstractMongoClientTest` class.
Reason: `testing-semconv-stability.md` requires class-level `@SuppressWarnings("deprecation")` when tests use old semconv constants; the existing explanatory `TODO DB_CONNECTION_STRING deprecation` comment was preserved per the suppression guidance.

Module: mybatis-3.2:javaagent

Module path: instrumentation/mybatis-3.2/javaagent

Summary

Applied and committed safe repository-guideline fixes for instrumentation/mybatis-3.2/javaagent. Module :instrumentation:mybatis-3.2:javaagent:check, :instrumentation:mybatis-3.2:javaagent:check -PtestLatestDeps=true, and final ./gradlew spotlessApply completed successfully.

Applied Changes

Style

File: SqlCommandUtil.java:15
Change: Renamed the private static `VirtualField` handle from `field` to `FIELD` and updated its references.
Reason: The repository style guide says constant-like semantic handles such as `VirtualField` should use `SCREAMING_SNAKE_CASE`, not lower camel case collaborator naming.

Testing

File: TestMapper.java:10
Change: Reduced `TestMapper` from `public interface` to package-private `interface`.
Reason: The testing guidance and style guide prefer package-private test classes and test support types when public visibility is not required.

Module: nats-2.17:javaagent

Module path: instrumentation/nats/nats-2.17/javaagent

Summary

Applied and committed one safe review fix for instrumentation/nats/nats-2.17/javaagent: aligned collectMetadata test configuration with the single-Test-task Gradle convention and kept assertInverse adjacent to versions in the muzzle block.

Applied Changes

Build

File: build.gradle.kts:23
Change: Moved `systemProperty("collectMetadata", otelProps.collectMetadata)` from `withType<Test>().configureEach` into the default `test` task and removed the blank line between `versions.set(...)` and `assertInverse.set(true)`.
Reason: `gradle-conventions.md` requires `collectMetadata` to be configured on `tasks.test` for single-test-task modules, and muzzle `assertInverse.set(true)` should be placed immediately after `versions.set(...)` when no `skip` is present.

Module: nats-2.17:library

Module path: instrumentation/nats/nats-2.17/library

Summary

No safe repository-guideline fixes were applied under instrumentation/nats/nats-2.17/library; reviewed source, test, Gradle, and mandatory metadata.yaml coverage with no in-scope deterministic issues found.

Applied Changes

No safe automated changes were applied.

Module: nats-2.17:testing

Module path: instrumentation/nats/nats-2.17/testing

Summary

Applied safe repository-guideline cleanup fixes in nats-2.17 testing and committed them as a316df7b.

Applied Changes

Testing

File: AbstractNatsPublishTest.java:28
Change: Replaced separate `@AfterEach` subscription draining with `cleanup.deferCleanup(...)` registered in `beforeEach()`.
Reason: The testing cleanup guideline prefers `AutoCleanupExtension.deferCleanup(...)` next to per-test resource creation instead of a separate teardown method that re-references the field.

File: AbstractNatsRequestTest.java:42
Change: Registered subscription draining and dispatcher closing with `cleanup.deferCleanup(...)` at creation sites, removing separate `@AfterEach`, manual close calls, and completion-callback cleanup.
Reason: The testing cleanup guideline prefers `AutoCleanupExtension.deferCleanup(...)` for resources intended to live until test end, keeping creation and cleanup together and ensuring cleanup runs regardless of test outcome.

Module: netty-3.8:javaagent

Module path: instrumentation/netty/netty-3.8/javaagent

Summary

Applied safe style fixes in netty-3.8 javaagent and committed them as 65c64129.

Applied Changes

Style

File: NettyHttpClientAttributesGetter.java:36
Change: Renamed the unused `URISyntaxException` catch parameter from `e` to `ignored`.
Reason: Repository catch-variable convention in `knowledge/general-rules.md` says intentionally unused catch parameters should be named `ignored`.

File: Netty38ClientTest.java:53
Change: Renamed unused `NoSuchMethodException` catch parameters from `e` to `ignored`.
Reason: Repository catch-variable convention in `knowledge/general-rules.md` says intentionally unused catch parameters should be named `ignored`.

Module: netty-4.0:javaagent

Module path: instrumentation/netty/netty-4.0/javaagent

Summary

Applied one safe metadata-format fix for the netty-4.0 instrumentation and committed it in 3fec1ec8; no unresolved issues remain.

Applied Changes

Config

File: metadata.yaml:13
Change: Added `declarative_name` mappings for all documented configuration entries, including common HTTP settings, Netty `connection_telemetry`/`ssl_telemetry`, and URL sanitization config.
Reason: `metadata-yaml-format.md` requires instrumentation metadata entries to include valid declarative config names, and the mandatory metadata validation for instrumentation modules requires flat `otel.instrumentation.*` properties to map to the corresponding declarative paths.

Module: netty-4.1:javaagent

Module path: instrumentation/netty/netty-4.1/javaagent

Summary

Applied and committed safe review fixes for instrumentation/netty/netty-4.1/javaagent.

Applied Changes

Javaagent

File: InstrumentedAddressResolverGroup.java:52
Change: Changed `newResolver(...)` to return an instrumented delegate resolver instead of throwing `UnsupportedOperationException`.
Reason: Repository javaagent guidance says javaagent instrumentation/helper code should not throw instrumentation-originated exceptions; delegating preserves resolver behavior without an impossible-path throw.

Testing

File: ChannelPipelineTest.java:78
Change: Replaced zero-size assertions like `assertThat(channelPipeline.toMap()).hasSize(0)` with `assertThat(channelPipeline.toMap()).isEmpty()`.
Reason: `testing-general-patterns.md` prefers AssertJ idiomatic collection assertions, including `isEmpty()` instead of `hasSize(0)`.


Download code review diagnostics

otelbot Bot added 7 commits May 1, 2026 04:02
Automated code review of instrumentation/mongo/mongo-common/testing.
Automated code review of instrumentation/mybatis-3.2/javaagent.
Automated code review of instrumentation/nats/nats-2.17/javaagent.
Automated code review of instrumentation/nats/nats-2.17/testing.
Automated code review of instrumentation/netty/netty-3.8/javaagent.
Automated code review of instrumentation/netty/netty-4.0/javaagent.
Automated code review of instrumentation/netty/netty-4.1/javaagent.
@otelbot otelbot Bot requested a review from a team as a code owner May 1, 2026 04:29
@trask trask enabled auto-merge (squash) May 1, 2026 13:33
@trask trask merged commit 36770e8 into main May 1, 2026
93 checks passed
@trask trask deleted the otelbot/code-review-sweep-25201305534 branch May 1, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant