Skip to content

fix: complete updates after resource removal#173

Merged
alongubkin merged 1 commit into
mainfrom
alon/alien-318-complete-updates-after-resource-removal
Jul 21, 2026
Merged

fix: complete updates after resource removal#173
alongubkin merged 1 commit into
mainfrom
alon/alien-318-complete-updates-after-resource-removal

Conversation

@alongubkin

Copy link
Copy Markdown
Member

Summary

  • compute update completion against the desired stack
  • ignore only successfully deleted resources that are absent from the target
  • preserve deletion tombstones and whole-stack deletion semantics

Validation

  • cargo nextest run -p alien-deployment --test test_platform update_completes_after_removed_resource_is_deleted
  • confirmed the same state transition against a live managed deployment

@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown

Greptile Summary

This PR makes update completion depend on the desired stack. The main changes are:

  • Ignore deleted tombstones for resources removed from the target.
  • Preserve status checks for target resources and incomplete removals.
  • Add a test for completing an update after resource deletion.

Confidence Score: 5/5

The normal resource-removal flow looks mergeable, but empty-target update semantics should be clarified.

  • Completed removals no longer block release promotion.
  • In-progress and failed removals still participate in status aggregation.
  • An empty desired stack can be reported as Running after every resource is deleted.

crates/alien-deployment/src/updating.rs

Important Files Changed

Filename Overview
crates/alien-deployment/src/updating.rs Adds target-aware status aggregation, with an empty-target edge case that can turn a fully deleted stack into Running.
crates/alien-deployment/tests/test_platform.rs Adds coverage for release promotion after a removed resource reaches Deleted while preserving its tombstone.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
crates/alien-deployment/src/updating.rs:34-36
**Empty Target Becomes Running**

When an update has an empty target stack and its last resource reaches `Deleted`, the filter removes every status and this branch reports `Running`. The previous aggregation reported an all-deleted state as `Deleted`, so a whole-stack removal submitted through the update path can promote an empty deployment as running instead of preserving deletion semantics.

Reviews (1): Last reviewed commit: "fix: complete updates after resource rem..." | Re-trigger Greptile

Comment on lines +34 to +36
if statuses.is_empty() {
return Ok(StackStatus::Running);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Empty Target Becomes Running

When an update has an empty target stack and its last resource reaches Deleted, the filter removes every status and this branch reports Running. The previous aggregation reported an all-deleted state as Deleted, so a whole-stack removal submitted through the update path can promote an empty deployment as running instead of preserving deletion semantics.

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/alien-deployment/src/updating.rs
Line: 34-36

Comment:
**Empty Target Becomes Running**

When an update has an empty target stack and its last resource reaches `Deleted`, the filter removes every status and this branch reports `Running`. The previous aggregation reported an all-deleted state as `Deleted`, so a whole-stack removal submitted through the update path can promote an empty deployment as running instead of preserving deletion semantics.

How can I resolve this? If you propose a fix, please make it concise.

@alongubkin
alongubkin merged commit 3c5631b into main Jul 21, 2026
14 checks passed
@alongubkin
alongubkin deleted the alon/alien-318-complete-updates-after-resource-removal branch July 21, 2026 13:13
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