refactor(aqua): parse tool options locally#9872
Conversation
Greptile SummaryThis PR extracts Aqua-specific option parsing into a new
Confidence Score: 5/5Pure structural refactor with no logic changes; all moved code is textually identical to the original, and the new Every moved function is a verbatim lift from its original location. The only net-new code is No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "refactor(aqua): parse tool options local..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request introduces a centralized BackendOptions utility and backend-specific wrappers, AquaOptions and GitBackendOptions, to standardize the handling of tool configuration options. This refactoring enables consistent support for platform-specific overrides across different backends. Review feedback pointed out that the is_truthy helper is currently case-sensitive and suggested a more robust implementation using lowercase matching. Additionally, it was noted that the new implementation for no_app detection now correctly respects platform-specific settings, which represents a change in behavior from the previous implementation.
## Summary - Add a shared `BackendOptions` reader for raw and platform-scoped backend tool options. - Add a private typed option wrapper for the unified GitHub/GitLab/Forgejo backend. - Move GitHub/GitLab/Forgejo option reads and lockfile option collection behind that wrapper while keeping common install/verify helpers on raw `ToolVersionOptions`. - Keep HTTP, S3, Aqua, and UBI migrations out of this PR; those are split into separate draft follow-ups. - Defer `Backend::option_specs()` metadata changes to a later PR. ## Project item - https://github.com/users/risu729/projects/3/views/1?pane=issue&itemId=185472417 - PR C from project item "Refactor and fix tool option persistence by phase". - PR A: #9742, merged. - PR B: #9753, merged. - Draft follow-ups currently split from the original PR C scope: - HTTP: #9870 - S3: #9871 - Aqua: #9872 - UBI: #9873 ## Behavior notes - This PR is intended to be a refactor and does not change lockfile/manifest persistence classifications. - The refactor includes two small behavior fixes found while centralizing Git backend option reads: - Forgejo now shares the same git install-time option filtering as GitHub/GitLab. - `no_app` is now read through target-aware platform option lookup, so `platforms.<target>.no_app` works for cross-platform lock resolution. ## Review - Gemini and Greptile AI review suggestions were addressed and their review threads are resolved. - Manual review focused on preserving existing string/scalar coercion and platform fallback behavior in the Git backend wrapper. ## Verification - `cargo fmt --all -- --check` - `git diff --check upstream/main...HEAD` - GitHub CI is pending for `fda4e0227` after narrowing the PR scope. *This PR was updated by an AI coding assistant.*
d5e274a to
9fbc918
Compare
Depends on merged #9838. This branch has been rebased onto current
main, so the PR diff is now only the Aqua typed-parser follow-up.Summary
AquaOptionswrapper for Aqua backend option reads.symlink_bins, Aqua vars, and lockfile option collection behind that wrapper.Verification
cargo fmt --all -- --checkgit diff --check upstream/main...HEADThis PR was generated by an AI coding assistant.