fix(aqua): support override env selectors#10200
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughBumps compiled registry cache layout version from "v2" to "v3". Adds ChangesRegistry Environment Overrides
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR extends the Aqua registry override matching logic to support the
Confidence Score: 5/5Safe to merge; the change is a targeted, well-tested bug fix with no regressions on existing matching paths. The refactored No files require special attention. Important Files Changed
Reviews (7): Last reviewed commit: "style(aqua): format env wildcard test" | Re-trigger Greptile |
27747ab to
f67c7a5
Compare
|
@coderabbitai review This comment was generated by an AI coding assistant. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
cat crates/aqua-registry/src/types.rs
echo "---"
cat crates/aqua-registry/src/cache.rsLength of output: 78464
Review of PR
|
| Area | Assessment |
|---|---|
| Correctness of matching logic | ✅ |
| Cache version bump | ✅ |
Backward compatibility (empty envs default) |
✅ |
| rkyv serialisation | ✅ |
| Test coverage | ✅ (minor gap: "all" value not tested) |
The PR is in good shape. The only actionable suggestion is the optional "all" test above — feel free to include it or skip it as you see fit.
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.
|
@coderabbitai review This comment was generated by an AI coding assistant. |
|
This comment was generated by an AI coding assistant. 🧠 Learnings used✅ Action performedReview finished.
|
|
@coderabbitai review This comment was generated by an AI coding assistant. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
cat crates/aqua-registry/src/types.rs
echo "---CACHE---"
cat crates/aqua-registry/src/cache.rsLength of output: 79235
Review of PR
|
| Item | Status |
|---|---|
AquaOverride.envs: Vec<String> with #[serde(default)] |
✅ |
envs_match() handles all, GOOS, GOARCH, GOOS/GOARCH forms |
✅ |
AquaOverride::matches() AND-combines envs with goos/goarch/variants |
✅ |
test_override_envs_match_os |
✅ |
test_override_envs_match_os_arch |
✅ |
test_override_envs_all_matches_any_platform |
✅ (added since last review) |
test_override_envs_combine_with_goarch |
✅ |
No issues found. The envs: [all] test I flagged in the earlier review has been incorporated. The PR is in good shape and ready for merge.
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.
Summary
overrides[].envsin Aqua registry package overridesenvsas an additional override selector alongsidegoos,goarch, and supportedvariantsWhat is
overrides[].envs?Aqua registry packages can define
overridesto replace parts of a package definition for specific runtime targets. Theenvsfield is one of Aqua's override selectors: each entry can match a GOOS value such aswindows, a GOARCH value such asarm64, a combinedGOOS/GOARCHvalue such aswindows/arm64, orall.Aqua treats
envsas an optional selector alongsidegoos,goarch, andvariants: if it is present, at least one listed environment must match the target runtime; if other selectors are also present, they must match too.Relevant Aqua references:
Packages using this field
Two live aqua-registry entries show why this matters:
apache/tomcatusesoverrides[].envs: [windows]to switch the installed file fromcatalina.shtocatalina.baton Windows.https://github.com/aquaproj/aqua-registry/blob/main/pkgs/apache/tomcat/registry.yaml
eza-community/ezausesoverrides[].envs: [darwin, windows/arm64]to route those targets through itstype: cargopackage configuration instead of the default release-asset path.https://github.com/aquaproj/aqua-registry/blob/main/pkgs/eza-community/eza/registry.yaml
Why mise needs support
Before this change, mise parsed and applied Aqua overrides for
goos,goarch, and supportedvariants, but ignoredoverrides[].envs. Env-only overrides therefore never applied. That could make mise choose the wrong file or package configuration for valid Aqua registry packages, especially on Windows and Darwin targets.Supporting
envsmakes mise's native Aqua backend match Aqua's selector semantics for these registry entries and prevents platform-specific override data from being silently skipped.Tests
rustfmt --edition 2024 --check crates/aqua-registry/src/types.rs crates/aqua-registry/src/cache.rsgit diff --checkcargo test -p aqua-registry override_envs --no-default-featuresSummary by CodeRabbit
New Features
Chores