Skip to content

Add liteswap traffic-routing support to Config - #1846

Open
Sankalp-Mittal wants to merge 1 commit into
mainfrom
sankalp-mittal/add-lightswap-headers
Open

Sankalp-Mittal wants to merge 1 commit into
mainfrom
sankalp-mittal/add-lightswap-headers

Conversation

@Sankalp-Mittal

@Sankalp-Mittal Sankalp-Mittal commented Sep 16, 2026

Copy link
Copy Markdown

Summary

Adds an opt-in Config.LiteswapTarget that routes API requests to a liteswap test instance of a service in shared pre-production, by adding a routing header on top of normal authentication.

Why

Lets a developer point any SDK-based tool (and the CLI, once it bumps the SDK) at a pre-prod liteswap deployment via a single env var or profile field, with no per-service code. Empty by default, so production traffic is unaffected.

What changed

  • Config.LiteswapTarget (env DATABRICKS_LITESWAP_TARGET, profile field liteswap_target) — when set, every request gets the header x-databricks-traffic-id: testenv://liteswap/<target>.

    To use it, either set the environment variable DATABRICKS_LITESWAP_TARGET=<target> before running your program, or add liteswap_target = <target> to the profile in your .databrickscfg. From then on every request made with that config routes to the named liteswap unit. Leave it unset to route to production as normal.

This pull request and its description were written by Isaac.

Add an opt-in Config.LiteswapTarget field (env DATABRICKS_LITESWAP_TARGET,
profile field liteswap_target) that routes API requests to a liteswap test
instance of a service in shared pre-production. When set, the SDK adds the
'x-databricks-traffic-id: testenv://liteswap/<target>' routing header on top
of normal authentication via a request visitor in HTTPClientConfigFromConfig,
covering every generated service method and raw client call with no per-service
code. Empty (the default) is a no-op. Intended for dev/test only.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Sankalp Mittal <sankalp.mittal@databricks.com>
@github-actions

Copy link
Copy Markdown

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-go

Inputs:

  • PR number: 1846
  • Commit SHA: 472080011a5c0736d81e09eb38190e85a06cdeb5

Checks will be approved automatically on success.

@Sankalp-Mittal
Sankalp-Mittal deployed to test-trigger-is September 16, 2026 14:14 — with GitHub Actions Active
@Sankalp-Mittal
Sankalp-Mittal marked this pull request as draft September 16, 2026 14:19
@Sankalp-Mittal
Sankalp-Mittal deployed to test-trigger-is September 17, 2026 08:14 — with GitHub Actions Active
@Sankalp-Mittal
Sankalp-Mittal deployed to test-trigger-is September 17, 2026 08:14 — with GitHub Actions Active
@Sankalp-Mittal
Sankalp-Mittal deployed to test-trigger-is September 17, 2026 08:15 — with GitHub Actions Active
@Sankalp-Mittal
Sankalp-Mittal marked this pull request as ready for review September 17, 2026 09:32
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.

1 participant