fix: replace dirs::home_dir() with effective_home_dir() in crates/tui - #4760
fix: replace dirs::home_dir() with effective_home_dir() in crates/tui#4760EvanProgramming wants to merge 3 commits into
Conversation
Audit and replace all remaining raw dirs::home_dir() call sites in crates/tui/src with crate::config::effective_home_dir(). This ensures the crate consistently respects HOME/USERPROFILE env var overrides, making tests that fake $HOME portable across Windows CI runners. Previously fixed in bc461c6 for tools/workflow.rs and tui/views/skills_manager.rs. This commit sweeps the remaining ~70 call sites across 29 files. The fallback inside effective_home_dir() itself (config/paths.rs:55) is intentionally left as dirs::home_dir() since that is its last-resort path. Closes Hmbown#4757
|
Thanks @EvanProgramming for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
…ibility network_policy.rs and skills/install.rs are #[path]-included from tests/skill_cli.rs, so crate::config::effective_home_dir() cannot resolve (the 'config' module does not exist in the test binary crate). These call sites are safe: the integration tests supply an explicit temp directory for the install target, and the audit-log default path is not test-fakability-critical.
|
Thank you for this, @EvanProgramming — the report and the sweep were right, and #4757 is closed. Closing as already landed: Credit note: that commit went in without a One thing worth calling out because you got it right and flagged it honestly: you deliberately left |
Each of these people had a PR triaged during the v0.9.2 pass, and three of them had work reach main without a Co-authored-by trailer because they were not in this file. Adding them so future harvests attribute correctly and the check-coauthor-trailers gate can resolve them. - EvanProgramming — #4760; equivalent change landed as 0d73127 with no trailer. - adity982 — #4756; the MCP call-once fix landed as cccaa4f with no trailer. - vibecoding-skills — #4743; the SSE-timeout split landed as a374d19. - XhesicaFrost — #4610, pending harvest for #4520. - ffaacceelee — #4686, closed without harvest, mapped pre-emptively. Numeric noreply ids verified against the GitHub users API rather than inferred, since a wrong id silently drops credit out of the contributor graph instead of failing loudly.
Summary
Audit and replace all remaining raw
dirs::home_dir()call sites incrates/tui/srcwithcrate::config::effective_home_dir().Context: Fixed two Windows-only CI test failures in
bc461c60ccaused by rawdirs::home_dir()calls intools/workflow.rsandtui/views/skills_manager.rs. Root cause:dirs::home_dir()on Windows resolves via a native OS API call and does not respectHOME/USERPROFILEenv var overrides, so tests that fake $HOME via the establishedEnvVarGuardpattern silently disagreed with production code that used the real Windows user profile instead.crate::config::effective_home_dir()already exists for exactly this (checksHOME, thenUSERPROFILE, thenHOMEDRIVE+HOMEPATH) and is used correctly elsewhere in the crate.This PR sweeps all remaining call sites (45 replacements across 29 files) so the crate consistently uses
effective_home_dir(). The fallback insideeffective_home_dir()itself (config/paths.rs:55) is intentionally left asdirs::home_dir().Note:
network_policy.rsandskills/install.rsare#[path]-included from integration tests (tests/skill_cli.rs), socrate::config::does not exist in the test binary crate context. These two files keepdirs::home_dir()with explanatory comments — they are not test-fakability-critical.Testing
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features --locked— warning-freecargo test --workspace --all-features --locked— 8155 passed, 0 failed (only 1 unrelated PTY flake)Checklist
Closes #4757