-
Notifications
You must be signed in to change notification settings - Fork 29
refactor(env): unify truthy env var checks in scripts #3289
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
Conversation
Introduce a common `is_truthy` function in Bash scripts and a Python `is_truthy_env_var` helper to standardize environment variable checks for truthy values. Refactor all relevant Bash and Python scripts to use these helpers, improving consistency and maintainability across the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces unified helper functions for checking truthy environment variable values across Bash and Python scripts. The refactoring aims to improve consistency and maintainability by standardizing environment variable checks that were previously implemented inconsistently throughout the codebase.
Changes:
- Introduces
is_truthy()function in.github/common.shfor Bash scripts - Adds
is_truthy_env_var()helper incardano_node_tests/utils/helpers.pyfor Python - Refactors all relevant environment variable checks to use these new helpers
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
.github/common.sh |
New file introducing is_truthy() Bash function that checks for specific truthy values |
cardano_node_tests/utils/helpers.py |
Adds is_truthy_env_var() Python function for standardized truthy checks |
cardano_node_tests/utils/configuration.py |
Refactors multiple environment variable checks to use is_truthy_env_var() helper |
cardano_node_tests/tests/test_reconnect.py |
Updates TEST_RECONNECT and TEST_METRICS_RECONNECT checks to use new helper |
cardano_node_tests/tests/conftest.py |
Updates CI_SKIP_PASSED check to use new helper |
.github/source_dbsync.sh |
Refactors SMASH variable checks to use is_truthy() function |
.github/regression.sh |
Updates CI_BYRON_CLUSTER check and removes obsolete ALLOW_UNSTABLE_ERROR_MESSAGES section |
.github/node_upgrade_pytest.sh |
Updates CI_BYRON_CLUSTER check to use is_truthy() function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Introduce a common
is_truthyfunction in Bash scripts and a Pythonis_truthy_env_varhelper to standardize environment variable checks for truthy values. Refactor all relevant Bash and Python scripts to use these helpers, improving consistency and maintainability across the codebase.