From 00b8dba7d7fe2d5997a7f61f23eb240f77823042 Mon Sep 17 00:00:00 2001 From: Dylan O'Neill Date: Thu, 17 Sep 2026 09:23:50 -0700 Subject: [PATCH] docs: remove the internal staging host from a public repo packages/ai/README.md and packages/client/README.md named ld-stg.launchdarkly.com as the staging value for LD_UI_BASE_URI, and test_evaluations.py used it as a fixture. This repository is public, so that published an internal hostname for no benefit: a reader setting LD_UI_BASE_URI needs to know the option exists and why, not the name of LaunchDarkly's own non-production host, which they cannot reach anyway. Both README entries now say what the option is for -- set it for a non-production project, or its runs still link to the production app -- without naming a host. The tests move to ui.staging.example.com, which is the convention the rest of that file already follows (api.staging.example.com, relay.example.com, other.example.com, ui.example.com), so ld-stg was the only outlier. Distinct from ui.example.com on purpose: that test asserts the explicit option wins over the environment variable, which needs two different values to mean anything. Found while reviewing #89, but present on main independently of it and in three files that PR does not touch, so it is fixed here rather than inside a feature branch. Co-Authored-By: Claude Opus 5 --- packages/ai/README.md | 2 +- packages/client/README.md | 2 +- packages/client/tests/test_evaluations.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/ai/README.md b/packages/ai/README.md index b1b47a70..355dcdce 100644 --- a/packages/ai/README.md +++ b/packages/ai/README.md @@ -73,7 +73,7 @@ result = await evals.run( ) ``` -`LD_API_TOKEN` is required. Configure `LD_SDK_KEY` — or initialize your own client with `init_client(client=...)` — to emit one `$ld:ai:offline-evals:generation` event per generated row, plus one `$ld:ai:offline-evals:criterion` event per `(row, criterion)` when `criteria` are supplied, through the standard SDK event transport. The SDK reports scores; LaunchDarkly rules on them at ingest. A judge served by a different provider than `generation` needs a handler for it in `judge_handlers`. Use `LD_API_BASE_URI` for staging or local management API traffic; it is separate from the SDK delivery setting `LD_BASE_URI`. Evaluation-run links use the explicit `ui_base_uri` option or `LD_UI_BASE_URI` (for example, `https://ld-stg.launchdarkly.com` in staging), defaulting to `https://app.launchdarkly.com`. See the [core evaluations guide](../client/README.md#run-an-evaluation-from-code). +`LD_API_TOKEN` is required. Configure `LD_SDK_KEY` — or initialize your own client with `init_client(client=...)` — to emit one `$ld:ai:offline-evals:generation` event per generated row, plus one `$ld:ai:offline-evals:criterion` event per `(row, criterion)` when `criteria` are supplied, through the standard SDK event transport. The SDK reports scores; LaunchDarkly rules on them at ingest. A judge served by a different provider than `generation` needs a handler for it in `judge_handlers`. Use `LD_API_BASE_URI` for staging or local management API traffic; it is separate from the SDK delivery setting `LD_BASE_URI`. Evaluation-run links use the explicit `ui_base_uri` option or `LD_UI_BASE_URI`, defaulting to `https://app.launchdarkly.com`; set it when the project is not in production, or a run created elsewhere still links to the production app. See the [core evaluations guide](../client/README.md#run-an-evaluation-from-code). --- diff --git a/packages/client/README.md b/packages/client/README.md index 1e50a5ec..66a3924e 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -42,7 +42,7 @@ No code changes are required — `init_client()` detects the packages at runtime | `LD_API_TOKEN` | For evaluations | API access token used by the evaluations management API | | `LD_SDK_KEY` | For evaluations | SDK key whose event transport carries generation results to LaunchDarkly | | `LD_API_BASE_URI` | No | Evaluations management API host override; intentionally separate from `LD_BASE_URI` | -| `LD_UI_BASE_URI` | No | LaunchDarkly application host for evaluation-run links (default: `https://app.launchdarkly.com`; staging: `https://ld-stg.launchdarkly.com`) | +| `LD_UI_BASE_URI` | No | LaunchDarkly application host for evaluation-run links (default: `https://app.launchdarkly.com`). Set it for a non-production project, or its runs still link to the production app | ### Run an evaluation from code diff --git a/packages/client/tests/test_evaluations.py b/packages/client/tests/test_evaluations.py index 57edf189..0a4ce0e3 100644 --- a/packages/client/tests/test_evaluations.py +++ b/packages/client/tests/test_evaluations.py @@ -180,7 +180,7 @@ def test_ui_base_uri_precedence_and_api_base_isolation( monkeypatch.setenv("LD_API_TOKEN", "api-token") monkeypatch.setenv("LD_SDK_KEY", "sdk-key") monkeypatch.setenv("LD_API_BASE_URI", "https://api.staging.example.com") - monkeypatch.setenv("LD_UI_BASE_URI", "https://ld-stg.launchdarkly.com/") + monkeypatch.setenv("LD_UI_BASE_URI", "https://ui.staging.example.com/") from_env = init_evaluations(transport=RecordingTransport()) explicit = init_evaluations( @@ -188,7 +188,7 @@ def test_ui_base_uri_precedence_and_api_base_isolation( ) assert from_env.api.base_uri == "https://api.staging.example.com" - assert from_env.ui_base_uri == "https://ld-stg.launchdarkly.com" + assert from_env.ui_base_uri == "https://ui.staging.example.com" assert explicit.ui_base_uri == "https://ui.example.com"