docs: Update README and CHANGELOG for YAML configuration support - Add Configuration File section with full example - Update Quick Start with both YAML and env var options - Add --config flag to CLI options - Update Environment Variables table with config file equivalents - Expand File Filtering section with customization options - Simplify GitHub Actions example to use config file - Add YAML configuration to CHANGELOG Co-authored-by: r.buddie <r.buddie@gmail.com>#12
docs: Update README and CHANGELOG for YAML configuration support
- Add Configuration File section with full example
- Update Quick Start with both YAML and env var options
- Add --config flag to CLI options
- Update Environment Variables table with config file equivalents
- Expand File Filtering section with customization options
- Simplify GitHub Actions example to use config file
- Add YAML configuration to CHANGELOG
Co-authored-by: r.buddie <r.buddie@gmail.com>#12
Conversation
Adds support for a diffdash.yml configuration file that can be committed to the repository, allowing teams to share configuration consistently. Changes: - Add ConfigLoader class for YAML file loading with env var overrides - Update Config class to use ConfigLoader as its backend - Add --config flag to CLI for specifying custom config file paths - Update FileFilter to support configurable ignore_paths, include_paths, excluded_suffixes, and excluded_directories - Pass config through ChangeSet.from_git to FileFilter - Add app_name and pr_deploy_annotation_expr to Config for Grafana output - Add comprehensive tests for ConfigLoader and updated Config/FileFilter Configuration precedence (highest to lowest): 1. Environment variables 2. --config flag specified file 3. diffdash.yml in current directory 4. diffdash.yml in git repository root 5. Default values Security: API tokens are only loaded from environment variables. Example configuration file provided as diffdash.example.yml. Co-authored-by: r.buddie <r.buddie@gmail.com>
- Add Configuration File section with full example - Update Quick Start with both YAML and env var options - Add --config flag to CLI options - Update Environment Variables table with config file equivalents - Expand File Filtering section with customization options - Simplify GitHub Actions example to use config file - Add YAML configuration to CHANGELOG Co-authored-by: r.buddie <r.buddie@gmail.com>
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on February 10. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
There was a problem hiding this comment.
Pull request overview
This PR adds YAML configuration file support to diffdash, enabling teams to share configuration via committed files while keeping secrets in environment variables. The implementation introduces a new ConfigLoader class that handles file discovery and precedence, refactors FileFilter to support configurable filtering rules, and updates the CLI to accept a --config flag.
Changes:
- Added YAML configuration file support with automatic discovery (current dir, git root, or explicit path via
--configflag) - Introduced configurable file filtering with
ignore_paths,include_paths,excluded_suffixes, andexcluded_directoriesoptions - Refactored
FileFilterfrom static to instance-based implementation while maintaining backwards compatibility
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/diffdash/config_loader.rb | New class handling YAML config file loading with environment variable overrides and security considerations |
| lib/diffdash/config.rb | Updated to delegate to ConfigLoader while maintaining existing API |
| lib/diffdash/file_filter.rb | Refactored to support instance-based configuration with backwards-compatible class methods |
| lib/diffdash/cli/runner.rb | Added --config flag support and config info logging |
| lib/diffdash/outputs/grafana.rb | Updated to accept app_name and pr_deploy_annotation_expr from config |
| lib/diffdash/engine/change_set.rb | Updated to pass config to FileFilter |
| spec/diffdash/config_loader_spec.rb | Comprehensive test coverage for ConfigLoader |
| spec/diffdash/config_spec.rb | Updated tests for Config delegation |
| spec/diffdash/file_filter_spec.rb | Expanded tests for configurable filtering |
| diffdash.example.yml | Example configuration file with detailed comments |
| README.md | Extensive documentation updates covering configuration, file filtering, and GitHub Actions setup |
| CHANGELOG.md | Documents new features added in this release |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| idx = args.index('--config') | ||
| return nil unless idx | ||
|
|
||
| args[idx + 1] |
There was a problem hiding this comment.
The extract_config_path method doesn't validate that a value follows the --config flag. If --config is the last argument, args[idx + 1] will return nil, which is probably acceptable, but if the next argument is another flag (e.g., diffdash --config --verbose), it will incorrectly use --verbose as the config path. Consider adding validation to ensure the next argument exists and is not another flag.
| args[idx + 1] | |
| value = args[idx + 1] | |
| return nil if value.nil? || value.start_with?('-') | |
| value |
| warn "[diffdash] Note: #{dynamic_count} dynamic metric#{unless dynamic_count == 1 | ||
| 's' | ||
| end} detected but cannot be added to dashboard" |
There was a problem hiding this comment.
This formatting change makes the code less readable compared to the original. Consider reverting to the more concise original format: "#{dynamic_count} dynamic metric#{"s" unless dynamic_count == 1} detected..."
| warn "[diffdash] Note: #{dynamic_count} dynamic metric#{unless dynamic_count == 1 | |
| 's' | |
| end} detected but cannot be added to dashboard" | |
| warn "[diffdash] Note: #{dynamic_count} dynamic metric#{"s" unless dynamic_count == 1} detected but cannot be added to dashboard" |
No description provided.