Thank you for considering contributing to Cloudify! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to maintain a respectful and collaborative environment.
If you find a bug, please create an issue with:
- Clear description of the bug
- Steps to reproduce
- Expected vs actual behavior
- Environment details (Python version, OS, etc.)
- Logs or error messages
Feature requests are welcome! Please create an issue with:
- Clear description of the feature
- Use cases and benefits
- Potential implementation approach
- Any examples from similar tools
-
Fork the repository
git clone https://github.com/yourusername/cloudify.git cd cloudify -
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Write clean, readable code
- Follow the existing code style
- Add type hints
- Include docstrings
- Update tests
-
Test your changes
# Run unit tests pytest tests/unit -v # Run linting ruff check . black --check . mypy .
-
Commit your changes
git add . git commit -m "feat: Add your feature description"
Use conventional commit messages:
feat:for new featuresfix:for bug fixesdocs:for documentation changestest:for test changesrefactor:for code refactoringchore:for maintenance tasks
-
Push to your fork
git push origin feature/your-feature-name
-
Create a Pull Request
- Provide a clear title and description
- Reference any related issues
- Include screenshots if applicable
- Ensure CI checks pass
- Python 3.10+
- Poetry or pip
- Docker
- GCP SDK
# Clone repository
git clone https://github.com/yourusername/cloudify.git
cd cloudify
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt # Development dependencies
# Install pre-commit hooks
pre-commit install# Run all tests
pytest
# Run specific test file
pytest tests/unit/test_code_analyzer.py
# Run with coverage
pytest --cov=agents --cov-report=html
# Run integration tests (requires GCP credentials)
pytest tests/integration -v# Format code
black .
# Lint code
ruff check .
# Type checking
mypy .
# All checks
black . && ruff check . && mypy . && pytestCloudify/
├── agents/ # Agent implementations
├── utils/ # Utility modules
├── templates/ # Deployment templates
├── tests/ # Test files
│ ├── unit/ # Unit tests
│ └── integration/ # Integration tests
└── migration_orchestrator.py # Main CLI
- Inherit from
BaseAgent - Implement
_execute_impl()method - Use event bus for communication
- Add comprehensive error handling
- Include logging
- Write unit tests
Example:
from agents.base_agent import BaseAgent, AgentResult, AgentStatus
class MyNewAgent(BaseAgent):
def __init__(self, event_bus, config, claude_api_key):
super().__init__(
name="MyNewAgent",
event_bus=event_bus,
config=config,
claude_api_key=claude_api_key,
)
async def _execute_impl(self) -> AgentResult:
try:
# Your implementation here
return AgentResult(
status=AgentStatus.SUCCESS,
data={"key": "value"},
)
except Exception as e:
return AgentResult(
status=AgentStatus.FAILED,
data={},
errors=[str(e)],
)- Update README.md for user-facing changes
- Add docstrings to all functions and classes
- Include inline comments for complex logic
- Update configuration examples
- Test individual functions and methods
- Mock external dependencies
- Use pytest fixtures
- Aim for >80% code coverage
- Test end-to-end workflows
- Use real (or containerized) services
- Clean up resources after tests
- Mark as slow tests:
@pytest.mark.slow
- Follow PEP 8
- Use type hints
- Maximum line length: 100 characters
- Use descriptive variable names
- Prefer f-strings over format()
def function_name(param1: str, param2: int) -> bool:
"""
Brief description.
Longer description if needed.
Args:
param1: Description of param1
param2: Description of param2
Returns:
Description of return value
Raises:
ValueError: When something is wrong
"""
pass- Update version in
setup.py - Update CHANGELOG.md
- Create release branch
- Run full test suite
- Create GitHub release
- Publish to PyPI (maintainers only)
- Open an issue for questions
- Join our Discord (coming soon)
- Email: team@cloudify.dev
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to Cloudify! 🚀