Skip to content

Code review sweep (run 25199276408)#18475

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

Code review sweep (run 25199276408)#18475
trask merged 7 commits into
mainfrom
otelbot/code-review-sweep-25199276408

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:

  • logback-appender-1.0:testing
  • logback-mdc-1.0:javaagent
  • logback-mdc-1.0:library
  • logback-mdc-1.0:testing
  • methods:javaagent
  • micrometer-1.5:javaagent
  • micrometer-1.5:library
  • micrometer-1.5:testing
  • mongo-3.1:javaagent
  • mongo-3.1:library
  • mongo-3.1:testing
  • mongo-3.7:javaagent
  • mongo-4.0:javaagent

Module: logback-appender-1.0:testing

Module path: instrumentation/logback/logback-appender-1.0/testing

Summary

No safe repository-guideline fixes were applied. Reviewed instrumentation/logback/logback-appender-1.0/testing and validated the module metadata.yaml entries against declarative config usage; no deterministic changes were needed.

Applied Changes

No safe automated changes were applied.

Module: logback-mdc-1.0:javaagent

Module path: instrumentation/logback/logback-mdc-1.0/javaagent

Summary

No safe fixes were applied. A potential assertInverse.set(true) muzzle-convention fix was attempted and reverted because :instrumentation:logback:logback-mdc-1.0:javaagent:muzzle showed the instrumentation still passes outside the declared range.

Applied Changes

No safe automated changes were applied.

Unresolved Items

File: build.gradle.kts
Reason: The Gradle muzzle convention prefers `assertInverse.set(true)` for bounded `versions.set(...)` ranges, but adding it caused inverse muzzle failures for logback versions outside `[1.0.0,1.2.3]` (for example `1.2.7`, `1.4.2`, `1.4.7`, and `1.5.32`). This needs a manual version-boundary decision, such as widening the supported range or adding a validated matcher/fail strategy, rather than an automatic review fix.

Module: logback-mdc-1.0:library

Module path: instrumentation/logback/logback-mdc-1.0/library

Summary

Applied safe repository-guideline fixes under instrumentation/logback/logback-mdc-1.0/library and committed them in f8f1bba4.

Applied Changes

Nullability

File: OpenTelemetryAppender.java:28
Change: Annotated `MDC_MAP_FIELD` with `@Nullable`.
Reason: `knowledge/general-rules.md` nullability correctness requires fields to be annotated `@Nullable` when they can hold `null`; this field is set to `null` when reflective lookup fails.

Style

File: LogbackTest.java:19
Change: Made the `@RegisterExtension` field `testing` `final`.
Reason: `docs/contributing/style-guide.md` says fields should be `final` where possible; this extension field is assigned once.

File: LogbackWithBaggageTest.java:15
Change: Made the `@RegisterExtension` field `testing` `final`.
Reason: `docs/contributing/style-guide.md` says fields should be `final` where possible; this extension field is assigned once.

File: LogbackWithLoggingKeysTest.java:15
Change: Made the `@RegisterExtension` field `testing` `final`.
Reason: `docs/contributing/style-guide.md` says fields should be `final` where possible; this extension field is assigned once.

Module: logback-mdc-1.0:testing

Module path: instrumentation/logback/logback-mdc-1.0/testing

Summary

No safe repository-guideline fixes were applied under instrumentation/logback/logback-mdc-1.0/testing; the scoped files already follow the loaded style, testing, metadata, and Gradle review guidance.

Applied Changes

No safe automated changes were applied.

Module: methods:javaagent

Module path: instrumentation/methods/javaagent

Summary

No safe repository-guideline fixes were found under instrumentation/methods/javaagent; no files were changed.

Applied Changes

No safe automated changes were applied.

Module: micrometer-1.5:javaagent

Module path: instrumentation/micrometer/micrometer-1.5/javaagent

Summary

Applied and committed one safe repository-guideline fix in micrometer-1.5 javaagent.

Applied Changes

Style

File: TimeUnitParser.java:24
Change: Changed the JUL `logger` to use `TimeUnitParser.class.getName()` and removed the now-unused `OpenTelemetryMeterRegistry` import.
Reason: `knowledge/general-rules.md` says javaagent runtime logging should preserve local module/class logger identity; using another class name obscured the warning source.

Module: micrometer-1.5:library

Module path: instrumentation/micrometer/micrometer-1.5/library

Summary

No safe repository-guideline fixes were found in instrumentation/micrometer/micrometer-1.5/library; no files were changed.

Applied Changes

No safe automated changes were applied.

Module: micrometer-1.5:testing

Module path: instrumentation/micrometer/micrometer-1.5/testing

Summary

Applied and committed safe review fixes for micrometer-1.5 testing: replaced Attributes.empty() metric-point assertions with exact zero-attribute assertions and removed now-unused imports.

Applied Changes

Testing

