Skip to content

test(otel): add virtual context conformance handler - #637

Merged
zhongkechen merged 1 commit into
mainfrom
codex/otel-virtual-context-conformance
Aug 20, 2026
Merged

test(otel): add virtual context conformance handler#637
zhongkechen merged 1 commit into
mainfrom
codex/otel-virtual-context-conformance

Conversation

@zhongkechen

@zhongkechen zhongkechen commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

Related conformance requirement: aws/aws-durable-execution-conformance-tests#96

Merge order: merge the shared conformance requirement PR first, then this Java SDK handler PR.

Description

Adds the Java SDK-owned Otel20VirtualContext handler for the new virtual child-context OTel scenario. The SAM template maps the handler to both otel-invocation-20 and otel-execution-20, selecting execution-view telemetry through OTEL_PLUGIN_MODE.

Demo/Screenshots

Not applicable; this change adds deployed conformance-test handlers.

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

No new unit test was added because this is a standalone conformance handler and template mapping with no new SDK behavior. The handler was compiled as part of the module package build.

Integration Tests

The paired end-to-end requirements are added in aws/aws-durable-execution-conformance-tests#96 and will run through the OTel conformance workflow. Locally, the standalone module packaged successfully with JAVA_SDK_VERSION=2.1.1-SNAPSHOT.

Examples

Added Otel20VirtualContext and invocation/execution SAM mappings.

Type: AWS::Serverless::Function
TestingMetadata:
TestDescription:
- otel-invocation-20

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex AI review

[P2] Advance the conformance suite pin

Normal PR/push runs still pass the fixed 0f0b5b... ref from .github/workflows/otel-conformance-tests.yml. Merging the prerequisite requirement does not update that SHA, so otel-*-20 will not be selected and this change receives no behavioral coverage. Update the workflow's uses and fallback conformance_test_ref SHAs to the merged commit containing requirement 20.

@github-actions

Copy link
Copy Markdown
Contributor

Codex AI review

One CI coverage gap remains; the handler and SAM wiring otherwise match existing patterns.

Reviewed commit 40e2839859f5f1d7b222403df1c69210340759b6. Workflow run

@github-actions

Copy link
Copy Markdown
Contributor

Claude AI review

No actionable findings.

This PR adds a single conformance handler (Otel20VirtualContext) and two SAM template mappings (otel-invocation-20, otel-execution-20). The change is minimal and consistent with the existing pattern in the conformance-tests-otel module:

  • Otel20VirtualContext.java uses the existing runInChildContext(name, Class<T>, Function, RunInChildContextConfig) overload and RunInChildContextConfig.builder().isVirtual(true), both present in the base revision. Imports resolve, the generic String return type is handled correctly, and virtual child contexts returning a plain value with no inner durable operations are supported by ChildContextOperation.
  • template.yaml additions use correct 2-space resource indentation, valid YAML, and set OTEL_PLUGIN_MODE: execution for the execution-suite mapping consistent with all other OtelExecution* resources.

Considered and discarded: (1) the class javadoc naming only otel-invocation-20 while dual-mapped matches the established convention (e.g. Otel5ChildContext); (2) absence of a unit test is consistent with this module (no test source tree exists) and the project rule that conformance scenarios live in the separate conformance-tests repo.

Residual test risk: correctness of the virtual-context telemetry is validated only by the paired conformance-repo scenarios and deployed-Lambda cloud runs (per the PR description), not by any in-repo unit/integration test. If the virtual child-context replay/telemetry behavior regresses in the SDK, nothing in this repo's automated test suite would catch it.

Reviewed commit 40e2839859f5f1d7b222403df1c69210340759b6. Workflow run

@zhongkechen
zhongkechen merged commit de0d944 into main Aug 20, 2026
12 of 22 checks passed
@zhongkechen
zhongkechen deleted the codex/otel-virtual-context-conformance branch August 20, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants