Skip to content

Honor s2s-request-translation=false header in Unary TranslationInterceptor#230

Merged
hehaifengcn merged 2 commits into
mainfrom
haifengh/skip-trans
May 14, 2026
Merged

Honor s2s-request-translation=false header in Unary TranslationInterceptor#230
hehaifengcn merged 2 commits into
mainfrom
haifengh/skip-trans

Conversation

@hehaifengcn
Copy link
Copy Markdown
Collaborator

@hehaifengcn hehaifengcn commented May 14, 2026

What was changed

Use s2s-request-translation=false in the grpc header to disable Translator in WorkflowService. This is so we can check original data such as original namespace without any translation.

without header

temporal operator namespace list --address localhost:6333 | head
  NamespaceInfo.Name                    myNamespace.accountid

with header

temporal operator namespace list --address localhost:6333 --grpc-meta "s2s-request-translation=false"  | head
  NamespaceInfo.Name                    myNamespace

Why?

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

hehaifengcn and others added 2 commits May 14, 2026 15:13
- interceptor/translation_interceptor.go: short-circuit Intercept to the
  raw handler when IsRequestTranslationDisabled(ctx), matching the
  existing InterceptStream behavior. Refactor the prefix check into a
  guard clause and fix latent precedence around the Workflow/Admin
  prefix OR.
- proxy/workflowservice.go: copyContext now also forwards
  common.RequestTranslationHeaderName, so the disable signal survives
  the proxy hop alongside xdc-redirection.
- .vscode/launch.json: add debug entries for the cluster-a mux client
  and cluster-b mux server configs.
- develop/config/cluster-a-mux-client-proxy.yaml: add a sample
  namespaceTranslation mapping so the opt-out path can be exercised
  against a local mux pair.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- interceptor/translation_interceptor_test.go: new table-driven
  TestTranslationInterceptor backed by a spyTranslator. Verifies that
  an incoming s2s-request-translation=false header short-circuits
  translator invocation in the unary path, and that an absent header
  drives MatchMethod/TranslateRequest/TranslateResponse as expected.
- proxy/workflowservice.go: extract PreservedHeaders (xdc-redirection
  and s2s-request-translation) and use it from copyContext, so the
  list of forwarded headers lives in one place.
- proxy/workflowservice_test.go: rename TestPreserveRedirectionHeader
  to TestPreservedHeaders and iterate over PreservedHeaders so adding
  a header to the list automatically extends test coverage.
- interceptor/translation_interceptor.go: drop the
  IsRequestTranslationDisabled check from InterceptStream; only
  intra-proxy streams skip translation. The header gate stays on the
  unary path only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hehaifengcn hehaifengcn marked this pull request as ready for review May 14, 2026 22:55
@hehaifengcn hehaifengcn requested a review from a team as a code owner May 14, 2026 22:55
@hehaifengcn hehaifengcn changed the title Honor s2s-request-translation=false header in WorkflowService Honor s2s-request-translation=false header in Unary Interceptor May 14, 2026
@hehaifengcn hehaifengcn changed the title Honor s2s-request-translation=false header in Unary Interceptor Honor s2s-request-translation=false header in Unary TranslationInterceptor May 14, 2026
@hehaifengcn hehaifengcn merged commit 05a5a9a into main May 14, 2026
5 checks passed
@hehaifengcn hehaifengcn deleted the haifengh/skip-trans branch May 14, 2026 23:59
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