Contributing to ToOp#
Thank you for your interest in contributing to ToOp! This guide will help you understand our development workflow and contribution process.
Branch Strategy#
We use trunk-based development:
main: The stable trunk branch containing all development and releases
Working with Branches#
-
Feature Development: Create feature branches from
main -
Bug Fixes: Create fix branches from
main -
Pull Requests:
- All feature and fix branches should target
main - Ensure your changes are tested and pass all CI checks before requesting review
- All feature and fix branches should target
Commit Message Standards#
We enforce Conventional Commits for all commits and Developer Certificate of Origin (DCO). Each commit message must follow this format:
Commit Types#
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the coderefactor: A code change that neither fixes a bug nor adds a featureperf: A code change that improves performancetest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary tools
Developer Certificate of Origin#
You can add the sign-off manually, or use Git's -s option to include it automatically.
According to Git's own docs:
Adding the Signed-off-by trailer to a patch should be a conscious act and means that you certify you have the rights to submit this work under the same open source license.
Examples#
Local Development Setup#
We provide a Development Container configuration that sets up a complete development environment with all dependencies and tools pre-configured.
Prerequisites#
- Docker installed and running
- VS Code with the Dev Containers extension
Getting Started#
-
Clone the repository:
-
Open in Dev Container:
- Open the repository in VS Code
- When prompted, click "Reopen in Container" or use
Ctrl+Shift+P→ "Dev Containers: Reopen in Container" - Wait for the container to build and configure (first time may take several minutes)
What's Included#
The devcontainer automatically provides:
- Python environment with all dependencies installed via
uv - Pre-commit hooks automatically installed and configured
- VS Code extensions for Python, Jupyter, Azure tools, and code quality
- Docker-in-Docker for containerized workflows
- Git configuration with safe directory setup
- Testing suite based on
pytestwith VS Code testing integration.- Run all tests:
uv run pytest(this may take some time) - Run some test:
uv run pytest packages/<package_name>_pkg/<package_name>_tests
- Run all tests:
Benefits#
- Consistent Environment: Everyone uses the same development setup
- Quick Start: No manual dependency installation required
- Isolation: No impact on your local system
- Pre-configured Tools: All linting, formatting, and validation tools ready to use
Commit Message Validation#
Commit messages are validated both locally (via pre-commit hooks) and in CI. The validation uses Commitizen with the conventional commits standard.
If your commit message doesn't follow the convention: - Locally: The pre-commit hook will block the commit - In CI: Pull requests will fail validation
Release Process#
Releases are managed through GitHub Actions and only generate Git tags. No commits are created during the release process.
Release Types#
-
Stable Releases (from
mainbranch):- Follow semantic versioning (e.g.,
v1.2.3) - Used for production-ready code
- Follow semantic versioning (e.g.,
-
Development Releases (from feature branches):
- Include a development identifier (e.g.,
v1.2.3.dev12345) - Used for testing and preview purposes
- Include a development identifier (e.g.,
Release Workflow#
The release process is automated through .github/workflows/release.yaml:
- Manual Trigger: Releases are triggered manually via GitHub Actions
- Version Calculation: Commitizen analyzes commit history to determine the next version
- Tag Creation: A Git tag is created with the new version
- Tag Push: The tag is pushed to the repository
Note: Releases only create Git tags. No packages are published to external registries.
Creating a Release#
- Ensure your branch has the changes you want to release
- Go to the GitHub Actions tab in the repository
- Select the "release" workflow
- Click "Run workflow" and select the appropriate branch
- The workflow will automatically determine the next version and create a tag
Pull Request Process#
- Create a Branch: Create a new branch from the
mainbranch - Make Changes: Implement your feature or fix
- Write Tests: Ensure your changes are covered by tests
- Commit: Use conventional commit messages
- Push: Push your branch to the repository
- Open PR: Create a pull request targeting the
mainbranch
PR Requirements#
- Single purpose: Each PR should contain one type of change - either a feature, a bugfix, or a refactor. Avoid mixing different types of changes in a single PR
- All commits must pass conventional commit validation
- Code must pass all pre-commit hooks
- Tests must pass.
- Code coverage must be over 90% and aimed for 100%.
- Test locally by running
uv run pytest
- Documentation should be updated if needed
Getting Help#
If you have questions about contributing:
- Check existing issues and pull requests
- Review the codebase documentation in the
docs/directory - Reach out to the maintainers
Thank you for contributing to ToOp! 🚀
License#
When you contribute to ToOp, you acknowledge and agree to the terms set out for any current and future contributions you provide.
All contributions will be licensed according to the license specified in the repository.