Thank you for your interest in contributing to Prescale! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Pull Request Process
- Coding Standards
- Testing
- Documentation
- Community
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to conduct@prescale.dev.
- Python 3.11+
- Docker & Docker Compose
- Kubernetes cluster (local: minikube, kind, or Docker Desktop)
- Helm 3.x
- Git
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/prescale.git cd prescale - Add the upstream remote:
git remote add upstream https://github.com/pyjeebz/prescale.git
# Linux/macOS
python -m venv .venv
source .venv/bin/activate
# Windows
python -m venv .venv
.\.venv\Scripts\Activate.ps1pip install -r ml/requirements.txt
pip install -r requirements-dev.txt # Development dependenciescp .env.example .env
# Edit .env with your configurationpytest tests/ -v# Using Docker Compose
docker-compose up -d
# Or deploy to local Kubernetes
helm install prescale ./charts/prescale --namespace prescale --create-namespaceBefore creating bug reports, please check existing issues. When creating a bug report, include:
- Clear title describing the issue
- Steps to reproduce the behavior
- Expected behavior vs actual behavior
- Environment details (OS, Python version, Kubernetes version)
- Logs and error messages (sanitized of sensitive data)
- Screenshots if applicable
Use the bug report template when opening an issue.
Enhancement suggestions are welcome! Please include:
- Use case - Why is this enhancement needed?
- Proposed solution - How should it work?
- Alternatives considered - What other approaches did you consider?
- Additional context - Any other relevant information
- Find an issue to work on, or create one for discussion
- Comment on the issue to let others know you're working on it
- Create a branch from
mainfor your work - Make your changes following our coding standards
- Write/update tests for your changes
- Submit a pull request
Look for issues labeled good first issue - these are specifically curated for new contributors.
- Code follows the project's coding standards
- All tests pass locally (
pytest tests/ -v) - Linting passes (
ruff check .) - Type checking passes (
mypy ml/) - Documentation is updated if needed
- Commit messages follow conventions
-
Title: Use a clear, descriptive title
feat: Add anomaly detection for disk I/Ofix: Resolve memory leak in prediction servicedocs: Update deployment guide
-
Description: Fill out the PR template completely
- What changes were made?
- Why were they made?
- How to test them?
-
Size: Keep PRs focused and reasonably sized
- Large changes should be split into smaller PRs
- Each PR should do one thing well
- Automated checks must pass (CI/CD, tests, linting)
- At least one maintainer approval required
- Address review feedback promptly
- Squash commits if requested before merge
We follow PEP 8 with these tools:
# Formatting
ruff format .
# Linting
ruff check .
# Type checking
mypy ml/ --strictml/
βββ inference/ # Prediction API service
β βββ main.py # FastAPI application
β βββ models.py # Pydantic models
β βββ predictors.py # Prediction logic
βββ pipeline/ # Training pipeline
βββ models/ # Saved ML models
βββ cost_intelligence/ # Cost analysis service
Follow Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Formatting, no code changerefactor: Code change that neither fixes nor addsperf: Performance improvementtest: Adding or updating testschore: Maintenance tasks
- Follow RESTful conventions
- Use meaningful HTTP status codes
- Include proper error messages
- Document endpoints with OpenAPI/Swagger
tests/
βββ unit/ # Unit tests
β βββ test_predictors.py
β βββ test_models.py
βββ integration/ # Integration tests
β βββ test_api.py
βββ e2e/ # End-to-end tests
βββ test_workflow.py
# All tests
pytest tests/ -v
# With coverage
pytest tests/ --cov=ml --cov-report=html
# Specific test file
pytest tests/unit/test_predictors.py -v
# By marker
pytest tests/ -m "not slow" -v- Use descriptive test names:
test_predict_cpu_returns_valid_forecast - Follow Arrange-Act-Assert pattern
- Mock external dependencies
- Test edge cases and error conditions
- Add docstrings to all public functions, classes, and modules
- Use Google-style docstrings:
def predict_cpu(data: pd.DataFrame, horizon: int = 24) -> Dict[str, Any]:
"""Generate CPU usage predictions.
Args:
data: Historical CPU metrics with timestamp index.
horizon: Number of hours to forecast.
Returns:
Dictionary containing predictions and confidence intervals.
Raises:
ValueError: If data is empty or invalid.
"""- Update README.md for user-facing changes
- Add/update docs in
docs/directory - Include examples for new features
- GitHub Discussions: Ask questions and share ideas
- Discord: Real-time chat with the community
- Stack Overflow: Tag questions with
prescale-ml
Questions about contributing? Reach out to:
- GitHub: @pyjeebz
- Email: maintainers@prescale.dev
Contributors are recognized in:
- CONTRIBUTORS.md
- Release notes
- Project documentation
By contributing to Prescale, you agree that your contributions will be licensed under the Apache License 2.0.
Thank you for contributing to Prescale! π