Contributing to DRE¶
Thank you for your interest in contributing to the Decentralized Reliability Engineering (DRE) project. This guide will help you set up your development environment and understand our contribution process.
π Table of Contents¶
- Development Environment Setup
- Project Structure
- Code Style Guidelines
- Development Workflow
- Pull Request Process
- Running Tests
- Common Issues
- Getting Help
π Development Environment Setup¶
1. Python Environment (Rye)¶
Rye is our preferred Python environment manager. It provides a unified experience for managing Python installations, dependencies, and virtual environments.
Installation¶
Project Setup¶
Common Rye Commands¶
rye run <command> # Run a command with project dependencies
rye show # Show current environment info
rye toolchain list --include-downloadable # List available Python versions
2. IDE Configuration¶
Configure your IDE to use the Python interpreter from .venv/bin/python
. This ensures consistent development settings across the team.
Troubleshooting Rye¶
If you encounter issues:
1. Update Rye: rye self update
2. Verify Python path: which python3
3. Check environment: rye show
4. List toolchains: rye toolchain list --include-downloadable
3. Pre-commit Hooks¶
We use pre-commit hooks to ensure code quality and consistency.
For more information, visit the pre-commit documentation.
4. Rust Development Setup (Optional)¶
If you plan to work on Rust components:
Install Rust Toolchain¶
System Dependencies¶
For Linux:
For macOS:
Add Cargo to your PATH:
Verify Rust Setup¶
5. Node.js and Yarn¶
Required for frontend development:
-
Install NVM:
-
Install Node.js:
-
Install Yarn:
π Project Structure¶
The DRE repository is organized into several key components:
/dashboard
- Internal DRE dashboard (frontend and backend)/rs
- Rust implementations/pylib
- Python libraries/docs
- Project documentation/k8s
- Kubernetes configurations/scripts
- Utility scripts
π Code Style Guidelines¶
Python¶
- Follow PEP 8 style guide
- Use type hints for function arguments and return values
- Document functions and classes using docstrings
- Maximum line length: 100 characters
Rust¶
- Follow the official Rust Style Guide
- Use
rustfmt
for code formatting - Run
clippy
for linting
JavaScript/TypeScript¶
- Follow the project's ESLint configuration
- Use TypeScript for new code
- Follow the Angular commit message format
π Development Workflow¶
-
Fork the repository and create your branch from
main
: -
Set up development environment:
-
Make your changes:
- Write tests for new functionality
- Update documentation as needed
-
Follow code style guidelines
-
Commit your changes:
Follow the conventional commits specification -
Push to your fork and create a pull request
π Pull Request Process¶
- Ensure all tests pass locally
- Update documentation if needed
- Add a clear description of the changes
- Link any related issues
- Request review from maintainers
- Address review feedback
- Ensure CI checks pass
PR Title Format¶
- feat: Add new feature
- fix: Fix bug
- docs: Update documentation
- test: Add tests
- refactor: Code refactoring
- chore: Maintenance tasks
β‘ Running Tests¶
Backend Tests¶
Frontend Tests¶
π₯ IC Network Internal Dashboard¶
Setup¶
Development¶
Using DRE CLI with Local Dashboard¶
β Common Issues¶
Linux: "No disk space left" with Bazel¶
If you encounter inotify issues:
Other Common Issues¶
-
Permission Denied Errors
-
Node Version Mismatch
-
Bazel Cache Issues
π€ Getting Help¶
- Check existing GitHub Issues
- Join our developer community
- Review our documentation
- Reach out to maintainers on Discord
Before Asking for Help¶
- Search existing issues
- Check the documentation
- Try troubleshooting steps
- Provide relevant details when asking
Remember: Good code is not just about functionalityβit's about maintainability, readability, and collaboration. Thank you for contributing to DRE! π