Skip to content

[move-flow] Add update subcommand#20170

Merged
zwxxb merged 3 commits into
aptos-labs:mainfrom
zwxxb:feature/move-flow-update-command
Jul 1, 2026
Merged

[move-flow] Add update subcommand#20170
zwxxb merged 3 commits into
aptos-labs:mainfrom
zwxxb:feature/move-flow-update-command

Conversation

@zwxxb

@zwxxb zwxxb commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds move-flow update [--check] for in-place self-updating from the aptos-labs/aptos-ai GitHub releases.

  • --check reports availability without downloading.
  • Default fetches the latest move-flow-v* release, verifies via bump_is_greater, and atomically replaces the binary on disk.
  • Uses the same self_update git pin already used by crates/aptos.
  • Bumps crate to 1.1.0

Test plan

  • cargo test -p aptos-move-flow update — 5 unit tests pass
  • cargo install --path aptos-move/flow --locked --profile ci succeeds
  • move-flow update --help shows the subcommand
  • cargo test -p aptos-move-flow update::live_github_check -- --ignored (run once aptos-ai is 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 from aptos-labs/aptos-ai GitHub releases tagged move-flow-v*, mirroring the self_update pattern already used by the aptos CLI.

--check only compares the running binary’s version to the latest release and prints whether an update exists. Without it, the command downloads and replaces the move-flow binary when a newer version is available, with clearer errors for permission denied or missing platform assets.

Wires the new update module into the CLI (runs on a blocking task), adds self_update as a dependency, bumps aptos-move-flow to 1.1.0, and documents the feature in the changelog. Unit tests cover version/tag parsing, --check flag 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.

@zwxxb zwxxb requested a review from a team as a code owner June 30, 2026 16:54

@wrwg wrwg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool!

@zwxxb zwxxb enabled auto-merge (squash) June 30, 2026 17:16
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@zi0Black

zi0Black commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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()

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 Badge 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 👍 / 👎.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@zwxxb zwxxb force-pushed the feature/move-flow-update-command branch from 87264cb to 706f647 Compare July 1, 2026 10:03
zwxxb added 2 commits July 1, 2026 12:05
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.
@zwxxb zwxxb force-pushed the feature/move-flow-update-command branch from 706f647 to b7c4258 Compare July 1, 2026 10:06
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

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>
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

✅ Forge suite compat success on dfffef35ad9ab37b8eb9d9cc94d8f97911c4d862 ==> 5645214032fc59c06240dcccf92237b2affdbcd4

Compatibility test results for dfffef35ad9ab37b8eb9d9cc94d8f97911c4d862 ==> 5645214032fc59c06240dcccf92237b2affdbcd4 (PR)
1. Check liveness of validators at old version: dfffef35ad9ab37b8eb9d9cc94d8f97911c4d862
compatibility::simple-validator-upgrade::liveness-check : committed: 15209.75 txn/s, latency: 2276.84 ms, (p50: 2200 ms, p70: 2500, p90: 3000 ms, p99: 3600 ms), latency samples: 494600
2. Upgrading first Validator to new version: 5645214032fc59c06240dcccf92237b2affdbcd4
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 6191.08 txn/s, latency: 5452.08 ms, (p50: 6100 ms, p70: 6100, p90: 6300 ms, p99: 6400 ms), latency samples: 210400
3. Upgrading rest of first batch to new version: 5645214032fc59c06240dcccf92237b2affdbcd4
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 6217.28 txn/s, latency: 5490.99 ms, (p50: 6000 ms, p70: 6100, p90: 6200 ms, p99: 6300 ms), latency samples: 217180
4. upgrading second batch to new version: 5645214032fc59c06240dcccf92237b2affdbcd4
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 9662.02 txn/s, latency: 3489.53 ms, (p50: 3800 ms, p70: 3900, p90: 4000 ms, p99: 4200 ms), latency samples: 318200
5. check swarm health
Compatibility test for dfffef35ad9ab37b8eb9d9cc94d8f97911c4d862 ==> 5645214032fc59c06240dcccf92237b2affdbcd4 passed
Test Ok

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

✅ Forge suite realistic_env_max_load success on 5645214032fc59c06240dcccf92237b2affdbcd4

two traffics test: inner traffic : committed: 12238.93 txn/s, latency: 1505.90 ms, (p50: 1500 ms, p70: 1600, p90: 1800 ms, p99: 2100 ms), latency samples: 4570980
two traffics test : committed: 100.00 txn/s, latency: 493.55 ms, (p50: 400 ms, p70: 500, p90: 600 ms, p99: 900 ms), latency samples: 1740
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 0.833, avg: 0.740", "ConsensusProposalToOrdered: max: 0.111, avg: 0.105", "ConsensusOrderedToCommit: max: 0.127, avg: 0.123", "ConsensusProposalToCommit: max: 0.234, avg: 0.227"]
Max non-epoch-change gap was: 2 rounds at version 15844 (avg 0.00) [limit 4], 1.19s no progress at version 24810 (avg 0.06s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.53s no progress at version 2329099 (avg 0.53s) [limit 16].
Test Ok

@zwxxb zwxxb merged commit daf7138 into aptos-labs:main Jul 1, 2026
59 of 60 checks passed
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.

3 participants