Skip to content

feat(deploy): catch-all tenant at provision + remove hardcoded tenant ids from pro.yaml#341

Merged
epappas merged 1 commit into
mainfrom
feat/lifecycle-catchall-and-dehardcode
May 30, 2026
Merged

feat(deploy): catch-all tenant at provision + remove hardcoded tenant ids from pro.yaml#341
epappas merged 1 commit into
mainfrom
feat/lifecycle-catchall-and-dehardcode

Conversation

@epappas

@epappas epappas commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Removes the hardcoded 6ae1ab34 tenant id I should never have baked in, and implements the catch-all (Option A — lifecycle-provided). Pairs with the proxy Option-B fallback PR.

Changes

  • Catch-all (Option A): provision() generates a fresh uuid.uuid4(), sets it on the proxy env as LLMTRACE_DEFAULT_TENANT_ID before the proxy starts, then creates the "catch-all" tenant (idempotent) once healthy. Returned to the caller as catch_all_tenant_id.
  • Operator tenant id — caller-owned, no hardcode: _resolve_operator_tenant_id uses a caller-supplied tenant_uuid/LLMTRACE_TENANT_UUID verbatim (stable identity across recreate); if empty, generates a fresh uuid, returns it, and warns it is ephemeral unless stored + re-passed. No hardcoded fallback.
  • pro.yaml: tenant_uuid: "${LLMTRACE_TENANT_UUID:-}" (no default); LLMTRACE_DEFAULT_TENANT_ID line removed. 6ae1ab34 appears nowhere (guard test enforces this).

Tests

6 new (catch-all generated/set/created/returned; no catch-all when auth off; supplied vs empty tenant_uuid; whitespace; pro.yaml 6ae1ab34 guard); persistent-storage test strengthened for the second (catch-all) create.

Verification

  • py_compile 0; pro.yaml yaml.safe_load 0.
  • pytest deployments/basilica/tests: +6 new passing vs base; 0 new failures (4 fail / 2 error are pre-existing env issues — basilica SDK shadow + network-sandbox DNS — reproduced identically on base).

Note: this is deploy tooling + pro.yaml — it does NOT change the baked proxy image; it takes effect at the next provision. Operator-tenant id value is yours to set via LLMTRACE_TENANT_UUID.

… hardcoded tenant ids from pro.yaml

Lifecycle Option A: provision() now generates a fresh catch-all tenant id
(uuid.uuid4), sets it on the proxy env as LLMTRACE_DEFAULT_TENANT_ID before
the proxy is created, and after the proxy is healthy materialises a
"catch-all" tenant row via the idempotent POST /api/v1/tenants path. The id
is returned to the caller as TenantInstances.catch_all_tenant_id.

Operator tenant id is now caller-owned with no hardcoded fallback: a
supplied tenant_uuid is used as the stable id; an empty/absent one triggers
a fresh uuid4, which is used, returned as operator_tenant_id, and logged with
a WARNING that the identity is ephemeral unless the caller stores and
re-passes it.

pro.yaml: tenant_uuid default is now empty (no hardcoded UUID) and the
LLMTRACE_DEFAULT_TENANT_ID env line is removed (lifecycle sets it, proxy
self-provisions if absent). The 6ae1ab34 id no longer appears anywhere.
import threading
import uuid
from http.server import BaseHTTPRequestHandler, HTTPServer
from typing import Any, Callable, Optional
@epappas epappas merged commit 5afee41 into main May 30, 2026
14 checks passed
@epappas epappas deleted the feat/lifecycle-catchall-and-dehardcode branch May 30, 2026 16:04
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