Skip to content

fix(aqua): add start_operations for progress reporting#7354

Merged
jdx merged 5 commits into
mainfrom
feat/aqua-start-operations
Dec 17, 2025
Merged

fix(aqua): add start_operations for progress reporting#7354
jdx merged 5 commits into
mainfrom
feat/aqua-start-operations

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Dec 17, 2025

Summary

  • Implement start_operations call in the aqua backend to improve progress bar display during tool installation
  • Follows the same pattern used by the GitHub backend

The operation count is calculated dynamically:

  • 1 for download (always)
  • +1 if checksum verification is enabled
  • +1 if the format requires extraction (anything except "raw")

Test plan

  • Install an aqua tool with checksums (e.g., aqua:BurntSushi/ripgrep) and verify smoother progress bar
  • Install an aqua tool without checksums and verify progress works

🤖 Generated with Claude Code


Note

Initialize progress operations in the Aqua backend with a dynamically calculated count (download, checksum, extraction) and clean up unused imports across the codebase.

  • Backend (Aqua):
    • Initialize progress reporting via ctx.pr.start_operations(op_count) with calculate_op_count (accounts for download, checksum when enabled/API-provided, and extraction based on pkg.format or package type).
    • Determine format via pkg.format(&v, os(), arch()) to inform extraction step.
  • Cleanup:
    • Remove unused imports (e.g., cmd, progress_trace) across multiple modules to reduce warnings and noise.

Written by Cursor Bugbot for commit 02d45c2. This will update automatically on new commits. Configure here.

Implement start_operations call in the aqua backend to improve progress
bar display during tool installation. This follows the same pattern used
by the GitHub backend.

The operation count is calculated dynamically:
- 1 for download (always)
- +1 if checksum verification is enabled
- +1 if the format requires extraction (anything except "raw")

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 17, 2025 16:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds progress reporting functionality to the aqua backend by implementing the start_operations call. The change calculates the total number of operations (download, checksum verification, and extraction) that will be performed during tool installation, enabling more accurate progress bar display.

Key Changes:

  • Add dynamic operation count calculation based on whether checksums are enabled and whether extraction is needed
  • Call ctx.pr.start_operations(op_count) before beginning the download process

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/backend/aqua.rs
if pkg.checksum.as_ref().is_some_and(|c| c.enabled()) {
op_count += 1;
}
let format = pkg.format(&v, os(), arch()).unwrap_or_default();
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The unwrap_or_default() silently swallows any error from pkg.format(). If this method can return an error that indicates a problem (rather than just a missing format), consider propagating it or logging it for debugging purposes.

