Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(aqua): support multiple custom registries#10179

Merged
jdx merged 1 commit into
jdx:mainfrom
risu729:codex-20260601-024831-4636cf
Jun 6, 2026
Merged

feat(aqua): support multiple custom registries#10179
jdx merged 1 commit into
jdx:mainfrom
risu729:codex-20260601-024831-4636cf

Conversation

@risu729

@risu729 risu729 commented May 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add aqua.registries as an ordered array-only setting for downloaded aqua registries
  • deprecate legacy single-string aqua.registry_url; aqua.registries takes precedence when both are set
  • resolve aqua packages through one ordered registry source list: configured registries first, then the baked registry when enabled
  • keep single-string legacy syntax for aqua.registry_url and keep aliases scoped to the registry that defines them
  • update docs, generated schema, and focused settings/e2e coverage

Tests

  • MISE_TRUSTED_CONFIG_PATHS="$PWD" mise run render:schema
  • cargo fmt --all
  • git diff --check
  • RUSTC_WRAPPER= cargo clippy -p mise -- -D warnings
  • RUSTC_WRAPPER= cargo test -p mise aqua::aqua_registry_wrapper -j1
  • RUSTC_WRAPPER= cargo test -p mise config::settings::tests::test_aqua -j1
  • CARGO_TARGET_DIR=/home/risu/.cache/cargo-target/mise-409845c58888dcc6 MISE_TRUSTED_CONFIG_PATHS="$PWD" mise run test:e2e e2e/cli/test_settings_add

Notes

Summary by CodeRabbit

  • New Features

    • Added aqua.registries setting to configure multiple custom Aqua registries in priority order with automatic fallback to the baked-in registry.
    • aqua.registry_url remains supported but is now deprecated; existing values automatically migrate to the new setting.
  • Documentation

    • Updated Aqua backend documentation with guidance on configuring multiple registries, caching behavior, and fallback logic.

@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c47366b7-bef5-456d-8c27-05b9065393c0

📥 Commits

Reviewing files that changed from the base of the PR and between 310e325 and 6f322c9.

📒 Files selected for processing (7)
  • docs/dev-tools/backends/aqua.md
  • e2e/cli/test_settings_add
  • schema/mise.json
  • settings.toml
  • src/aqua/aqua_registry_wrapper.rs
  • src/cli/settings/set.rs
  • src/config/settings.rs

📝 Walkthrough

Walkthrough

This PR introduces multi-registry support for Aqua package management, replacing a single registry URL setting with an ordered array of registries. Configuration schema, core registry resolution logic, deprecation handling, and test coverage are updated throughout.

Changes

Multi-Registry Aqua Support

Layer / File(s) Summary
Settings schema definition
schema/mise.json, settings.toml
New aqua.registries array setting (with parsing, environment variable, and documentation) and aqua.registry_url marked as deprecated with removal timeline.
AquaRegistry multi-registry implementation
src/aqua/aqua_registry_wrapper.rs
AquaRegistry struct refactored to hold registries: Vec<RegistrySource>; configured_registry_urls derives registry list from settings; package lookup iterates through registries in order, returning first match or RegistryNotAvailable; DownloadedRegistry load path refactored to load_registry() -> Result<Arc<ActiveRegistry>>.
AquaRegistry test updates
src/aqua/aqua_registry_wrapper.rs
Tests updated to validate registry order, sequential lookup on miss, load-failure handling, baked-vs-downloaded miss semantics, and local/bundled registry parsing; test helpers refactored to accept Vec<String> registry URLs.
Settings deprecation migration and list operations
src/config/settings.rs, src/cli/settings/set.rs
set_hidden_configs migrates deprecated aqua.registry_url to aqua.registries when both are present; settings list-add operation refactored to directly match TOML values and conditionally unwrap arrays; new migration tests validate backward compatibility.
Documentation and end-to-end test
docs/dev-tools/backends/aqua.md, e2e/cli/test_settings_add
Aqua backend docs rewritten to explain multi-registry ordering, caching behavior, and fallback semantics; e2e test added for mise settings add on list settings.

🎯 4 (Complex) | ⏱️ ~45 minutes

🐰 A rabbit's hop through the registry queues,
Where multiple sources bring good news,
From ordered lists to cached delight,
The Aqua package system takes flight!
✨🔍

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.00% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'feat(aqua): support multiple custom registries' directly and accurately summarizes the main change—introducing support for multiple custom Aqua registries via the new aqua.registries setting.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@greptile-apps

greptile-apps Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces the single aqua.registry_url setting with a new aqua.registries ordered-array setting that supports multiple custom aqua registries, checked in order before the baked-in registry. The legacy aqua.registry_url is deprecated with a deprecated_remove_at = "2027.12.0" timeline and is automatically migrated to registries at settings-load time via set_hidden_configs.

  • Registry chaining: AquaRegistry is refactored into a Vec<RegistrySource> (each being a DownloadedRegistry or Baked); fetch_package iterates through them in order, falling through on PackageNotFound and returning errors immediately for any other registry-load failure (intentional fail-fast, verified by the new registry_load_failure_does_not_check_later_registries test).
  • Settings migration: set_hidden_configs converts registry_url → registries when registries is not already set; configured_registry_urls then only needs to inspect registries, keeping the two code paths cleanly separated.
  • Alias scoping: registry-local aliases resolve only within their source registry; cross-registry references require a [tool_alias] entry in mise config, tested by the new registry_aliases_are_registry_local test.

