Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands Diffyscan’s configuration support to include YAML (to enable comments and richer samples), adds new vault configuration samples, and introduces dotenv-based environment variable loading for local developer workflows.
Changes:
- Add YAML (
.yaml/.yml) config support alongside JSON, including directory scanning updates. - Add dotenv loading on startup and include a
.env.exampletemplate. - Add test coverage and “full config” fixtures for JSON/YAML parity, plus new YAML config samples for Meta vaults.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
diffyscan/utils/common.py |
Extend load_config() to parse YAML and validate extension. |
diffyscan/utils/constants.py |
Update default config path selection to prefer existing config.{json,yaml,yml}. |
diffyscan/diffyscan.py |
Load .env on startup; filter config files by supported extensions when scanning directories. |
tests/test_configs.py |
Update sample-config tests to include YAML/YML files. |
tests/test_config_loading.py |
Add unit tests covering JSON/YAML loading behavior and fixtures. |
tests/fixtures/full_config.yaml |
Add comprehensive YAML fixture for loader parity tests. |
tests/fixtures/full_config.json |
Add comprehensive JSON fixture for loader parity tests. |
pyproject.toml |
Add pyyaml and python-dotenv runtime dependencies. |
poetry.lock |
Lockfile updates for new dependencies. |
config_samples/ethereum/mainnet/meta/meta_usd_config.yaml |
Add new YAML sample config for Meta Earn USD vaults. |
config_samples/ethereum/mainnet/meta/meta_eth_config.yaml |
Add new YAML sample config for Meta Earn ETH vault. |
config_samples/ethereum/mainnet/meta/meta_core_config.yaml |
Add new YAML sample config for Meta core implementations/factories. |
.env.example |
Provide example environment variables for tokens, hostnames, and RPC URLs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
72b9d0f to
b464c60
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds robust support for YAML configuration files alongside existing JSON support, improves environment variable management, and expands sample and test configurations for Ethereum mainnet vaults. The changes make it easier to manage configurations in different formats and environments, and provide comprehensive examples for various vault deployments.
YAML and JSON configuration support:
load_configto detect file extension and use the appropriate parser (yaml.safe_loadfor YAML,json.loadfor JSON)..json,.yaml, or.ymlextensions.config.json,config.yaml, orconfig.ymlif present.Environment variable and dependency improvements:
.env.examplewith required and optional environment variables for API tokens and RPC URLs.python-dotenvdependency and ensured environment variables are loaded automatically at application startup. [1] [2] [3]pyyamlas a dependency for YAML parsing.Sample and test configuration expansion:
meta_core_config.yaml,meta_eth_config.yaml,meta_usd_config.yaml) covering various contract addresses, explorer settings, and dependencies. [1] [2] [3]