Repository navigation
fix: rename self-update command to 'uteke upgrade' - #603
Merged
Merged
Conversation
Check for latest release on GitHub, compare against installed version, prompt for confirmation, download with checksum verification, and atomically replace the running binary. Features: - Detects current binary path automatically - OS/arch detection (linux/darwin, x86_64/aarch64) - Primary: parse GitHub 302 redirect (no API rate limit) - Fallback: GitHub REST API - SHA256 checksum verification from release assets - Archive path traversal protection (CWE-22) - Atomic rename replace (safe on POSIX) - New binary verification before swap - --yes flag for non-interactive / CI use - Already-up-to-date detection (skip download) - Missing dev headers warning for cargo-installed binaries Closes #581
- Rename Commands::Update → Commands::Upgrade to avoid collision with existing document update command (uteke doc update <id>) - Remove from AgingCommands (semantically wrong — self-update is not aging) - Change return type from Result<(), Box<dyn Error>> → Result<(), String> to match the dispatcher contract - Fix entry.path() bug: was calling .map_err() on Cow<Path> which is not a Result type - Fix all .into() calls that no longer compile with String error type - Rename update.rs → upgrade.rs module file
🔍 Cora AI Code Review❌ Blocked — critical issues found. 🔴 Error (2)
Review powered by cora-cli · BYOK · MIT |
Upgrade was accidentally placed inside DocCommands enum instead of the top-level Commands enum. This caused: - E0599: no variant 'Upgrade' in Commands (dispatcher couldn't find it) - E0004: non-exhaustive DocCommands::Upgrade (doc handler doesn't handle it)
| return Err(format!( | ||
| "New binary failed to run: {}", | ||
| String::from_utf8_lossy(&output.stderr) | ||
| )); |
| ("linux", "x86_64") => Ok("x86_64-unknown-linux-gnu".into()), | ||
| ("linux", "aarch64") => Ok("aarch64-unknown-linux-gnu".into()), | ||
| ("darwin", "aarch64") => Ok("aarch64-apple-darwin".into()), | ||
| ("darwin", "x86_64") => { |
ajianaz
added a commit
that referenced
this pull request
Aug 13, 2026
fix: rename self-update command to 'uteke upgrade'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 5 compilation errors from #601 by renaming the self-update command from
uteke updatetouteke upgrade.Problem
Commands::Updatealready exists as a document partial-update command (uteke doc update <id>, #589). The self-update PR created a naming collision that caused all CI checks to fail.Changes
cli.rsCommands::Upgradevariant, removedAgingCommands::Update(wrong enum)commands/mod.rsmod update→mod upgrade, dispatcher usesCommands::Upgradecommands/upgrade.rsResult<(), Box<dyn Error>>→Result<(), String>, fixedentry.path()Cow bug, all.into()callsResolved errors
entry.path()returnsCow<Path>, notResult— removed invalid.map_err()Err(String).into()type mismatch withBox<dyn Error>Commands::Update { yes }didn't match existingCommands::UpdatefieldsBox<dyn Error>vsString)AgingCommands::Update(removed — semantically wrong)Closes #601, Closes #581