Code review sweep (run 24965011499)#18321
Merged
Merged
Conversation
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.
trask
approved these changes
Apr 26, 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:
hibernate-6.0:spring-testinghibernate-common:javaagenthibernate-procedure-call-4.3:javaagenthibernate-reactive-1.0:hibernate-reactive-2.0-testinghibernate-reactive-1.0:javaagenthibernate:testingModule:
hibernate-6.0:spring-testingModule path:
instrumentation/hibernate/hibernate-6.0/spring-testingSummary
Applied 2 safe review fixes in
hibernate-6.0by adding the required metadatadeclarative_nameand renaming non-attribute testsatisfies(...)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 spotlessApplysucceeded.Applied Changes
[Config]
File:
metadata.yaml:5Change: 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:300Change: 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.ktsReason: `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:javaagentModule path:
instrumentation/hibernate/hibernate-common/javaagentSummary
Reviewed all files under
instrumentation/hibernate/hibernate-common/javaagentand 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:24Change: 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:21Change: 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:javaagentModule path:
instrumentation/hibernate/hibernate-procedure-call-4.3/javaagentSummary
Applied one safe review fix in
hibernate-procedure-call-4.3by makingProcedureCallInstrumentation's advice signatures explicitly nullable where the module already passesnullat runtime;metadata.yamlusage and module validation were clean.Applied Changes
Style
File:
ProcedureCallInstrumentation.java:48Change: 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-testingModule path:
instrumentation/hibernate/hibernate-reactive-1.0/hibernate-reactive-2.0-testingSummary
Applied one safe fix in
hibernate-reactive-2.0-testing: renamed theValue.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:40Change: 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:javaagentModule path:
instrumentation/hibernate/hibernate-reactive-1.0/javaagentSummary
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 usedContextOperatorconstructor toprivate.Applied Changes
Style
File:
ContextOperator.java:18Change: 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:16Change: 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:15Change: 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:testingModule path:
instrumentation/hibernate/testingSummary
Applied one safe review fix in
instrumentation/hibernate/testing:ExperimentalTestHelper.experimental(...)now marks its input parameter@Nullableto match the nullable attribute values passed by Hibernate test callers. No unresolved issues remain in the reviewed files.Applied Changes
Style
File:
ExperimentalTestHelper.java:23Change: 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