Copilot uses AI. Check for mistakes.
Comment thread src/backend/aqua.rs Outdated
op_count += 1;
}
let format = pkg.format(&v, os(), arch()).unwrap_or_default();
if !format.is_empty() && format != "raw" {
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The string literal "raw" should be extracted as a constant to improve maintainability and prevent typos. Consider defining const RAW_FORMAT: &str = \"raw\"; at the module level.

Copilot uses AI. Check for mistakes.
@jdx
Copy link
Copy Markdown
Owner Author

jdx commented Dec 17, 2025

bugbot run

Comment thread src/backend/aqua.rs Outdated
// Determine operation count for progress reporting
let mut op_count = 1; // download
if pkg.checksum.as_ref().is_some_and(|c| c.enabled()) {
op_count += 1;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Operation count misses checksum from GitHub API digest

The operation count calculation only checks pkg.checksum.enabled() to determine if checksum verification will occur. However, checksum verification also happens when api_digest is set from the GitHub API (at lines 310-312), which sets platform_info.checksum independently of the package's checksum configuration. When api_digest is present but pkg.checksum.enabled() is false, the op_count will undercount operations, causing the progress bar to overshoot 100% when verify_checksum is called and invokes set_length on the progress report.

Additional Locations (1)

Fix in Cursor Fix in Web

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 17, 2025

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 x -- echo 19.9 ± 0.6 19.0 24.8 1.00
mise x -- echo 20.9 ± 0.7 19.3 22.9 1.05 ± 0.05

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 env 19.7 ± 0.3 19.0 21.1 1.00
mise env 20.5 ± 0.4 19.5 21.9 1.04 ± 0.03

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 hook-env 20.0 ± 0.3 19.0 21.1 1.00
mise hook-env 20.4 ± 0.7 19.1 23.2 1.02 ± 0.04

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 ls 17.0 ± 0.4 16.1 20.5 1.00
mise ls 18.2 ± 0.6 16.5 19.5 1.07 ± 0.04

xtasks/test/perf

Command mise-2025.12.10 mise Variance
install (cached) 111ms 111ms +0%
ls (cached) 67ms 67ms +0%
bin-paths (cached) 73ms 74ms -1%
task-ls (cached) 2267ms ✅ 285ms +695%

✅ Performance improvement: task-ls cached is 695%

@jdx jdx changed the title feat(aqua): add start_operations for progress reporting fix(aqua): add start_operations for progress reporting Dec 17, 2025
The operation count only checked pkg.checksum.enabled() but checksum
verification also occurs when api_digest is set from the GitHub API.
This caused the progress bar to overshoot 100% for packages without
explicit checksum config but with GitHub API digests available.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Comment thread src/backend/aqua.rs Outdated
jdx and others added 2 commits December 17, 2025 10:58
Extract calculate_op_count() helper method and fix operation counting
for GithubArchive and GithubContent package types which always extract
regardless of format value.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jdx
Copy link
Copy Markdown
Owner Author

jdx commented Dec 17, 2025

bugbot run

@jdx jdx merged commit 877549a into main Dec 17, 2025
42 of 43 checks passed
@jdx jdx deleted the feat/aqua-start-operations branch December 17, 2025 17:54
jdx pushed a commit that referenced this pull request Dec 18, 2025
### 🚀 Features

- **(alias)** rename alias to tool-alias, add shell-alias command by
@jdx in [#7357](#7357)
- **(upgrade)** display summary of upgraded tools by @jdx in
[#7372](#7372)
- **(vfox)** embed vfox plugin Lua code in binary by @jdx in
[#7369](#7369)

### 🐛 Bug Fixes

- **(aqua)** add start_operations for progress reporting by @jdx in
[#7354](#7354)
- **(github)** improve asset detection for distro-specific and Swift
artifacts by @jdx in [#7347](#7347)
- **(github)** clean up static_helpers.rs and fix archive bin= option by
@jdx in [#7366](#7366)
- **(http)** add start_operations for progress reporting by @jdx in
[#7355](#7355)
- **(lockfile)** place lockfile alongside config file by @jdx in
[#7360](#7360)
- **(progress)** add start_operations to core plugins by @jdx in
[#7351](#7351)
- **(ruby-install)** Use ruby_install_bin to update by @calebhearth in
[#7350](#7350)
- **(rust)** add release_url for rust versions by @jdx in
[#7373](#7373)
- **(schema)** add `tool_alias`, mark `alias` as deprecated by @SKalt in
[#7358](#7358)
- **(toolset)** filter tools by OS in list_current_versions by @jdx in
[#7356](#7356)
- **(ubi)** only show deprecation warning during installation by @jdx in
[#7380](#7380)
- **(ui)** remove noisy "record size" message during install by @jdx in
[#7381](#7381)
- update mise-versions URL to use /tools/ prefix by @jdx in
[#7378](#7378)

### 🚜 Refactor

- **(backend)** unified AssetMatcher with checksum fetching by @jdx in
[#7370](#7370)
- **(backend)** deprecate ubi backend in favor of github by @jdx in
[#7374](#7374)
- **(toolset)** decompose mod.rs into smaller modules by @jdx in
[#7371](#7371)

### 🧪 Testing

- **(e2e)** fix and rename ubi and vfox_embedded_override tests by @jdx
in
[052ea40](052ea40)

### 📦 Registry

- add vfox-gcloud backend for gcloud by @jdx in
[#7349](#7349)
- convert amplify to use github backend by @jdx in
[#7365](#7365)
- add github backend for djinni tool by @jdx in
[#7363](#7363)
- switch glab to native gitlab backend by @jdx in
[#7364](#7364)
- add s5cmd by @jdx in [#7376](#7376)

### Chore

- **(registry)** disable flaky tests for gitu and ktlint by @jdx in
[64151cb](64151cb)
- resolve clippy warnings and add stricter CI check by @jdx in
[#7367](#7367)
- suppress dead_code warnings in asset_matcher module by @jdx in
[#7377](#7377)

### New Contributors

- @calebhearth made their first contribution in
[#7350](#7350)
jekis913 added a commit to jekis913/mise that referenced this pull request Dec 18, 2025
* upstream/main:
  fix(lockfile): place lockfile alongside config file (jdx#7360)
  feat(alias): rename alias to tool-alias, add shell-alias command (jdx#7357)
  fix(aqua): add start_operations for progress reporting (jdx#7354)
  fix(schema): add `tool_alias`, mark `alias` as deprecated (jdx#7358)
  fix(progress): add start_operations to core plugins (jdx#7351)
  fix(toolset): filter tools by OS in list_current_versions (jdx#7356)
  registry: add vfox-gcloud backend for gcloud (jdx#7349)
  fix(github): improve asset detection for distro-specific and Swift artifacts (jdx#7347)
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.

2 participants