refactor(core): centralize install_before resolution#9286
Conversation
Greptile SummaryThis PR centralizes Confidence Score: 5/5Safe to merge — the refactoring is logically equivalent to the previous code for all identified code paths, and prior thread concerns about inline-opts precedence and the No new P0/P1 issues found. The No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ToolRequest::resolve] --> B[ToolVersion::resolve]
B --> C[resolve_before_date]
C --> D{opts.before_date set?}
D -- Yes --> E[Use CLI override]
D -- No --> F{per-tool install_before set?}
F -- Yes --> G[Parse per-tool option]
F -- No --> H{Settings::install_before set?}
H -- Yes --> I[Parse global setting]
H -- No --> J[None]
E & G & I & J --> K[tv.before_date on ToolVersion]
K --> L[InstallContext.before_date]
K --> M[backend latest_version]
M --> N[effective_latest_before_date]
N --> O{before_date already set?}
O -- Yes --> P[Use it]
O -- No --> Q{ba opts install_before?}
Q -- Yes --> R[Inline opts highest precedence]
Q -- No --> S{config tool opts install_before?}
S -- Yes --> T[Config file opts]
S -- No --> U[resolve_before_date global fallback]
Reviews (9): Last reviewed commit: "fix(backend): preserve inline install_be..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request centralizes the logic for resolving the install_before cutoff into a new install_before module. It introduces a structured way to handle precedence between CLI overrides, tool-specific options, and global settings, ensuring consistent timestamp resolution across the application. The changes include refactoring Backend, ToolRequest, and various CLI commands to use this new centralized logic. Feedback was provided regarding a potential type mismatch in resolve_before_date_for_backend and a suggestion to refactor the logic to be more concise while correctly checking all configuration sources.
5bdd365 to
2ab3802
Compare
8ea3dcb to
8eed126
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
8eed126 to
8c040ea
Compare
9d151d3 to
56956d3
Compare
Summary
Validation