Skip to content

Code review sweep (run 24948463943)#18307

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

Code review sweep (run 24948463943)#18307
trask merged 4 commits into
mainfrom
otelbot/code-review-sweep-24948463943

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:

  • aws-sdk-2.2:javaagent
  • aws-sdk-2.2:library
  • aws-sdk-2.2:library-autoconfigure
  • aws-sdk-2.2:testing

Module: aws-sdk-2.2:javaagent

Module path: instrumentation/aws-sdk/aws-sdk-2.2/javaagent

Summary

Reviewed instrumentation/aws-sdk/aws-sdk-2.2/javaagent, verified the scoped module's metadata.yaml entries against in-repo config usage, and applied safe singleton-pattern fixes in the javaagent sources.

Applied Changes

Style

File: AwsSdkSingletons.java:13
Change: Renamed the private singleton field from `TELEMETRY` to `telemetry` and kept the `telemetry()` accessor aligned with it.
Reason: Repository singleton guidance requires exported collaborator fields to use lower camel case, and the style guide reserves uppercase names for constant-like values rather than runtime-created collaborator objects.

File: DefaultBedrockRuntimeAsyncClientBuilderInstrumentation.java:8
Change: Replaced the qualified `AwsSdkSingletons.telemetry()` call with a static import and unqualified `telemetry()` usage.
Reason: `javaagent-singletons-patterns.md` says callers should static import exported singleton accessors and use them unqualified instead of qualifying them with the holder class.

File: DefaultSqsAsyncClientBuilderInstrumentation.java:8
Change: Replaced the qualified `AwsSdkSingletons.telemetry()` call with a static import and unqualified `telemetry()` usage.
Reason: `javaagent-singletons-patterns.md` says callers should static import exported singleton accessors and use them unqualified instead of qualifying them with the holder class.

File: DefaultSqsClientBuilderInstrumentation.java:8
Change: Replaced the qualified `AwsSdkSingletons.telemetry()` call with a static import and unqualified `telemetry()` usage.
Reason: `javaagent-singletons-patterns.md` says callers should static import exported singleton accessors and use them unqualified instead of qualifying them with the holder class.

File: TracingExecutionInterceptor.java:8
Change: Replaced the qualified `AwsSdkSingletons.telemetry()` call with a static import and unqualified `telemetry()` usage for the interceptor delegate.
Reason: `javaagent-singletons-patterns.md` says callers should static import exported singleton accessors and use them unqualified instead of qualifying them with the holder class.

Module: aws-sdk-2.2:library

Module path: instrumentation/aws-sdk/aws-sdk-2.2/library

Summary

Updated Aws2BedrockRuntimeTest to use exact Bedrock span attribute assertions while still handling dynamic values such as request IDs, URLs, and ports.

Applied Changes

Testing

File: Aws2BedrockRuntimeTest.java:164
Change: Replaced partial `hasAttributesSatisfying(...)` span checks with exact helper-backed assertions for the Bedrock no-message-content scenarios.
Reason: Repository testing guidance requires `hasAttributesSatisfyingExactly(...)` instead of `hasAttributesSatisfying(...)` because the non-exact variant can hide unexpected span attributes; the helper keeps those exact assertions deterministic for dynamic fields.

Module: aws-sdk-2.2:library-autoconfigure

Module path: instrumentation/aws-sdk/aws-sdk-2.2/library-autoconfigure

Summary

No safe repository-guideline fixes were needed under instrumentation/aws-sdk/aws-sdk-2.2/library-autoconfigure; the reviewed sources and the AWS SDK module's metadata.yaml usage were already consistent with the loaded review rules.

Applied Changes

No safe automated changes were applied.

Module: aws-sdk-2.2:testing

Module path: instrumentation/aws-sdk/aws-sdk-2.2/testing

Summary

Applied 8 safe review fixes under instrumentation/aws-sdk/aws-sdk-2.2/testing: shared async test paths now use join(), deterministic checked test exceptions were removed where possible, and JUnit helper visibility/suppression scope now matches repository guidance.

Applied Changes

Testing

File: AbstractAws2BedrockRuntimeTest.java:671
Change: Replaced async response `.get()` waits with `.join()` and removed the corresponding checked `throws` clauses from Bedrock streaming tests.
Reason: `testing-general-patterns.md` says test methods should avoid multi-exception `throws` clauses and prefer `join()` over `Future.get()` when the test only blocks on async completion.

File: AbstractAws2ClientCoreTest.java:318
Change: Updated the shared `wrapClient(...)` async proxy helper to return `CompletableFuture.join()` results instead of `get()`.
Reason: The shared testing helper followed the same `testing-general-patterns.md` guidance to prefer `join()` in tests, which removes checked exception handling from async test call sites.

File: AbstractAws2ClientTest.java:465
Change: Changed async S3 helpers to use `CompletableFuture` with `join()`, and replaced SQS `Callable<HttpResponse>` suppliers with `Supplier<HttpResponse>` so the parameterized tests no longer need broad checked `throws` clauses.
Reason: `testing-general-patterns.md` says test entry points should keep checked `throws` clauses to a single specific type when possible and prefer `join()` over `Future.get()` for async waits.

File: AbstractAws2SqsBaseTest.java:117
Change: Switched deterministic endpoint creation to `URI.create(...)`, removed the resulting `URISyntaxException` declarations, and converted async SQS waits from `.get()` to `.join()`.
Reason: `testing-general-patterns.md` favors removing unnecessary checked test exceptions, and `URI.create(...)` is the safe non-checked form for these fixed local test URLs.

File: AbstractAws2SqsSuppressReceiveSpansTest.java:98
Change: Dropped the now-unneeded `URISyntaxException` declaration from the SQS batch test.
Reason: After the shared SQS client helper stopped throwing a checked URI exception, `testing-general-patterns.md` calls for removing unnecessary checked `throws` clauses from test methods.

File: AbstractAws2SqsTracingTest.java:235
Change: Dropped the now-unneeded `URISyntaxException` declarations from the SQS tracing tests.
Reason: These tests no longer call a checked-throwing helper, so `testing-general-patterns.md` favors removing the redundant checked `throws` clauses.

Style

File: AbstractAws2ClientRecordHttpErrorTest.java:65
Change: Tightened helper visibility, made `httpErrorMessages` `final`, and removed the redundant class-level `@SuppressWarnings` in favor of the existing method-scoped suppression.
Reason: The style guide requires minimal necessary visibility and `final` fields where possible, and `general-rules.md` prefers method-level `@SuppressWarnings` when only one method needs the suppression.

File: AbstractQueryProtocolModelTest.java:39
Change: Made the JUnit lifecycle methods package-private.
Reason: The style guide's JUnit section says test classes and methods should generally use package-private visibility to follow minimal-visibility conventions.


Download code review diagnostics

otelbot Bot added 3 commits April 26, 2026 04:53
Automated code review of instrumentation/aws-sdk/aws-sdk-2.2/javaagent.
Automated code review of instrumentation/aws-sdk/aws-sdk-2.2/library.
Automated code review of instrumentation/aws-sdk/aws-sdk-2.2/testing.
@otelbot otelbot Bot requested a review from a team as a code owner April 26, 2026 05:26
@trask trask enabled auto-merge (squash) April 26, 2026 18:47
@trask trask merged commit d9fba53 into main Apr 26, 2026
94 checks passed
@trask trask deleted the otelbot/code-review-sweep-24948463943 branch April 26, 2026 19:03
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