feat: Adds config files and management to CLI#43
feat: Adds config files and management to CLI#43thomastaylor312 wants to merge 1 commit intomicrosoft:mainfrom thomastaylor312:feat/config_file
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds configuration file management to the CLI, allowing users to configure plugin directories and policy files through TOML configuration files, environment variables, or command-line arguments with proper precedence.
Key Changes
- Migrated from hardcoded default directory logic to a flexible configuration system using the
figmentcrate - Added support for TOML configuration files with environment variable overrides
- Restructured CLI command structure to use a dedicated
Servestruct with serialization support
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/main.rs | Refactored CLI structure and removed hardcoded directory logic in favor of config module |
| src/config.rs | Added comprehensive configuration management with file, environment, and CLI precedence |
| Cargo.toml | Added dependencies for configuration management (figment, etcetera) |
| get_component_dir().unwrap_or_else(|_| { | ||
| eprintln!("WARN: Unable to determine default component directory, using `components` directory in the current working directory"); | ||
| PathBuf::from("./components") | ||
| }) |
There was a problem hiding this comment.
The warning message uses eprintln! which bypasses the application's logging system. Consider using the tracing crate for consistent logging throughout the application.
There was a problem hiding this comment.
This was purposeful because this function is called on creation of the clap App so the logging is not necessarily initialized at this point
Mossaka
left a comment
There was a problem hiding this comment.
A bunch of renames are needed
|
Ok, think I got all the renames done |
|
@microsoft-github-policy-service rerun |
|
Need a rebase and there are some linting issues |
|
I swear my auto format isn't working in VSCode anymore. Pushing up the rebase and lint fixes soon |
This adds basic configuration for the things we already have. In a follow up I'll add support for OCI credentials and allowed repositories Closes #34 Signed-off-by: Taylor Thomas <taylor@oftaylor.com>
This adds basic configuration for the things we already have. In a follow up I'll add support for OCI credentials and allowed repositories
Closes #24