You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move direct engine state lifecycle to top-level callers (#4928)
## Changes
- Move state lifecycle (`Open`/`Finalize`) from internal methods to
top-level command callers, so state is opened exactly once per command.
Double-open panics.
- Script-based `bundle run` no longer pulls remote state it doesn't
need.
- Skip the `/api/2.0/preview/scim/v2/Me` call during `bundle run` when
only `ErrorOnEmptyState` is set.
- Skip state file creation when deploy/destroy plans are empty.
## Why
The previous pattern hid `Open`/`Finalize` inside low-level methods,
making it hard to reason about when state was opened, whether it would
be written, and whether double-opens could occur. Lifting the lifecycle
to callers makes the invariant obvious and enforceable, and avoids
unnecessary state I/O and API calls in read-only flows.
Preparation for WAL & metadata service.
## Tests
- Unit tests for `DeploymentState`: open/save/finalize round-trip, panic
on double open, delete tracking.
- Existing acceptance tests cover deploy, destroy, `bundle run`, and
config-remote-sync flows.
0 commit comments