Skip to content

Conversation

@guptapratykshh
Copy link
Contributor

#1212

This PR introduces new dora config command that provides unified configuration management for the Dora CLI. This makes it easier to manage coordinator settings and other configuration options without repeatedly specifying command-line flags

The new command provides a complete configuration management interface:

Configuration Operations: Supports list , get, set, and unset subcommands for managing configuration values with intuitive syntax
Layered Configuration: Implements global (~/.dora/config.toml) and project-level (./dora.toml) configuration files, with project settings automatically overriding global ones
Coordinator Settings: Focuses on essential coordinator configuration (coordinator.addr and coordinator.port)
Developer Experience: Automatically creates configuration directories and files, provides clear feedback messages, and supports nested key notation (e.g., coordinator.addr) for intuitive configuration management

@guptapratykshh
Copy link
Contributor Author

please check the readme.md ,for the understanding of the implementation

@guptapratykshh
Copy link
Contributor Author

ping @haixuanTao @phil-opp

Copy link
Collaborator

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

The config files seems to have no effect right? So you can set your port number etc but this all has no effect.

You also can set arbitrary values with no checking at all. So you can set the log level to "Lorem ipsum" and, the address to true`, and the port number to "I don't care".

I think the proper way to implement a config system is to:

  1. Define a Config struct with all the available options that implements Serialize/Deserialize. Unknown fields should not error for backwards compatibility, but we should warn about them to catch typos (e.g. users writing potr instead of port).
  2. Load the config struct at CLI startup.
  3. Update the existing commands to default to the config file if the corresponding CLI argument is not given.
  4. Provide utility commands in the CLI for updating the config file.

This PR seems to implement step 4, which doesn't make much sense without the prior steps.

@guptapratykshh guptapratykshh force-pushed the feature/dora-config-command branch from af865bb to 6903546 Compare January 14, 2026 16:52
@guptapratykshh guptapratykshh force-pushed the feature/dora-config-command branch from af87742 to 1de7ec7 Compare January 14, 2026 18:54
@guptapratykshh
Copy link
Contributor Author

Thanks for the review! This PR actually implements all 4 steps you outlined:

Type-safe Config struct:

  • DoraConfig with IpAddr and u16 fields enforces validation via serde. Invalid values like addr = true or port = "Lorem ipsum" fail to deserialize with clear errors.
  • Config loading at startup: DoraConfig::load() merges ~/.dora/config.toml (global) and ./.dora/config.toml (project).
  • CLI integration: All 15 commands (daemon, start, stop, logs, etc.) use resolve_coordinator_addr() with priority: CLI args > config file > defaults. The config does have effect - e.g., dora config set coordinator.addr 192.168.1.100 then dora daemon uses that address.
  • Utility commands: dora config set/get/list/unset for managing config.

Unknown fields: Captured via #[serde(flatten)] and warned about (e.g., Warning: Unknown configuration key: coordinator.potr) to catch typos, as requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants