fix: keep refresh and frozen IAM setup-owned - #266
Conversation
| .deployment_config(&config) | ||
| .running_resource_policy(RunningResourcePolicy::OptIn) | ||
| .lifecycle_filter(lifecycle_filter_vec) | ||
| .lifecycle_filter(vec![ResourceLifecycle::Live]) |
There was a problem hiding this comment.
Frozen removals leave stale state
When a setup re-import removes a Frozen resource, import persistence retains the absent resource in StackState, and this Live-only executor no longer reconciles it. The update therefore reports success while subsequent dependency checks and health observations use state for a resource that setup already removed.
Knowledge Base Used: Deployment Engine (alien-deployment)
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/alien-deployment/src/updating.rs
Line: 299
Comment:
**Frozen removals leave stale state**
When a setup re-import removes a Frozen resource, import persistence retains the absent resource in `StackState`, and this Live-only executor no longer reconciles it. The update therefore reports success while subsequent dependency checks and health observations use state for a resource that setup already removed.
**Knowledge Base Used:** [Deployment Engine (alien-deployment)](https://app.greptile.com/alien/-/custom-context/knowledge-base/alienplatform/alien/-/docs/deployment-engine.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Greptile SummaryThe PR separates runtime reconciliation from setup-owned infrastructure management.
Confidence Score: 5/5The PR appears safe to merge. The previously reported stale Frozen-state issue is resolved because the import route preserves only omitted Live resources and the SQLite store persists the resulting complete state without merging old Frozen entries back in; no blocking failure remains.
|
| Filename | Overview |
|---|---|
| crates/alien-manager/src/routes/stack.rs | Re-import merging now preserves omitted Live controller state while allowing setup-omitted Frozen resources to disappear from the authoritative state. |
| crates/alien-manager/src/stores/sqlite/deployment.rs | Imported stack state now replaces the persisted snapshot rather than re-merging stale setup-owned resources. |
| crates/alien-deployment/src/updating.rs | Runtime update execution is restricted to Live resources and clears setup authorization after convergence. |
| crates/alien-infra/src/core/executor.rs | Introduces a planning-free refresh operation that steps persisted controllers without applying desired-state transitions. |
| crates/alien-deployment/src/running.rs | Running health ticks now use planning-free refresh and map controller failure states to RefreshFailed. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Setup["Setup re-import"] --> Merge["Merge imported setup state"]
Existing["Existing StackState"] --> Preserve["Preserve omitted Live state"]
Merge --> Complete["Complete ownership-aware StackState"]
Preserve --> Complete
Complete --> Persist["Replace persisted StackState"]
Persist --> Runtime["Runtime update reconciles Live resources"]
Persist --> Frozen["Frozen resources remain setup-owned"]
Reviews (2): Last reviewed commit: "fix: drop removed frozen state on reimpo..." | Re-trigger Greptile
Summary
Why
A periodic refresh planned desired-release drift as an update. That scheduled unchanged Frozen storage controllers, whose update path attempted
iam:PutRolePolicyagainst the setup-owned content service-account role. The management role correctly lacked that privilege.Validation
cargo test -p alien-preflights --lib(259 passed)cargo test -p alien-infra --all-features test_refresh_does_not_plan_config_changes --libcargo check -p alien-deployment --all-featuresgit diff --checkThe default-feature alien-infra lib test target is currently broken on main by cloud modules compiled without their feature-gated dependencies; validation used the full cloud feature set.