fix(self): update atomacially to avoid bricking on failure#180
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe self-update flow now stages downloads in a temporary ChangesSelf-update staging and verification
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant SelfUpdate
participant SHARED_AGENT
participant Filesystem
SelfUpdate->>Filesystem: download binary to .update.part
SelfUpdate->>SHARED_AGENT: fetch .b3sum checksum asset
SHARED_AGENT-->>SelfUpdate: checksum body or failure
alt checksum fetch failed
SelfUpdate->>SelfUpdate: warn and skip verification
end
alt download failed
SelfUpdate->>Filesystem: remove staging file
else download succeeded
SelfUpdate->>Filesystem: rename staging file to executable
end
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying soar-docs with
|
| Latest commit: |
959767a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ec3e0f8f.soar-docs.pages.dev |
| Branch Preview URL: | https://fix-self-update.soar-docs.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/soar-cli/src/self_actions.rs`:
- Around line 165-174: The checksum lookup in self_actions.rs currently
conflates a missing .b3sum asset with a published checksum that fails to fetch,
so the update can continue without verification. Update the logic around the
asset lookup and fetch_expected_checksum call to distinguish “no checksum asset
exists” from “checksum asset exists but could not be retrieved,” and in the
latter case abort the update instead of just warning. Use the existing
asset.name() lookup and expected_checksum handling in the update flow to fail
closed when a published checksum is unreachable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9deb88c3-0f44-4fa2-9474-7d73533284db
📒 Files selected for processing (1)
crates/soar-cli/src/self_actions.rs
Summary by CodeRabbit
New Features
Bug Fixes