feat(jay): add config infrastructure (#406)#407
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThis PR introduces a comprehensive configuration management system for the project. It includes typed configuration structures, file loading with multiple format support, validation framework with error aggregation, and flag resolution logic with precedence rules. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Loader as cfg.Load()
participant Viper
participant Decoder
participant Validator
Client->>Loader: LoadOptions (path, format, env)
Loader->>Viper: Configure (format, paths, env bindings)
Viper->>Viper: Read config file
Loader->>Decoder: Decode sections
Decoder->>Viper: Read each section
Decoder->>Decoder: mapstructure decode mapped sections<br/>(Interaction, Advanced, Logging)
Decoder->>Decoder: Raw sections as map[string]any<br/>(Actions, Pipelines, Flags)
Loader->>Validator: Validate(*Config)
Validator->>Validator: Validate LoggingConfig (log level, sizes)
Validator->>Validator: Validate AdvancedConfig (extensions)
Validator->>Validator: Validate Actions (non-empty cmd)
Validator->>Validator: Validate Pipelines (known actions)
Validator->>Validator: Validate FlagsConfig (short overrides)
Validator-->>Loader: Aggregated errors or nil
Loader-->>Client: *Config or error
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.OpenGrep is compatible with Semgrep configurations. Add an |
Summary by CodeRabbit
Release Notes
New Features
Tests