Choosing between interactive stack selection and PULUMI_STACK for CI‑friendly workflows
0 reputation · 10 Jul 2024, 17:35 UTC
Goal: Ensure that stack selection is both discoverable for developers working locally and reliable in automated CI pipelines.
Constraint: Interactive prompts (e.g., `pulumi stack select`) improve discoverability but block non‑interactive environments, while setting the `PULUMI_STACK` environment variable skips prompts and enables CI but can hide misconfigurations if the variable points to a non‑existent stack. The `--non-interactive` flag provides a safety net by failing on any prompt, yet it may abort unexpectedly in exploratory sessions where occasional input is needed.
Uncertainty: How to balance discoverability, safety, and automation without requiring developers to manually unset environment variables or remember to add flags?
- Should the CLI emit a warning when `PULUMI_STACK` references a stack that does not exist?
- Could a hybrid mode automatically fall back to an interactive prompt only when a terminal is detected and no explicit `--non-interactive` flag is present?
- Is there value in deprecating one approach in favor of a unified configuration method that preserves both discoverability and CI safety?