Skip to content

fix(aqua): preserve locked HTTP override metadata - #11499

Merged
jdx merged 2 commits into
mainfrom
agent/fix-aqua-locked-http-overrides
Jul 30, 2026
Merged

jdx merged 2 commits into
mainfrom
agent/fix-aqua-locked-http-overrides

Conversation

@jdx

@jdx jdx commented Jul 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • resolve Aqua install metadata with package- and override-prefixed version candidates when no exact release tag is available
  • preserve exact release-tag selection when a GitHub lock URL provides one
  • add regression coverage for Cabal-style locked HTTP packages whose archive format comes from a prefix-scoped override

Root cause

Locked HTTP URLs such as Cabal's downloads.haskell.org artifacts do not contain a GitHub release tag, and mise skips tag discovery when a lockfile URL already exists. After prefix-aware Aqua override matching was introduced, install resolution still supplied only the bare version and its v variant. Cabal's cabal-install-v override therefore did not match, its format: tar.xz metadata was lost, and the archive was copied as the executable.

Fixes the regression reported in #11494.

Impact

Locked Aqua HTTP installs retain prefix-scoped format and file metadata, so archives are extracted correctly. Packages with an exact release tag continue to use only that tag, preserving disambiguation between multiple prefix families.

Validation

  • cargo test backend::aqua::tests::test_package_version_candidates -- --nocapture
  • cargo test backend::aqua::lock_candidate_tests:: -- --nocapture
  • mise run lint-fix

AI-assisted — Tool: Codex; model: unavailable/unavailable; version: unavailable.


Note

Medium Risk
Changes install-time Aqua package/override resolution for locked installs; wrong candidate logic could mis-apply formats or overrides, but scope is narrow and covered by new regression tests.

Overview
Fixes Aqua installs where a lockfile URL exists but carries no GitHub release tag (e.g. Cabal on downloads.haskell.org). Install resolution no longer passes only the bare version and optional v variant into override matching; it uses install_package_version_candidates, which delegates to package_version_candidates so registry version_prefix values (like cabal-install-v) still match and inherit metadata such as format: tar.xz.

When the lock URL does encode a GitHub release tag, resolution still uses only that tag, avoiding ambiguity between prefix families. The redundant async package_with_options helper is removed in favor of loading the package once and calling package_with_options_for_pkg directly. A Cabal-style HTTP regression test asserts prefix and format are applied.

Reviewed by Cursor Bugbot for commit 4708fe7. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Improved installation handling for packages that use version prefixes and format overrides.
    • Preserved inherited version metadata for HTTP packages during installs, including when a release tag is not available.
    • Corrected install-time version resolution to use the appropriate registry-derived candidate set for overrides.
  • Tests
    • Updated coverage to validate inherited version-prefix behavior with install-time options.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Aqua installation now fetches the registry package directly, derives install-time version candidates through a dedicated helper, and applies options with package_with_options_for_pkg. A regression test covers inherited version_prefix and overridden format metadata for HTTP packages.

Changes

Aqua install resolution

Layer / File(s) Summary
Install candidate derivation
src/backend/aqua.rs
install_package_version_candidates selects the lock tag when present or registry-derived version-prefix candidates otherwise; a unit test covers inherited prefixes and formats.
Install option application
src/backend/aqua.rs
install_version_ resolves the registry package and applies options through package_with_options_for_pkg; the previous helper is removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • jdx/mise#11267: Preserves v-prefixed HTTP lock URL resolution through shared version-candidate handling.
  • jdx/mise#11482: Refactors Aqua version-candidate resolution and preserves version_prefix metadata.

Suggested reviewers: risu729

Poem

I’m a rabbit, hopping through tags,
Prefixes tucked in version bags.
HTTP paths now bloom just right,
Formats carried through the night.
Aqua installs, neat and bright!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: preserving locked HTTP override metadata in Aqua installs.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

Preserves prefix-scoped Aqua metadata for locked HTTP artifacts while retaining exact-tag selection for GitHub release URLs.

  • Uses registry-aware version candidates when a locked URL has no GitHub release tag.
  • Keeps exact release tags as the sole candidate when one can be recovered from the URL.
  • Adds regression coverage for inherited archive-format overrides.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/backend/aqua.rs Updates install-time Aqua override resolution and adds focused regression coverage; no eligible follow-up defect was identified.

Reviews (2): Last reviewed commit: "test(aqua): cover locked HTTP install op..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
src/backend/aqua.rs (1)

3690-3714: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the install wiring, not only candidate computation.

This test exercises install_package_version_candidates and AquaPackage::with_version directly, but not package_with_options_for_pkg from install_version_. Add a focused boundary or locked-HTTP integration test asserting the resolved version_prefix and format.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/backend/aqua.rs` around lines 3690 - 3714, The existing test only
verifies candidate generation and AquaPackage construction; add coverage through
the install wiring entry point package_with_options_for_pkg in install_version_.
Create a focused boundary or locked-HTTP integration test using the inherited
prefix and format override, then assert that the resolved package options
preserve version_prefix and format.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/backend/aqua.rs`:
- Around line 3690-3714: The existing test only verifies candidate generation
and AquaPackage construction; add coverage through the install wiring entry
point package_with_options_for_pkg in install_version_. Create a focused
boundary or locked-HTTP integration test using the inherited prefix and format
override, then assert that the resolved package options preserve version_prefix
and format.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: e3295d91-ce74-4f1c-b9a0-2ff99ad7231e

📥 Commits

Reviewing files that changed from the base of the PR and between ee3e917 and bc5b102.

📒 Files selected for processing (1)
  • src/backend/aqua.rs

@github-actions

github-actions Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
env ▇█▂▄▃▁▂▇▃▃▄▃▄▄▁▅▂▂▂ 84,635,676 → 84,631,665 -0.00% 32.92 → 21.45ms -34.84%
hook-env ▄▄▁▁▅▄▆▆▆▇▇▆▇█▅▇▂▄▄ 87,290,603 → 87,291,524 +0.00% 52.06 → 24.20ms -53.52%
ls ▇▇▃▅▇▆▆█▆▄▇▄▆▇▂█▁▅▆ 76,725,097 → 76,754,311 +0.04% 22.42 → 22.01ms -1.86%
registry ▅▄▁▂▂▂▅▅▅▄▅▃▅▅▄█▁▂▅ 50,181,864 → 50,237,269 +0.11% 16.35 → 14.00ms -14.39%
startup ▇█▃▅▅▄▆█▆▅▅▁▅▆▅█▃█▅ 16,089,749 → 16,068,355 -0.13% 8.52 → 10.11ms +18.63%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

4708fe78a99f vs ee3e9171b164 · measured on the runner, not pushed to the history.

@jdx
jdx enabled auto-merge (squash) July 30, 2026 16:51
@jdx
jdx merged commit 2c90e31 into main Jul 30, 2026
50 of 52 checks passed
@jdx
jdx deleted the agent/fix-aqua-locked-http-overrides branch July 30, 2026 17:21
This was referenced Jul 30, 2026
cprecioso added a commit to wasp-lang/wasp that referenced this pull request Aug 20, 2026
* Update to latest mise and backend plugins

- Bump `min_version` to `2026.8.8`.
- Unpin `mise-action` from `2026.7.16`, the aqua regression that forced
  the pin (jdx/mise#11499) is fixed upstream.
- Switch the `[plugins]` prefix from `vfox:` to `vfox-backend:`, which is
  what current mise requires for backend plugins.

* Pin mise-action to the newest mise version

Keeps CI on an explicit version instead of floating on latest, matching
`min_version` in `mise.toml`.

* Bump
jdx pushed a commit that referenced this pull request Oct 9, 2026
…4218)

`mise lock codex --platform windows-x64` can now lock Codex 0.154.0 when
the release-tag listing does not contain that pinned version.
Previously, override selection received only `0.154.0` and `v0.154.0`,
so the aqua registry's `rust-` prefix rejected every override. The empty
asset name became `.exe`, and the Windows platform entry was skipped. It
now resolves `codex-package-x86_64-pc-windows-msvc.tar.gz` and records
its checksum.

Reuse the prefix-aware candidate selection already used during
installation before applying lock-time version overrides. Exact release
tags remain authoritative, and overrides still use the requested target
platform. When tag lookup misses and multiple prefix families match,
warn and skip that platform entry instead of choosing a release by
registry order. Disjoint version constraints that select one prefix
remain supported. This extends the installation metadata fix in #11499
to lock generation.

Validation: all 122 aqua backend unit tests and three focused lockfile
end-to-end tests passed. The regression covers both the Codex-shaped
Windows package and ambiguous prefixes with reachable archives; the
ambiguity case fails against the previous PR binary. The real Codex
0.154.0 Windows lock reproduction succeeds with the expected archive and
checksum. Strict workspace Clippy (`cargo clippy --workspace
--all-features --all-targets -- -D warnings`) passed. Scoped hk checks
passed; the full `mise run lint-fix` task could not finish because the
local environment lacks `npm:markdownlint-cli@0.49.1`.

*AI-assisted — Tool: Codex; model: openai/unavailable; version:
unavailable.*


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Aqua package resolution now applies version-specific overrides
consistently for pinned releases and packages served from HTTP
registries.
* Lockfiles correctly record platform-specific archive URLs when
registry versions use a prefix, including when a release tag is
available.
* Resolution reports an ambiguity error when multiple matching overrides
point to different version prefixes, rather than selecting one
unpredictably.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.

1 participant