feat(config): report env files in config ls and doctor output#8853
feat(config): report env files in config ls and doctor output#8853
Conversation
Greptile SummaryThis PR makes settings-based env files (from Key changes:
Confidence Score: 5/5Safe to merge — changes are additive and the single redundant iterator chain is harmlessly deduplicated by BTreeSet All remaining findings are P2 style suggestions; no correctness, data-integrity, or reliability issues found src/config/mod.rs — the watch_files() function retains a redundant Settings::get().env_files() chain that can be cleaned up Important Files Changed
Sequence DiagramsequenceDiagram
actor User
participant CLI as CLI (config ls / doctor)
participant Config as Config
participant EnvResults as EnvResults
participant Settings as Settings
User->>CLI: mise config ls / mise doctor
CLI->>Config: Config::get()
Config-->>CLI: Arc<Config>
CLI->>Config: config.env_results()
Config->>Config: load_env() via OnceCell
Config->>EnvResults: EnvResults::resolve(entries from _.file directives)
loop EnvDirective::File
EnvResults->>EnvResults: env_files.push(file)
EnvResults->>EnvResults: env.insert(k, (v, file))
end
EnvResults-->>Config: EnvResults (env_files has _.file paths)
Config->>Settings: Settings::get().env_files()
Settings-->>Config: Vec<PathBuf> from MISE_ENV_FILE
loop For each Settings env_file
Config->>Config: skip if already in env_results.env_files
Config->>Config: env_results.env_files.push(env_file)
Config->>Config: env_results.env.insert(k, (v, env_file))
end
Config-->>CLI: and EnvResults (env_files = both sources unified)
alt mise config ls
CLI->>CLI: render config_files as table rows
loop env_results.env_files
CLI->>CLI: verbose: filter env keys by source == path
CLI->>CLI: add row [display_path, keys or (none)]
end
CLI-->>User: table with env files appended
else mise doctor
CLI->>CLI: render_env_files → join paths or (none)
CLI->>CLI: info::section(env_files)
CLI-->>User: doctor output with env_files section
end
Reviews (4): Last reviewed commit: "feat(config): report env files in config..." | Re-trigger Greptile |
cd6a8df to
fd69024
Compare
There was a problem hiding this comment.
Code Review
This pull request refactors the environment file loading logic by moving it into the EnvResults::resolve process and updates the mise ls and mise doctor commands to include and display these environment files. The reviewer suggested using raw path strings instead of formatted display paths in the mise doctor JSON output to maintain consistency with other configuration fields.
fd69024 to
a1830fd
Compare
Settings-based env files (MISE_ENV_FILE / env_file setting) were previously invisible in all diagnostic outputs despite being loaded. - `mise config ls` now shows env files as rows in the main table with (none) in the Tools column; `-v` shows the env var keys they set - `mise doctor` now includes an env_files section in both text and JSON output - Settings env files are now loaded into EnvResults in load_env() so they are tracked with source paths, participate in cache invalidation, and are visible everywhere env_results is used - debug!() log line emitted per env file before EnvResults summary Closes #8806 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a1830fd to
853a873
Compare
|
Hi @jdx, could you take a look this PR? |
### 🚀 Features - **(config)** report env files in config ls and doctor output by @SamSoldatenko in [#8853](#8853) - add support for token sources in GitLab and Forgejo by @roele in [#8868](#8868) ### 🐛 Bug Fixes - **(aqua)** prevent double .exe extension when Windows override URL already ends in .exe by @yusei-wy in [#8863](#8863) - **(bash)** avoid duplicate trust warning after cd by @timothysparg in [#8920](#8920) - **(env)** prevent config root injection into PATH via _.source by @jdx in [#8936](#8936) - **(install)** suppress spurious dependency warning when tool is configured by @jdx in [#8923](#8923) ### 📚 Documentation - **(node)** add section on pinning npm version by @jdx in [#8925](#8925) - add Windows default paths and mise.toml examples alongside CLI commands by @jdx in [#8926](#8926) - clarify common sources of confusion from GitHub discussions by @jdx in [#8927](#8927) - clarify Python venv mechanisms, JAVA_HOME behavior, and activation performance by @jdx in [#8928](#8928) - add FAQ and troubleshooting entries based on common Discord questions by @jdx in [#8930](#8930) ### New Contributors - @SamSoldatenko made their first contribution in [#8853](#8853) - @yusei-wy made their first contribution in [#8863](#8863)
Settings-based env files (MISE_ENV_FILE / env_file setting) were previously invisible in all diagnostic outputs despite being loaded.
mise config lsnow shows env files as rows in the main table with (none) in the Tools column;-vshows the env var keys they setmise doctornow includes an env_files section in both text and JSON outputCloses #8806