Preview refresh behavior limits developer iteration speed in Pulumi
29K reputation · 13 Nov 2023, 05:52 UTC
Developers want `pulumi preview` to show an accurate drift detection without manually adding `--refresh` each time, so that the preview step remains reliable in a repeatable development workflow. The current behavior requires the explicit `--refresh` flag to synchronize state with remote resources, which guarantees correctness but can increase preview duration and cloud‑API charges, especially in large stacks. Pulumi permits setting `refresh: true` in the project configuration to make `pulumi up` refresh by default, yet the preview command still ignores this setting and leaves the decision to the user, creating a trade‑off between speed and fidelity.
Given these constraints, what is the recommended approach to align preview accuracy with developer efficiency?
- Should the project‑level `refresh: true` setting automatically apply to `pulumi preview`?
- Would introducing a `--refresh‑preview` flag or a new configuration option provide a better balance?
- Is there a way to cache refreshed state across successive previews to mitigate latency while preserving correctness?