Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion python/envctl_engine/pr_preview_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
"ENVCTL_BACKEND_ENV__",
"ENVCTL_FRONTEND_ENV__",
)
PR_PREVIEW_SERVICE_ENV_OVERLAY_PATTERN = re.compile(
r"^ENVCTL_[A-Z][A-Z0-9_]*_ENV__[A-Z_][A-Z0-9_]*$"
)
FAILED_START_STATUSES = frozenset({"public_route_unhealthy", "start_failed"})
PUBLIC_ROUTE_HEALTH_DEADLINE_SECONDS = 30.0
PUBLIC_ROUTE_HEALTH_INTERVAL_SECONDS = 2.0
Expand Down Expand Up @@ -847,7 +850,11 @@ def pr_preview_start_env_overrides() -> dict[str, str]:
return {
key: value
for key, value in os.environ.items()
if key.startswith(PR_PREVIEW_START_ENV_PREFIXES) and str(value).strip()
if (
key.startswith(PR_PREVIEW_START_ENV_PREFIXES)
or PR_PREVIEW_SERVICE_ENV_OVERLAY_PATTERN.fullmatch(key)
)
and str(value).strip()
}


Expand Down
10 changes: 10 additions & 0 deletions tests/python/runtime/test_pr_preview_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,14 @@ def test_labeled_event_imports_branch_with_isolated_deps_and_saves_state(
"ENVCTL_FRONTEND_ENV__VITE_PADDLE_CLIENT_TOKEN",
"test-client-token",
)
monkeypatch.setenv(
"ENVCTL_VOICE_RUNTIME_ENV__DEEPGRAM_API_KEY",
"deepgram-preview-key",
)
monkeypatch.setenv(
"ENVCTL_VOICE_RUNTIME_ENV__CARTESIA_API_KEY",
"cartesia-preview-key",
)

exit_code = instance.run_pull_request_event(
pr_payload(
Expand Down Expand Up @@ -743,6 +751,8 @@ def test_labeled_event_imports_branch_with_isolated_deps_and_saves_state(
assert start_call["env"]["ENVCTL_SOURCE_PADDLE_GROWTH_MONTHLY_PRICE_ID"] == "pri_growth_monthly"
assert start_call["env"]["ENVCTL_BACKEND_ENV__PADDLE_BILLING_ENABLED"] == "true"
assert start_call["env"]["ENVCTL_FRONTEND_ENV__VITE_PADDLE_CLIENT_TOKEN"] == "test-client-token"
assert start_call["env"]["ENVCTL_VOICE_RUNTIME_ENV__DEEPGRAM_API_KEY"] == "deepgram-preview-key"
assert start_call["env"]["ENVCTL_VOICE_RUNTIME_ENV__CARTESIA_API_KEY"] == "cartesia-preview-key"
assert start_call["env"]["ENVCTL_BACKEND_ENV__FRONTEND_BASE_URL"] == "https://pele-monorepo-pr-789.srv.example.test"
assert (
start_call["env"]["ENVCTL_BACKEND_ENV__BACKEND_PUBLIC_URL"]
Expand Down
Loading