fix(aqua): add start_operations for progress reporting#7354
Conversation
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>
There was a problem hiding this comment.
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.
| if pkg.checksum.as_ref().is_some_and(|c| c.enabled()) { | ||
| op_count += 1; | ||
| } | ||
| let format = pkg.format(&v, os(), arch()).unwrap_or_default(); |
There was a problem hiding this comment.
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.
| op_count += 1; | ||
| } | ||
| let format = pkg.format(&v, os(), arch()).unwrap_or_default(); | ||
| if !format.is_empty() && format != "raw" { |
There was a problem hiding this comment.
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.
|
bugbot run |
| // 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; |
There was a problem hiding this comment.
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)
Hyperfine Performance
|
| 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%
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>
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>
|
bugbot run |
### 🚀 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)
* 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)
Summary
start_operationscall in the aqua backend to improve progress bar display during tool installationThe operation count is calculated dynamically:
Test plan
aqua:BurntSushi/ripgrep) and verify smoother progress bar🤖 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.
ctx.pr.start_operations(op_count)withcalculate_op_count(accounts fordownload,checksumwhen enabled/API-provided, andextractionbased onpkg.formator package type).formatviapkg.format(&v, os(), arch())to inform extraction step.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.