Repository navigation
fix(preview): provide generated secrets during import - #348
Conversation
There was a problem hiding this comment.
💡 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) |
There was a problem hiding this comment.
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 👍 / 👎.
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)
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.