Skip to content

Code review sweep (run 25135365127)#18421

Merged
trask merged 6 commits into
mainfrom
otelbot/code-review-sweep-25135365127
Apr 30, 2026
Merged

Code review sweep (run 25135365127)#18421
trask merged 6 commits into
mainfrom
otelbot/code-review-sweep-25135365127

Conversation

@otelbot

@otelbot otelbot Bot commented Apr 29, 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:

  • cassandra-4.0:javaagent
  • cassandra-4.4:javaagent
  • cassandra-4.4:library
  • cassandra-4.4:testing
  • cassandra-common-4.0:testing
  • clickhouse-client-common:javaagent
  • clickhouse-client-v1-0.5:javaagent
  • clickhouse-client-v2-0.8:javaagent
  • couchbase-2.0:javaagent
  • couchbase-2.6:javaagent
  • couchbase-3.1.6:javaagent
  • couchbase-3.1.6:tracing-opentelemetry-shaded
  • couchbase-3.1:javaagent

Module: cassandra-4.0:javaagent

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

Summary

Applied one safe repository-guideline fix in cassandra-4.0 javaagent and committed it as ef6a940b.

Applied Changes

Javaagent

File: CassandraClientInstrumentationModule.java:31
Change: Normalized chained `hasClassesNamed(...)` landmark checks in `classLoaderMatcher()` to keep single-class checks on one line with version comments immediately above each matcher call.
Reason: `javaagent-module-patterns.md` requires chained single-class `hasClassesNamed(...)` calls to keep the class string inline and place version-boundary comments directly above the relevant matcher.

Module: cassandra-4.4:javaagent

Module path: instrumentation/cassandra/cassandra-4.4/javaagent

Summary

Applied safe repository-guideline fixes for instrumentation/cassandra/cassandra-4.4/javaagent and committed them in 31b0c846.

Applied Changes

Build

File: build.gradle.kts:9
Change: Changed the open-ended muzzle range from `versions.set("[4.4,]")` to `versions.set("[4.4,)")`.
Reason: `gradle-conventions.md` requires proper Maven version range syntax such as `"[1.0,)"` for javaagent muzzle `pass` blocks.

Javaagent

File: CompletionStageFunction.java:8
Change: Added a static import for `CassandraSingletons.telemetry` and changed the call site to `telemetry().wrap(...)`.
Reason: `javaagent-singletons-patterns.md` says callers should static import exported `*Singletons` accessors and use them unqualified.

Module: cassandra-4.4:library

Module path: instrumentation/cassandra/cassandra-4.4/library

Summary

No safe deterministic fixes were applied under instrumentation/cassandra/cassandra-4.4/library. The module metadata.yaml entry for otel.instrumentation.common.db.query-sanitization.enabled matches the library builder default and declarative-name rules.

Applied Changes

No safe automated changes were applied.

Unresolved Items

File: CassandraTelemetry.java
Reason: `CassandraTelemetry` is a public library API class that appears subclassable; making it `final` or narrowing its protected constructor would align with the style/library patterns, but it is source-incompatible for a published library artifact and should be handled as an explicit non-stable API breaking change with changelog/release intent.

File: CassandraTelemetryBuilder.java
Reason: `CassandraTelemetryBuilder` has protected construction/customization hooks while the library pattern prefers a `final` builder with a package-private constructor, but changing that public/protected API is source-incompatible and requires an explicit non-stable API breaking-change decision rather than an automatic review fix.

Module: cassandra-4.4:testing

Module path: instrumentation/cassandra/cassandra-4.4/testing

Summary

No safe repository-guideline fixes were applied. Reviewed scoped source under instrumentation/cassandra/cassandra-4.4/testing and the module metadata.yaml; existing hasAttributesSatisfyingExactly(...), AutoCleanupExtension, semconv, dependency, and config metadata patterns match repository guidance.

Applied Changes

No safe automated changes were applied.

Module: cassandra-common-4.0:testing

Module path: instrumentation/cassandra/cassandra-common-4.0/testing

Summary

No safe repository-guideline fixes were applied after reviewing instrumentation/cassandra/cassandra-common-4.0/testing; the reviewable build.gradle.kts and AbstractCassandraTest.java already align with the loaded style, testing, Gradle, and metadata guidance.

Applied Changes

No safe automated changes were applied.

Module: clickhouse-client-common:javaagent

Module path: instrumentation/clickhouse/clickhouse-client-common/javaagent

Summary

No safe repository-guideline fixes were found in instrumentation/clickhouse/clickhouse-client-common/javaagent; no files were changed.

Applied Changes

No safe automated changes were applied.

Module: clickhouse-client-v1-0.5:javaagent

Module path: instrumentation/clickhouse/clickhouse-client-v1-0.5/javaagent

Summary

Applied and committed one safe review fix for clickhouse-client-v1-0.5 javaagent: nullable ByteBuddy advice values are now declared explicitly.

Applied Changes

Nullability

File: ClickHouseClientV1Instrumentation.java:51
Change: Added `@Nullable` to the `onEnter()` return, nullable `@Advice.Argument`, nullable `@Advice.Thrown`, and nullable `@Advice.Enter` parameters.
Reason: Repository nullability guidance requires annotating values that can actually be `null`; this advice returns `null` to skip instrumentation, instrumented callers can pass a `null` `ClickHouseRequest`, `@Advice.Thrown` is `null` on successful execution, and `@Advice.Enter` is `null` when enter advice skips span creation.

