Contributions are welcome! Please follow these guidelines to ensure high quality code and smooth collaboration.
# Fork and clone
git clone https://github.com/yourusername/routing-table-api.git
cd routing-table-api
make install
# Create feature branch
git checkout -b feature/amazing-feature
# Make changes and test
make test-cov # Must maintain β₯35% coverage
make lint # Must pass
make type-check # Must pass
# Commit using conventional commits
git commit -m "feat: add amazing feature"All contributions must meet these criteria:
- β All tests pass (29/29)
- β Coverage maintained (β₯35%)
- β
Linter passes (
make lint) - β Type hints for new code
- β Google-style docstrings
- β PEP 8 compliance (enforced by ruff)
Use Conventional Commits format:
| Type | Use Case |
|---|---|
feat: |
New feature |
fix: |
Bug fix |
docs: |
Documentation only |
refactor: |
Code refactoring |
test: |
Adding/updating tests |
chore: |
Build/tooling changes |
perf: |
Performance improvement |
Examples:
git commit -m "feat: add IPv6 support to radix tree"
git commit -m "fix: handle edge case in LPM lookup"
git commit -m "docs: add Kubernetes deployment guide"
git commit -m "test: add concurrency tests for thread safety"make test # Run all 29 tests
make test-cov # With coverage report
make coverage-report # Open HTML coverage in browser- test_lpm.py - 20 unit tests for LPM algorithm
- test_concurrency.py - 9 thread safety tests
- test_service.py - Integration tests
- Minimum: 35%
- Target: 50%+
- Check:
make test-covshows coverage
make lint # Check with ruff
make format # Auto-format code
make type-check # Type checking with mypy- Style Guide: PEP 8 (via ruff)
- Type Hints: Required for all functions
- Docstrings: Google-style format
Example:
def lookup(ip: str) -> tuple[str, str, int]:
"""
Perform longest prefix match lookup.
Args:
ip: IPv4 or IPv6 address string
Returns:
Tuple of (prefix, next_hop, metric)
Raises:
ValueError: If IP format is invalid
"""
# implementation...- Fork the repository
- Create a feature branch:
git checkout -b feature/name - Make changes following the guidelines
- Test thoroughly:
make test-cov - Lint & format:
make lint && make format - Type check:
make type-check - Commit with conventional commits
- Push to your fork
- Create PR with clear description
## Description
Brief description of changes
## Related Issues
Closes #123
## Changes
- Change 1
- Change 2
## Testing
- [ ] Tests pass (29/29)
- [ ] Coverage maintained (β₯35%)
- [ ] Linter passes
- [ ] Type checking passes
## Types of Changes
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation## Description
Clear description of the bug
## Steps to Reproduce
1. Step 1
2. Step 2
## Expected Behavior
What should happen
## Actual Behavior
What actually happened
## Environment
- Python version
- OS (Linux/Mac/Windows)
- Docker/K8s version (if applicable)
## Logs/Output
Include relevant error messages## Description
Explain the feature and why it's needed
## Use Case
When would this feature be useful?
## Proposed Solution
How should it work?
## Alternatives
Are there other approaches?- Create tests first (TDD approach)
- Implement the feature
- Ensure all tests pass
- Update documentation
- Add type hints
- Write docstrings
- Run existing tests - Ensure they pass
- Make changes carefully
- Add/update tests if behavior changed
- Check coverage - Don't decrease it
- Update docs if public API changed
- Radix tree lookup is O(k) - don't add linear operations
- LRU cache is critical for performance - don't remove caching
- Thread safety must be maintained - use locks appropriately
- Memory usage is important - keep data structures efficient
- β Correctness - Does it work as intended?
- β Efficiency - Are there performance concerns?
- β Readability - Is the code clear and maintainable?
- β Testing - Are there adequate tests?
- β Documentation - Is it well documented?
- β Style - Does it follow our conventions?
- Automated checks - Linting, testing, coverage
- Code review - Manual review by maintainers
- Feedback loop - Address comments/suggestions
- Approval - At least one approval required
- Merge - Merge to main branch
This project follows Semantic Versioning:
- MAJOR - Breaking API changes (v1.0.0 β v2.0.0)
- MINOR - New features (backward compatible) (v1.0.0 β v1.1.0)
- PATCH - Bug fixes (backward compatible) (v1.0.0 β v1.0.1)
- Update version in relevant files
- Update CHANGELOG with release notes
- Create git tag:
git tag -a v1.0.0 -m "Release v1.0.0" - Push tag:
git push origin v1.0.0 - GitHub Actions automatically creates release with:
- Python wheel and source distribution
- Docker images on ghcr.io
- Release notes on GitHub
- API Docs: http://localhost:5000/docs (Swagger)
- Algorithm Details: See README.md
- CI/CD Setup: .github/CICD_SETUP.md
- Project Structure: See README.md
- GitHub Issues - Ask a question with
[question]tag - Discussions - Open GitHub Discussion for ideas
- Email - Contact maintainer for private matters
Be respectful, inclusive, and professional. We welcome contributors of all backgrounds and experience levels.
Thank you for contributing! π
Contributions are welcome! Please follow these guidelines to ensure high quality code and smooth collaboration.
# Fork and clone
git clone https://github.com/yourusername/routing-table-api.git
cd routing-table-api
make install
# Create feature branch
git checkout -b feature/amazing-feature
# Make changes and test
make test-cov # Must maintain β₯35% coverage
make lint # Must pass
make type-check # Must pass
# Commit using conventional commits
git commit -m "feat: add amazing feature"All contributions must meet these criteria:
- β All tests pass (29/29)
- β Coverage maintained (β₯35%)
- β
Linter passes (
make lint) - β Type hints for new code
- β Google-style docstrings
- β PEP 8 compliance (enforced by ruff)
Use Conventional Commits format:
| Type | Use Case |
|---|---|
feat: |
New feature |
fix: |
Bug fix |
docs: |
Documentation only |
refactor: |
Code refactoring |
test: |
Adding/updating tests |
chore: |
Build/tooling changes |
perf: |
Performance improvement |
Examples:
git commit -m "feat: add IPv6 support to radix tree"
git commit -m "fix: handle edge case in LPM lookup"
git commit -m "docs: add Kubernetes deployment guide"
git commit -m "test: add concurrency tests for thread safety"make test # Run all 29 tests
make test-cov # With coverage report
make coverage-report # Open HTML coverage in browser- test_lpm.py - 20 unit tests for LPM algorithm
- test_concurrency.py - 9 thread safety tests
- test_service.py - Integration tests
- Minimum: 35%
- Target: 50%+
- Check:
make test-covshows coverage
make lint # Check with ruff
make format # Auto-format code
make type-check # Type checking with mypy- Style Guide: PEP 8 (via ruff)
- Type Hints: Required for all functions
- Docstrings: Google-style format
Example:
def lookup(ip: str) -> tuple[str, str, int]:
"""
Perform longest prefix match lookup.
Args:
ip: IPv4 or IPv6 address string
Returns:
Tuple of (prefix, next_hop, metric)
Raises:
ValueError: If IP format is invalid
"""
# implementation...- Fork the repository
- Create a feature branch:
git checkout -b feature/name - Make changes following the guidelines
- Test thoroughly:
make test-cov - Lint & format:
make lint && make format - Type check:
make type-check - Commit with conventional commits
- Push to your fork
- Create PR with clear description
## Description
Brief description of changes
## Related Issues
Closes #123
## Changes
- Change 1
- Change 2
## Testing
- [ ] Tests pass (29/29)
- [ ] Coverage maintained (β₯35%)
- [ ] Linter passes
- [ ] Type checking passes
## Types of Changes
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation## Description
Clear description of the bug
## Steps to Reproduce
1. Step 1
2. Step 2
## Expected Behavior
What should happen
## Actual Behavior
What actually happened
## Environment
- Python version
- OS (Linux/Mac/Windows)
- Docker/K8s version (if applicable)
## Logs/Output
Include relevant error messages## Description
Explain the feature and why it's needed
## Use Case
When would this feature be useful?
## Proposed Solution
How should it work?
## Alternatives
Are there other approaches?- Create tests first (TDD approach)
- Implement the feature
- Ensure all tests pass
- Update documentation
- Add type hints
- Write docstrings
- Run existing tests - Ensure they pass
- Make changes carefully
- Add/update tests if behavior changed
- Check coverage - Don't decrease it
- Update docs if public API changed
- Radix tree lookup is O(k) - don't add linear operations
- LRU cache is critical for performance - don't remove caching
- Thread safety must be maintained - use locks appropriately
- Memory usage is important - keep data structures efficient
- β Correctness - Does it work as intended?
- β Efficiency - Are there performance concerns?
- β Readability - Is the code clear and maintainable?
- β Testing - Are there adequate tests?
- β Documentation - Is it well documented?
- β Style - Does it follow our conventions?
- Automated checks - Linting, testing, coverage
- Code review - Manual review by maintainers
- Feedback loop - Address comments/suggestions
- Approval - At least one approval required
- Merge - Merge to main branch
This project follows Semantic Versioning:
- MAJOR - Breaking API changes (v1.0.0 β v2.0.0)
- MINOR - New features (backward compatible) (v1.0.0 β v1.1.0)
- PATCH - Bug fixes (backward compatible) (v1.0.0 β v1.0.1)
- Update version in relevant files
- Update CHANGELOG with release notes
- Create git tag:
git tag -a v1.0.0 -m "Release v1.0.0" - Push tag:
git push origin v1.0.0 - GitHub Actions automatically creates release with:
- Python wheel and source distribution
- Docker images on ghcr.io
- Release notes on GitHub
- API Docs: http://localhost:5000/docs (Swagger)
- Algorithm Details: See README.md
- CI/CD Setup: .github/CICD_SETUP.md
- Project Structure: See README.md
- GitHub Issues - Ask a question with
[question]tag - Discussions - Open GitHub Discussion for ideas
- Email - Contact maintainer for private matters
Be respectful, inclusive, and professional. We welcome contributors of all backgrounds and experience levels.
Thank you for contributing! π