feat(backend): support aqua vars templates#9110
Conversation
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request implements support for template variables (vars) within the aqua backend. Key changes include updating the template lexer and parser to handle chained property access, extending the AquaPackage model to support variable definitions with defaults and requirement checks, and integrating these variables into the tool installation process via tool options. Documentation and unit tests have been added to cover the new functionality. A review comment suggests refactoring duplicated identifier parsing logic in the template lexer to improve maintainability.
Greptile SummaryThis PR adds support for aqua registry All remaining findings are P2: Confidence Score: 5/5Safe to merge; no P0/P1 issues found, all remaining findings are P2 edge-case observations The implementation is well-scoped and correctly handles the primary use cases. The two P2 findings are edge cases that don't affect real aqua registry entries. Test coverage (unit + e2e) is thorough. crates/aqua-registry/src/types.rs (Null handling) and src/backend/aqua.rs (scalar coercion asymmetry) Important Files Changed
Sequence DiagramsequenceDiagram
participant Config as mise.toml
participant Backend as AquaBackend
participant Registry as AquaRegistry
participant Pkg as AquaPackage
participant Template as template::render
Config->>Backend: options with channel or vars={channel}
Backend->>Registry: package_with_version(id, versions)
Registry-->>Backend: AquaPackage with vars declared
Backend->>Backend: apply_var_options(pkg, opts)
note over Backend: nested vars{} wins over flat key
Backend->>Pkg: with_var_values({channel:stable})
Pkg->>Pkg: validate_vars()
Pkg-->>Backend: AquaPackage with var_values set
Backend->>Pkg: asset(v, os, arch)
Pkg->>Pkg: vars_ctx() builds Vars.channel context
Pkg->>Template: render template with ctx
Template-->>Pkg: resolved asset string
Backend->>Backend: lockfile_options(opts)
note over Backend: all non-excluded keys prefixed vars.
Backend-->>Config: lockfile entry vars.channel=stable
Reviews (9): Last reviewed commit: "test(backend): suppress aqua vars shellc..." | Re-trigger Greptile |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59c25a91c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
### 🚀 Features - **(backend)** support aqua vars templates by @risu729 in [#9110](#9110) - add gsudo (Sudo for Windows) to registry by @matracey in [#9281](#9281) ### 🐛 Bug Fixes - **(cli)** retrieve token from github helper for `self-update` command by @sushichan044 in [#9259](#9259) - **(github)** scope auth headers to API URLs by @risu729 in [#9271](#9271) - **(vfox)** use github token for lua http requests by @jdx in [#9257](#9257) ### 📚 Documentation - add aube hero banner by @jdx in [#9265](#9265) - add en.dev footer by @jdx in [#9267](#9267) - implement landing page design by @jdx in [#9266](#9266) ### 📦️ Dependency Updates - lock file maintenance by @renovate[bot] in [#9268](#9268) ### 📦 Registry - add llama.cpp ([github:ggml-org/llama.cpp](https://github.com/ggml-org/llama.cpp)) by @igor-makarov in [#9282](#9282) - add kiro-cli by @shalk in [#9274](#9274) - add flux-operator & flux-operator-mcp by @monotek in [#8852](#8852) ### Chore - **(release)** add en.dev sponsor blurb to release notes by @jdx in [#9272](#9272) - bump communique to 1.0.1 by @jdx in [#9264](#9264) ### New Contributors - @monotek made their first contribution in [#8852](#8852) - @igor-makarov made their first contribution in [#9282](#9282) ## 📦 Aqua Registry Updates #### New Packages (2) - [`controlplaneio-fluxcd/flux-operator/flux-operator-mcp`](https://github.com/controlplaneio-fluxcd/flux-operator/flux-operator-mcp) - [`endevco/aube`](https://github.com/endevco/aube) #### Updated Packages (1) - [`graelo/pumas`](https://github.com/graelo/pumas)
Summary
varsdefinitions in the aqua backend.Vars.<name>in aqua templates, including function arguments and chained property accessvars = { name = "value" }or flatname = "value"keysBackground
varsin v2.31.0 via feat: add vars aquaproj/aqua#3052..Vars.<name>and can declarerequiredanddefaultfields; aqua applies defaults and errors when a required var has no value/default.aqua:flutter/flutter, which uses.Vars.channelwith defaultstableaqua:scenarigo/scenarigo, which uses required.Vars.go_versionDifference From Aqua
map[string]anyand passes that map directly into Go templates, so arrays/objects/non-string scalar values can exist there.aqua var \vars.fixture_version` must be a string, got array`.Implementation Notes
crates/aqua-registrymodelsvars, validates missing required vars, and accepts string defaults only.vars = { name = "value" }wins over flatname = "value", and both forms canonicalize to the same lockfile option identity.Tests
cargo fmt --checkgit diff --check -- . ':!mise.lock'cargo test -p aqua-registrycargo test backend::aqua::tests::mise run test:e2e e2e/backend/test_aqua_varsThis PR was originally generated by Copilot and updated after manual review.