Merged
Conversation
Added sample info.py file to fix pylance error since file doesn't existe. File will be overwritten at build time.
…alidation • Introduced dynamic fetching of contract ABIs from skale-contracts by allowing either an alias (e.g., “test-manager”) or a direct contract address (e.g., “0xabc123…”) in the environment. • Renamed and replaced the old environment variables that directly pointed to local ABI files. • Created new validation logic (validate_env_alias_or_address) for both Manager and IMA contracts in the CLI. • Removed the obsolete tests that ensured local ABI files existed/were valid JSON and replaced them with new tests that check for valid aliases or addresses. • Updated existing tests and mocks to patch or skip the new external validation calls where necessary. • Added ruff configuration (ruff.toml) and reformatted code throughout the repository.
Added it to README dev preparation so there are no problems with missing info.py. Added info.py to .gitignore.
…ate contract address validation logic to use this utility function.
…_OR_ADDRESS' to 'MANAGER_CONTRACTS' and 'IMA_CONTRACTS', respectively.
There was a problem hiding this comment.
Copilot reviewed 33 out of 33 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
node_cli/operations/skale_node.py:43
- The 'else' branch in download_skale_node is unreachable because the function already errors out when both 'src' and 'stream' are not provided. Removing this redundant block would simplify the code.
else:
dmytrotkk
requested changes
Apr 9, 2025
dmytrotkk
requested changes
Apr 11, 2025
dmytrotkk
requested changes
Apr 11, 2025
dmytrotkk
requested changes
Apr 11, 2025
badrogger
requested changes
Apr 11, 2025
- Refactored environment validation into two files; - Updated environment validation function names for improved clarity; - Fixed minor docstring inconsistencies and formatting issues across multiple modules.
…ed test pipeline to only run tests on push
dmytrotkk
requested changes
Apr 14, 2025
dmytrotkk
approved these changes
Apr 14, 2025
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.
Overview
This pull request introduces a major overhaul of the environment configuration and validation in node-cli. The key changes include:
Simplified Environment Variable Handling:
MANAGER_CONTRACTS_ABI_URLandIMA_CONTRACTS_ABI_URL) with a new approach that uses the environment variablesMANAGER_CONTRACTSandIMA_CONTRACTS.Refactored Validation Logic:
env.pyfile has been refactored to introduce helper functions to modularize the process of loading and validating environment variables.Enhanced Testing:
tests/configs/configs_env_validate_test.py) has been created to extensively test the updated environment functions.requests_mockto simulate network responses, ensuring that the tests remain isolated.Workflow and Documentation Improvements:
rufffor linting and code formatting, improving our code quality checks.info.py) to avoid development-time import errors.Detailed Changes
Environment Configuration Updates:
MANAGER_CONTRACTS_ABI_URLandIMA_CONTRACTS_ABI_URLwithMANAGER_CONTRACTSandIMA_CONTRACTS.load_env_file()), building a base parameters dictionary (build_params()), and populating it with environment values (populate_params()).validate_params()now callsvalidate_env_type()for environment type variable andvalidate_env_alias_or_address()for both the IMA and Manager contracts using the new variables.Testing Enhancements:
requests_mockto isolate tests from real network dependencies.Workflow & Linting:
ruffinto our CI/CD pipelines via GitHub Actions.ruff.Build Process Improvement:
info.pyis now handled in a separate script (referenced in the README and CI), reducing development-time import errors.Impact
validatecommand group has been removed.Testing
rufffor code style and formatting checks and to only run test pipeline onpush.