[move-flow] Add update subcommand#20170
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87264cb16a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return Ok(()); | ||
| } | ||
|
|
||
| Update::configure() |
There was a problem hiding this comment.
Select the archive asset exactly
When a release contains both the documented archive and checksum assets, e.g. move-flow-v...-{target}.zip plus ...zip.sha256 (see aptos-move/flow/RELEASE.md), this updater leaves asset selection to self_update. In self_update 0.39.0, Release::asset_for chooses the first asset whose name contains the target, so if GitHub returns the checksum before the zip for a platform, move-flow update downloads the checksum text and extraction fails instead of updating. Select/download the exact .zip archive, or otherwise exclude .sha256 assets, before handing off to the updater.
Useful? React with 👍 / 👎.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
87264cb to
706f647
Compare
Same git pin and features as crates/aptos — already in Cargo.lock.
move-flow update [--check]
--check Print whether a newer version is available, no download.
(default) Fetch latest move-flow-v* release from aptos-labs/aptos-ai,
verify version, download matching platform zip, and atomically
replace the running binary.
Implementation notes:
- Uses the self_update crate (same banool fork + pin as the aptos CLI).
- Offloads the blocking reqwest call to tokio::task::spawn_blocking to
avoid panicking inside the async runtime.
- Strips .beta/.rc suffixes before bump_is_greater (x.y.z only).
- Hidden --repo-owner / --repo-name flags match the aptos CLI pattern
and allow pointing at alternative repos for testing.
706f647 to
b7c4258
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Keep the new self_update dependency in cargo-sort order so the rust-lints CI check passes. Co-authored-by: Cursor <cursoragent@cursor.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
Summary
Adds
move-flow update [--check]for in-place self-updating from theaptos-labs/aptos-aiGitHub releases.--checkreports availability without downloading.move-flow-v*release, verifies viabump_is_greater, and atomically replaces the binary on disk.self_updategit pin already used bycrates/aptos.1.1.0Test plan
cargo test -p aptos-move-flow update— 5 unit tests passcargo install --path aptos-move/flow --locked --profile cisucceedsmove-flow update --helpshows the subcommandcargo test -p aptos-move-flow update::live_github_check -- --ignored(run onceaptos-aiis public)Note
Medium Risk
Self-update replaces the running binary on disk and pulls artifacts from GitHub; failures are mostly localized but permission or wrong-release-repo issues could confuse users.
Overview
Adds
move-flow update [--check]so users can self-update fromaptos-labs/aptos-aiGitHub releases taggedmove-flow-v*, mirroring theself_updatepattern already used by theaptosCLI.--checkonly compares the running binary’s version to the latest release and prints whether an update exists. Without it, the command downloads and replaces themove-flowbinary when a newer version is available, with clearer errors for permission denied or missing platform assets.Wires the new
updatemodule into the CLI (runs on a blocking task), addsself_updateas a dependency, bumpsaptos-move-flowto 1.1.0, and documents the feature in the changelog. Unit tests cover version/tag parsing,--checkflag behavior, and an ignored live GitHub check.Reviewed by Cursor Bugbot for commit 5645214. Bugbot is set up for automated code reviews on this repo. Configure here.