Skip to content

fix: recover failed setup resources before refresh - #548

Merged
alongubkin merged 1 commit into
mainfrom
alon/alien-629-retry-failed-setup-resources
Aug 31, 2026
Merged

alongubkin merged 1 commit into
mainfrom
alon/alien-629-retry-failed-setup-resources

Conversation

@alongubkin

Copy link
Copy Markdown
Member

Summary

Direct setup refresh could re-enter InitialSetup while a setup-owned resource still had a failed status from the previous lifecycle. Initial setup then classified the resource as terminally failed before its controller had a chance to reconcile.

This change:

  • adds lifecycle-filtered failed-resource retry to stack state
  • retries only Frozen resources before a direct setup refresh
  • leaves failed Live resources under runtime ownership

Tests

  • filtered retry recovers a frozen refresh-failed resource while leaving a live failed resource unchanged
  • failed setup lifecycle states remain eligible for direct setup preparation

Linear: ALIEN-629

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown

Greptile Summary

The PR recovers setup-owned resources before re-entering direct initial setup while preserving runtime ownership of Live resources.

  • Adds lifecycle-filtered failed-resource retries to StackStateExt.
  • Retries only Frozen resources during direct setup preparation.
  • Adds coverage showing Frozen failures recover without changing Live failures.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete correctness or security failures identified in the changed paths.

The filtered helper reuses established retry behavior, limits direct setup recovery to setup-owned Frozen resources, and leaves Live resource failures under runtime ownership as intended.

Important Files Changed

Filename Overview
crates/alien-deploy-cli/src/commands/up.rs Direct setup preparation now retries failed Frozen resources before entering InitialSetup while retaining the existing reconcile-and-release flow.
crates/alien-infra/src/core/state_utils.rs Adds a lifecycle-filtered retry helper and a regression test confirming that Frozen failures recover while Live failures remain unchanged.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Acquire deployment and reload manager state] --> B{Direct setup preparation required?}
    B -->|No| F[Run shared step loop]
    B -->|Yes| C[Prepare direct setup metadata]
    C --> D[Retry failed Frozen resources]
    D --> E[Set status to InitialSetup]
    E --> F
    F --> G[Final reconcile and release]
Loading

Reviews (1): Last reviewed commit: "fix: retry failed setup resources before..." | Re-trigger Greptile

@alongubkin
alongubkin merged commit cdc63ef into main Aug 31, 2026
46 of 48 checks passed
@alongubkin
alongubkin deleted the alon/alien-629-retry-failed-setup-resources branch August 31, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant