Skip to content

Add opt-in header codec processing - #3165

Merged
Sushisource merged 2 commits into
mainfrom
normalize-header-conversion
Nov 6, 2026
Merged

Sushisource merged 2 commits into
mainfrom
normalize-header-conversion

Conversation

@Sushisource

@Sushisource Sushisource commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

What was changed

  • Add default-false ContextPropagator.encodeHeaders() and OpenTracing/OpenTelemetry options using the configured client's payload codec, compatible with existing propagator implementations.
  • Encode only opted-in producers' output, leaving application-supplied wire-ready headers unchanged. Opted-in inbound consumers receive decoded copies; tracing keeps standard serialization. Encoding ownership follows the producer’s key and payload instance.
  • Preserve destination contexts, header presence, raw schedule retention, storage ordering, and once-only multioperation processing, without converter policy wrappers or a separate header-only codec chain.

Breaking changes: None. Existing producers default to false; custom converter wrappers can forward PayloadCodecProvider to expose their codec.
Server PR: Not required.

Why?

Part of temporalio/features#850. Tracing and context propagators can opt into the configured client codec without double-encoding unrelated user-supplied headers or changing existing defaults.

Checklist

  1. Related issue: Normalize Header Data Conversion across languages features#850 (this PR does not close the cross-SDK issue).
  2. How was this tested:
    • Mixed producers, plaintext/pre-encoded header isolation, contextual binding, and codec errors/cardinality.
    • Client/worker boundaries, tracing, storage, retained schedules, child namespaces, reused multioperation headers, and activity/Nexus client propagation. Targeted Gradle suites and Spotless passed using scratch protobuf sources from the exact pinned API commits because local submodules are partial; one existing memo test was skipped. Full suites and remote CI were not verified.
  3. Any docs updates needed? Public API documentation and changelog included; the README section was removed during review. API guidance covers producer opt-in, configured-client codecs, compatible decoders, and wrapper forwarding.

Latest rebase validation

Rebased onto main at fdd71321; current head cb0e386d. Resolved the changelog by retaining both sets of entries and the activity executor import conflict by retaining both header-codec and payload-limit imports. No README diff remains.

Post-rebase spotlessApply and targeted Gradle tests passed for HeaderUtilsTest, ActivityTaskExecutorsTest, HeaderCodecClientTest, ScheduleProtoUtilTest, RootWorkflowClientInvokerStorageTargetTest, SyncWorkflowContextTest, and OpenTracing HeaderCodecTest. This used a scratch-only Gradle init script with the exact pinned API/cloud proto sources and submodule update tasks disabled; the unmodified formatting invocation was blocked by populated partial submodule directories. Full test suites and cross-language tests were not rerun after rebasing.

@Sushisource
Sushisource force-pushed the normalize-header-conversion branch 7 times, most recently from f0ef77f to 37a747d Compare October 30, 2026 00:51
@Sushisource
Sushisource marked this pull request as ready for review October 30, 2026 22:08
@Sushisource
Sushisource requested a review from a team as a code owner October 30, 2026 22:08
Comment thread README.md Resolved
@Sushisource
Sushisource force-pushed the normalize-header-conversion branch from 37a747d to cb0e386 Compare November 5, 2026 22:31
@Sushisource
Sushisource merged commit 783e1a4 into main Nov 6, 2026
36 of 37 checks passed
@Sushisource
Sushisource deleted the normalize-header-conversion branch November 6, 2026 16:56
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