Module: clickhouse-client-v2-0.8:javaagent

Module path: instrumentation/clickhouse/clickhouse-client-v2-0.8/javaagent

Summary

Applied and committed safe repository-guideline fixes for clickhouse-client-v2-0.8 javaagent.

Applied Changes

Nullability

File: ClickHouseClientV2Instrumentation.java:49
Change: Added `@Nullable` to nullable advice return, `@Advice.Argument`, `@Advice.Thrown`, and `@Advice.Enter` values.
Reason: Repository nullability guidance requires annotating values that can be `null`; the advice returns `null`, accepts a nullable query argument, receives nullable thrown exceptions, and may receive a nullable `ClickHouseScope`.

File: ClickHouseClientV2Singletons.java:41
Change: Added `@Nullable` to `getAddressAndPort()` return value and the `setAddressAndPort()` `endpoint` parameter.
Reason: Repository nullability guidance requires annotating concrete nullable flows; `VirtualField.get()` can return `null`, and callers pass `null` when no ClickHouse endpoint is available.

Style

File: ClickHouseClientV2Test.java:59
Change: Renamed literal static final test fields to uppercase constant names: `DATABASE_NAME`, `TABLE_NAME`, `USERNAME`, and `PASSWORD`.
Reason: The style guide requires uppercase names for constant-like fields such as stable literal string constants.

Module: couchbase-2.0:javaagent

Module path: instrumentation/couchbase/couchbase-2.0/javaagent

Summary

No safe repository-guideline fixes were needed under instrumentation/couchbase/couchbase-2.0/javaagent; reviewed source, tests, build.gradle.kts, sibling testInstrumentation wiring, and mandatory metadata.yaml config coverage.

Applied Changes

No safe automated changes were applied.

Module: couchbase-2.6:javaagent

Module path: instrumentation/couchbase/couchbase-2.6/javaagent

Summary

Applied one safe repository-guideline fix under instrumentation/couchbase/couchbase-2.6/javaagent and committed it as 5127bde7.

Applied Changes

Testing

File: Couchbase26Util.java:27
Change: Replaced repeated `Boolean.getBoolean(...)` checks with a module-level `EXPERIMENTAL_ATTRIBUTES` flag constant.
Reason: The testing guideline for flag-gated assertions says to read experimental flags through a shared/per-module constant instead of repeated inline `Boolean.getBoolean(...)` calls.

Module: couchbase-3.1.6:javaagent

Module path: instrumentation/couchbase/couchbase-3.1.6/javaagent

Summary

Applied and committed one safe repository-guideline fix for couchbase-3.1.6 javaagent tests.

Applied Changes

Testing

File: CouchbaseClient316Test.java:65
Change: Registered the dedicated `ClusterEnvironment` with `cleanup.deferAfterAll(environment::shutdown)`.
Reason: Repository test resource cleanup guidance requires class-scoped resources created in `@BeforeAll` to be cleaned up with `AutoCleanupExtension.deferAfterAll(...)`; the sibling Couchbase 3.1 test already uses this pattern for the same resource.

Module: couchbase-3.1.6:tracing-opentelemetry-shaded

Module path: instrumentation/couchbase/couchbase-3.1.6/tracing-opentelemetry-shaded

Summary

No safe repository-guideline fixes were applied. The only tracked file under instrumentation/couchbase/couchbase-3.1.6/tracing-opentelemetry-shaded is build.gradle.kts, and it already matches the established Couchbase shaded-module Gradle pattern; generated build/ artifacts were skipped as non-reviewable outputs. The module metadata.yaml has no config entries and no Couchbase instrumentation config usage was found requiring metadata changes.

Applied Changes

No safe automated changes were applied.

Module: couchbase-3.1:javaagent

Module path: instrumentation/couchbase/couchbase-3.1/javaagent

Summary

Applied and committed one safe repository-guideline fix for couchbase-3.1 javaagent.

Applied Changes

Javaagent

File: CouchbaseEnvironmentInstrumentation.java:39
Change: Changed the `GlobalOpenTelemetry.getTracer(...)` instrumentation scope from `io.opentelemetry.javaagent.couchbase-3.1` to `io.opentelemetry.couchbase-3.1`.
Reason: Repository javaagent naming guidance expects instrumentation names to match `io.opentelemetry.<module-name>`; this also aligns the older `Tracer`-based Couchbase shim with sibling Couchbase modules.


Download code review diagnostics

otelbot Bot added 6 commits April 29, 2026 22:08
Automated code review of instrumentation/cassandra/cassandra-4.0/javaagent.
Automated code review of instrumentation/cassandra/cassandra-4.4/javaagent.
Automated code review of instrumentation/clickhouse/clickhouse-client-v1-0.5/javaagent.
Automated code review of instrumentation/clickhouse/clickhouse-client-v2-0.8/javaagent.
Automated code review of instrumentation/couchbase/couchbase-2.6/javaagent.
Automated code review of instrumentation/couchbase/couchbase-3.1.6/javaagent.
@otelbot otelbot Bot requested a review from a team as a code owner April 29, 2026 22:53
@trask trask force-pushed the otelbot/code-review-sweep-25135365127 branch from 832de3b to 545c40b Compare April 30, 2026 01:25
@trask trask enabled auto-merge (squash) April 30, 2026 01:28
@trask trask merged commit 9e058b9 into main Apr 30, 2026
94 checks passed
@trask trask deleted the otelbot/code-review-sweep-25135365127 branch April 30, 2026 01:44
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