refactor(ubi): parse tool options locally#9873
Conversation
Greptile SummaryThis PR wraps all UBI backend option reads in a new private
Confidence Score: 5/5Pure mechanical refactor — no new logic, no control-flow changes, safe to merge. All changes are structural: call-site boilerplate is replaced by the new No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "fix(ubi): use string option reader for e..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request introduces a structured approach to managing backend options by implementing a BackendOptions wrapper and specialized structs like GitBackendOptions and UbiOptions. These changes centralize the logic for accessing configuration values, including platform-specific overrides, and refactor the GitHub and Ubi backends to utilize these new structures. A critical issue was identified in the UbiOptions implementation where an incorrect method name was used to retrieve the extract_all option.
## 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.*
c6ee718 to
4a9859d
Compare
Depends on merged #9838. This branch has been rebased onto current
main, so the PR diff is now only the UBI typed-parser follow-up.Summary
UbiOptionswrapper for UBI backend option reads.Verification
cargo fmt --all -- --checkgit diff --check upstream/main...HEADThis PR was generated by an AI coding assistant.