File: AbstractFunctionTimerTest.java:206
Change: Replaced `hasAttributes(Attributes.empty())` with `hasAttributesSatisfyingExactly()` and removed the unused `Attributes` import.
Reason: `testing-general-patterns.md` prefers exact attribute assertions over `hasAttributes(...)`; for metric point assertions, zero-argument `hasAttributesSatisfyingExactly()` is the supported exact zero-attribute form.

File: AbstractLongTaskTimerHistogramTest.java:58
Change: Replaced zero-attribute `hasAttributes(Attributes.empty())` checks with `hasAttributesSatisfyingExactly()` and removed the unused `Attributes` import.
Reason: `testing-general-patterns.md` prefers exact attribute assertions over `hasAttributes(...)`; for metric point assertions, zero-argument `hasAttributesSatisfyingExactly()` is the supported exact zero-attribute form.

File: AbstractTimerTest.java:118
Change: Replaced zero-attribute `hasAttributes(Attributes.empty())` checks with `hasAttributesSatisfyingExactly()` and removed the unused `Attributes` import.
Reason: `testing-general-patterns.md` prefers exact attribute assertions over `hasAttributes(...)`; for metric point assertions, zero-argument `hasAttributesSatisfyingExactly()` is the supported exact zero-attribute form.

Unresolved Items

File: AbstractGaugeTest.java
Reason: `testWeakRefGauge()` still declares `InterruptedException, TimeoutException`; changing it to single `Exception` fails Error Prone `InterruptedExceptionSwallowed`, and wrapping solely to narrow the `@Test` throws clause is disallowed by `testing-general-patterns.md`.

Module: mongo-3.1:javaagent

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

Summary

Applied and committed one safe review fix for mongo-3.1 javaagent.

Applied Changes

Javaagent

File: MongoClientInstrumentationModule.java:57
Change: Moved `MongoClientAdvice` inside `MongoClientOptionsBuilderInstrumentation`, changed advice lookup to `getClass().getName() + "$MongoClientAdvice"`, and narrowed the nested advice class visibility.
Reason: Repository `javaagent-advice-patterns.md` requires advice classes to be nested inside the `TypeInstrumentation` that applies them; the transform guideline prefers `getClass().getName()` for nested advice references, and Error Prone `EffectivelyPrivate` requires avoiding `public` on an effectively private nested class.

Module: mongo-3.1:library

Module path: instrumentation/mongo/mongo-3.1/library

Summary

No safe repository-guideline fixes were found in instrumentation/mongo/mongo-3.1/library; no files were changed.

Applied Changes

No safe automated changes were applied.

Module: mongo-3.1:testing

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

Summary

No safe repository-guideline fixes were applied under instrumentation/mongo/mongo-3.1/testing; reviewed files already match applicable style, testing, Gradle, and mandatory metadata.yaml guidance.

Applied Changes

No safe automated changes were applied.

Module: mongo-3.7:javaagent

Module path: instrumentation/mongo/mongo-3.7/javaagent

Summary

No safe repository-guideline fixes were found in instrumentation/mongo/mongo-3.7/javaagent; the reviewed source, test, Gradle, and metadata.yaml patterns already match the applicable Javaagent, testing, Gradle, singleton, classloader matcher, and metadata rules.

Applied Changes

No safe automated changes were applied.

Module: mongo-4.0:javaagent

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

Summary

Applied one safe repository-guideline fix and committed it as e110aec8 (Review fixes for mongo-4.0 javaagent).

Applied Changes

Build

File: build.gradle.kts:25
Change: Removed unused `testImplementation("de.flapdoodle.embed:de.flapdoodle.embed.mongo:1.50.5")`.
Reason: `gradle-conventions.md` says to remove unused or redundant dependencies; the module tests use `mongo-common:testing`, whose shared base uses Testcontainers, and no source in this module references Flapdoodle.


Download code review diagnostics

otelbot Bot added 5 commits May 1, 2026 02:35
Automated code review of instrumentation/logback/logback-mdc-1.0/library.
Automated code review of instrumentation/micrometer/micrometer-1.5/javaagent.
Automated code review of instrumentation/micrometer/micrometer-1.5/testing.
Automated code review of instrumentation/mongo/mongo-3.1/javaagent.
Automated code review of instrumentation/mongo/mongo-4.0/javaagent.
@otelbot otelbot Bot requested a review from a team as a code owner May 1, 2026 03:09
…version

The Span Attribute Assertions guidance in the knowledge base targets spans,
where hasTotalAttributeCount(0) is the preferred form for zero-attribute
checks. Metric point assertions do not have hasTotalAttributeCount and
point.hasAttributes(Attributes.empty()) reads more clearly than the no-arg
point.hasAttributesSatisfyingExactly() form. Update the knowledge base to
make this scope explicit and revert the rewrites in the micrometer-1.5
abstract tests.
@trask trask enabled auto-merge (squash) May 1, 2026 13:21
@trask trask merged commit 33492e1 into main May 1, 2026
93 checks passed
@trask trask deleted the otelbot/code-review-sweep-25199276408 branch May 1, 2026 15:57
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