Skip to content

fix(preview): provide generated secrets during import - #348

Merged
kfiramar merged 1 commit into
mainfrom
fix/pr-preview-import-generated-secrets
Jul 12, 2026
Merged

kfiramar merged 1 commit into
mainfrom
fix/pr-preview-import-generated-secrets

Conversation

@kfiramar

@kfiramar kfiramar commented Jul 12, 2026 •

Copy link
Copy Markdown
Collaborator

Generate the repository preview environment once and pass it to both envctl import and start. This lets PR-owned structured service overlays reference generated Pipecat secrets during import.\n\nValidation:\n- uv run --with pytest pytest -q tests/python/runtime/test_pr_preview_controller.py::test_repository_envctl_config_drives_dynamic_public_service_and_secrets\n- envctl test-focused --ship-on-pass (ruff passed; branch committed and pushed)


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@kfiramar
kfiramar merged commit 011e0a4 into main Jul 12, 2026
3 checks passed
@kfiramar
kfiramar deleted the fix/pr-preview-import-generated-secrets branch July 12, 2026 16:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f940c4988

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


start_env = self.envctl_command_env()
start_env.update(pr_preview_start_env_overrides())
start_env.update(repository_preview_env)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve configured preview source secrets

In previews where the runner already exports an ENVCTL_SOURCE_<NAME> that is also listed in the PR's ENVCTL_PREVIEW_GENERATED_SECRETS, this update replaces that configured value with the newly generated one. Before this change apply_repository_preview_env ran against start_env and used setdefault, so supplied source values were preserved; now the helper is called on an empty dict and this line overlays the random values after envctl_command_env()/pr_preview_start_env_overrides(). That breaks pinned or rotated secrets by starting and importing with credentials other than the ones configured on the preview runner.

Useful? React with 👍 / 👎.

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