Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Configuration Merging and Precedence Rules #4451

Closed
5 tasks
ShohamBit opened this issue Dec 18, 2024 · 1 comment
Closed
5 tasks

Implement Configuration Merging and Precedence Rules #4451

ShohamBit opened this issue Dec 18, 2024 · 1 comment
Assignees

Comments

@ShohamBit
Copy link
Collaborator

Background
With both config files and command-line flags in place, we need a clear set of rules to determine how these configurations interact. Specifically, we need to ensure that command-line flags always override the config file settings, and that default values apply only when neither file nor flags specify a setting.

Tasks

  • Implement logic to read and store configuration from the YAML file first.
  • Parse and store all command-line flags.
  • Merge configurations by applying the precedence rules:
    1. Command-line flags override any value set by the config file.
    2. Config file values override default values.
    3. Defaults apply only when neither flags nor config provide a value.
  • Validate the merged configuration for consistency and correctness.
  • If conflicts or invalid states arise, produce clear error messages.

Acceptance Criteria

  • After merging, the final configuration state correctly reflects CLI > File > Defaults.
  • Clear error messages are shown for invalid merges or conflicting values.
  • Unit tests confirm correct merging behavior and precedence.

Why This Matters
A well-defined and correctly implemented merging and precedence strategy ensures a predictable and transparent configuration system. Users will know exactly how their settings are determined, making the system more reliable and easier to understand.

@yanivagman
Copy link
Collaborator

Part of #4453

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

No branches or pull requests

2 participants