Confidence Score: 5/5

Safe to merge; the registry chaining, deprecation migration, and settings plumbing are all logically consistent and backed by thorough unit and e2e tests.

The refactor cleanly separates concerns: settings migration lives in set_hidden_configs, registry ordering lives in AquaRegistry::new, and each DownloadedRegistry owns its own tokio OnceCell with no shared-mutable-state hazards. All new code paths (ordered resolution, alias scoping, empty-registry override, env-var CSV parsing) are covered by focused tests. No correctness issues were found.

No files require special attention.

Important Files Changed

Filename Overview
src/aqua/aqua_registry_wrapper.rs Core refactor from single optional registry to Vec; chaining logic, OnceCell per registry, and fail-fast error propagation are all correct and well-tested.
src/config/settings.rs Adds registry_url → registries migration in set_hidden_configs; precedence (registries wins) and deprecation warning are correct and covered by new unit tests.
src/cli/settings/set.rs Refactors the add-to-array guard to match on the full current Item first; functionally equivalent to the old code for the array case, and aqua.registries (ListString) always writes as an array so --add will work correctly for the new setting.
settings.toml Adds aqua.registries as ListString with parse_env = list_by_comma; changes registry_url type from Url to String and marks it deprecated with appropriate warn/remove versions.
e2e/cli/test_settings_add Adds e2e coverage for set-then-add workflow on aqua.registries; covers the happy path correctly.
docs/dev-tools/backends/aqua.md Updated docs reflect the new array syntax, multiple-registry ordering, alias scoping, env-var CSV format, and legacy setting deprecation.
schema/mise.json Adds aqua.registries array schema entry and marks aqua.registry_url as deprecated; matches the settings.toml changes.

Reviews (5): Last reviewed commit: "feat(aqua): support multiple custom regi..." | Re-trigger Greptile

Comment thread src/cli/settings/set.rs Outdated
Comment thread src/aqua/aqua_registry_wrapper.rs
@risu729 risu729 force-pushed the codex-20260601-024831-4636cf branch 2 times, most recently from 2da784a to f99cbc1 Compare May 31, 2026 18:17
@risu729

This comment was marked as outdated.

@risu729

This comment was marked as outdated.

@risu729 risu729 force-pushed the codex-20260601-024831-4636cf branch from f99cbc1 to d19158f Compare May 31, 2026 22:22
@risu729

This comment was marked as outdated.

@risu729 risu729 force-pushed the codex-20260601-024831-4636cf branch from d19158f to 6f322c9 Compare June 1, 2026 15:38
@risu729

This comment was marked as outdated.

@risu729

risu729 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

This comment was generated by an AI coding assistant.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

@risu729 I'll kick off a review of the PR now!

This comment was generated by an AI coding assistant.


🧠 Learnings used
Learnt from: CR
Repo: jdx/mise PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-31T15:12:12.203Z
Learning: When posting comments on GitHub PRs or discussions, include a note that the comment was AI-generated (e.g., '*This comment was generated by an AI coding assistant.*').

Learnt from: CR
Repo: jdx/mise PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-31T15:12:18.847Z
Learning: When posting comments on GitHub PRs or discussions, always include a note that the comment was AI-generated

Learnt from: CR
Repo: jdx/mise PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-31T15:12:28.703Z
Learning: When posting comments on GitHub PRs or discussions, always include a note that the comment was AI-generated

Learnt from: CR
Repo: jdx/mise PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-03T17:35:47.414Z
Learning: Prefer `aqua:` backend for registry entries; use `github:` or `gitlab:` when the tool isn't in aqua but ships releases. Avoid tier 3 backends (npm, pipx, gem, cargo, go, dotnet) for registry PRs unless explicitly approved.

Learnt from: CR
Repo: jdx/mise PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-04T12:44:48.240Z
Learning: Applies to registry/**/* : Use conda: backend for registry when the tool can't be supported via aqua/github, but only with very high bar for popularity and maintenance

Learnt from: CR
Repo: jdx/mise PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-31T15:12:28.703Z
Learning: For registry entries, prefer aqua: backend when the tool is in the aqua registry for better UX, SLSA verification, and per-version logic

Learnt from: CR
Repo: jdx/mise PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-31T15:12:18.847Z
Learning: Applies to registry/**/* : For registry entries, prefer aqua: backend when the tool is in the aqua registry, use github: when the tool isn't in aqua but ships GitHub releases, use gitlab: for tools released through GitLab
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@risu729 risu729 marked this pull request as ready for review June 5, 2026 19:04
@jdx jdx merged commit 944098d into jdx:main Jun 6, 2026
34 checks passed
@risu729 risu729 deleted the codex-20260601-024831-4636cf branch June 6, 2026 01:01
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