Skip to content

Code review sweep (run 24965011499)#18321

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

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

Conversation

@otelbot

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

  • hibernate-6.0:spring-testing
  • hibernate-common:javaagent
  • hibernate-procedure-call-4.3:javaagent
  • hibernate-reactive-1.0:hibernate-reactive-2.0-testing
  • hibernate-reactive-1.0:javaagent
  • hibernate:testing

Module: hibernate-6.0:spring-testing

Module path: instrumentation/hibernate/hibernate-6.0/spring-testing

Summary

Applied 2 safe review fixes in hibernate-6.0 by adding the required metadata declarative_name and renaming non-attribute test satisfies(...) lambda parameters to descriptive names; :instrumentation:hibernate:hibernate-6.0:spring-testing:check, :instrumentation:hibernate:hibernate-6.0:spring-testing:check -PtestLatestDeps=true, :instrumentation-docs:test --tests DeclarativeConfigValidationTest, and ./gradlew spotlessApply succeeded.

Applied Changes

[Config]

File: metadata.yaml:5
Change: Added `declarative_name: java.hibernate.experimental_span_attributes/development` for `otel.instrumentation.hibernate.experimental-span-attributes`.
Reason: `.github/agents/knowledge/metadata-yaml-format.md` requires every `metadata.yaml` config entry to include `declarative_name`, and the `/development` suffix must match the flat property's `experimental` marker.

[Testing]

File: SpringJpaTest.java:300
Change: Renamed the two non-attribute `span.satisfies(...)` lambda parameters from generic `val` to descriptive `spanData`.
Reason: `.github/agents/knowledge/testing-general-patterns.md` says non-attribute `satisfies(...)` lambdas should use a descriptive subject name instead of generic `val`.

Unresolved Items

File: build.gradle.kts
Reason: `otel.instrumentation.hibernate.experimental-span-attributes=true` is applied in `withType<Test>().configureEach`, so experimental coverage is not isolated in a dedicated `testExperimental` task. The review workflow marks missing `testExperimental` isolation as a manual follow-up instead of an auto-fix; move that flag to a separate experimental test task while leaving default `test` coverage unflagged.

Module: hibernate-common:javaagent

Module path: instrumentation/hibernate/hibernate-common/javaagent

Summary

Reviewed all files under instrumentation/hibernate/hibernate-common/javaagent and applied the only safe deterministic fix: tightened same-package getter visibility in the shared Hibernate javaagent code to follow the repository's minimal-visibility rule without changing any cross-package APIs used by sibling modules.

Applied Changes

[Style]

File: HibernateOperation.java:24
Change: Changed `getName()` and `getSessionId()` from `public` to package-private because they are only called from code in `io.opentelemetry.javaagent.instrumentation.hibernate`.
Reason: The style guide requires the most restrictive visibility that still works; search confirmed these getters are not used outside the package, so `public` was unnecessary in this internal javaagent code.

File: SessionInfo.java:21
Change: Changed `getSessionId()` from `public` to package-private because it is only consumed by same-package Hibernate helper code.
Reason: The repository style guide's minimal-visibility rule applies here: this internal getter had no cross-package callers, so reducing it to package-private removes unnecessary API surface safely.

Module: hibernate-procedure-call-4.3:javaagent

Module path: instrumentation/hibernate/hibernate-procedure-call-4.3/javaagent

Summary

Applied one safe review fix in hibernate-procedure-call-4.3 by making ProcedureCallInstrumentation's advice signatures explicitly nullable where the module already passes null at runtime; metadata.yaml usage and module validation were clean.

Applied Changes

Style

File: ProcedureCallInstrumentation.java:48
Change: Added `@Nullable` to the `startMethod()` return and to the `@Advice.Thrown` / `@Advice.Enter` parameters in `endMethod()`.
Reason: The review rules require accurate nullability annotations when a method can actually return or receive `null`; here `startMethod()` returns `null` on depth-skip and the exit advice receives that nullable enter state plus an absent throwable on successful execution.

Module: hibernate-reactive-1.0:hibernate-reactive-2.0-testing

Module path: instrumentation/hibernate/hibernate-reactive-1.0/hibernate-reactive-2.0-testing

Summary

Applied one safe fix in hibernate-reactive-2.0-testing: renamed the Value.setName(...) parameter to match the assigned field, addressing a small copy/paste mismatch while leaving the rest of the module unchanged.

Applied Changes

General

File: Value.java:40
Change: Renamed the `setName(...)` parameter from `title` to `name` and assigned it with `this.name = name` for consistency with the entity field.
Reason: The repository's `[General]` review rules call for correcting copy/paste mistakes and misleading identifiers; using `name` here matches the field and avoids a stale `title` parameter name.

Module: hibernate-reactive-1.0:javaagent

Module path: instrumentation/hibernate/hibernate-reactive-1.0/javaagent

Summary

Applied three safe helper cleanups in hibernate-reactive-1.0/javaagent: reordered wrapper construction sections to match the style-guide placement for static factory entry points, and narrowed the internally used ContextOperator constructor to private.

Applied Changes

Style

File: ContextOperator.java:18
Change: Moved the `plug(...)` static factory above the constructor and changed the constructor from `public` to `private`.
Reason: The style guide places static factory entry points in the construction section above constructors, and the minimal-visibility rule allows `private` because `ContextOperator` is only instantiated inside its own class.

File: FunctionWrapper.java:16
Change: Moved the `wrap(...)` static factory above the constructor.
Reason: The style guide says classes whose primary creation API is a static factory should place that factory in the construction section immediately above constructors.

File: CompletionStageWrapper.java:15
Change: Moved the private utility-class constructor to the end of the class.
Reason: The style guide requires private constructors in static utility classes to appear after all methods.

Module: hibernate:testing

Module path: instrumentation/hibernate/testing

Summary

Applied one safe review fix in instrumentation/hibernate/testing: ExperimentalTestHelper.experimental(...) now marks its input parameter @Nullable to match the nullable attribute values passed by Hibernate test callers. No unresolved issues remain in the reviewed files.

Applied Changes

Style

File: ExperimentalTestHelper.java:23
Change: Annotated the `experimental(...)` parameter with `@Nullable`.
Reason: `general-rules.md` requires accurate nullability annotations when callers can pass `null`; Hibernate tests pass nullable results from `Attributes.get(...)` into this helper, so the parameter should reflect that concrete null flow.


Download code review diagnostics

otelbot Bot added 6 commits April 26, 2026 19:49
Automated code review of instrumentation/hibernate/hibernate-6.0/spring-testing.
Automated code review of instrumentation/hibernate/hibernate-common/javaagent.
Automated code review of instrumentation/hibernate/hibernate-procedure-call-4.3/javaagent.
Automated code review of instrumentation/hibernate/hibernate-reactive-1.0/hibernate-reactive-2.0-testing.
Automated code review of instrumentation/hibernate/hibernate-reactive-1.0/javaagent.
Automated code review of instrumentation/hibernate/testing.
@otelbot otelbot Bot requested a review from a team as a code owner April 26, 2026 20:26
@trask trask enabled auto-merge (squash) April 26, 2026 21:13
@trask trask merged commit 15d8264 into main Apr 26, 2026
267 of 271 checks passed
@trask trask deleted the otelbot/code-review-sweep-24965011499 branch April 26, 2026 21:33
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