Before You Start
1. Discuss Your Changes
Before starting significant work:- Open an issue or comment on an existing one to discuss your proposed changes
- Get feedback from maintainers about your approach
- Ensure your changes align with project goals
- Avoid duplication of effort
2. Set Up Your Environment
Make sure you have:- Forked the CVAT repository
- Set up your development environment
- Read the code style guidelines
- Familiarized yourself with testing
Creating a Pull Request
Step 1: Create a Branch
Create a feature branch fromdevelop:
feature/description- New featuresfix/description- Bug fixesrefactor/description- Code refactoringdocs/description- Documentation changes
Step 2: Make Your Changes
Follow these guidelines:- Write clean code: Follow the code style guidelines
- Keep commits focused: Each commit should represent a logical change
- Write good commit messages: See examples below
- Add tests: Cover your changes with appropriate tests
- Update documentation: If your changes affect user-facing features
Step 3: Test Your Changes
Before submitting, ensure:Step 4: Create Changelog Fragment
CVAT uses scriv for changelog management. Create a changelog fragment:changelog.d/ where you describe your changes:
- Added: New features
- Changed: Changes to existing functionality
- Deprecated: Features that will be removed
- Removed: Features that were removed
- Fixed: Bug fixes
- Security: Security-related changes
Step 5: Commit Your Changes
Write clear, descriptive commit messages:Step 6: Push to Your Fork
Step 7: Create Pull Request on GitHub
- Go to your fork on GitHub
- Click “Compare & pull request”
- Base branch:
develop(notmaster!) - Head branch: Your feature branch
- Fill out the PR template
Pull Request Template
When you create a PR, fill out this template:Review Process
What Happens Next
- Automated checks run: CI/CD pipeline runs tests and linters
- Maintainers review: Core team reviews your code
- Feedback provided: You may receive comments and change requests
- You iterate: Address feedback and push updates
- Approval: Once approved, your PR will be merged
CI/CD Checks
Your PR must pass all automated checks:- ✅ Linters: ESLint, Pylint, Black, isort
- ✅ Type checking: TypeScript, mypy
- ✅ Tests: Unit, integration, E2E tests
- ✅ Security: CodeQL analysis
- ✅ Build: Docker images build successfully
Code Review
Reviewers will check for:- Code quality: Readable, maintainable, follows style guidelines
- Correctness: Logic is sound and bug-free
- Tests: Adequate test coverage
- Documentation: Changes are documented
- Performance: No unnecessary performance degradation
- Security: No security vulnerabilities introduced
Responding to Feedback
When you receive feedback:- Be responsive: Reply to comments promptly
- Ask questions: If something is unclear, ask for clarification
- Make changes: Address the feedback in new commits
- Be respectful: Remember reviewers are helping improve your code
- Mark resolved: Mark conversations as resolved when addressed
Updating Your Branch
Ifdevelop has moved forward, you may need to update:
Pull Request Requirements
Your PR should:Required
- Target the
developbranch - Pass all CI/CD checks
- Include a changelog fragment
- Have clear commit messages
- Include tests for new functionality
- Follow code style guidelines
- Link to related issues
- Have an approved review from a maintainer
Recommended
- Update documentation if needed
- Add screenshots for UI changes
- Include performance considerations
- Address any security implications
Common Issues
CI Failures
Linter errors:- Run tests locally to reproduce
- Check test logs in CI for details
- Ensure your changes don’t break existing functionality
- Check Docker build logs
- Ensure all dependencies are installed
- Verify Dockerfile syntax
Merge Conflicts
If your branch has conflicts withdevelop:
Stale Pull Requests
If your PR becomes stale:- Update your branch with latest
develop - Address any new conflicts
- Respond to pending review comments
- Ping maintainers if needed
After Your PR is Merged
Clean Up
Celebrate! 🎉
Your contribution is now part of CVAT! Thank you for contributing.What’s Next?
- Look for more issues to work on
- Help review other pull requests
- Improve documentation
- Join community discussions
Getting Help
If you need help with your PR:- Comment on the PR: Ask questions directly
- Join Gitter: opencv-cvat/public
- Join Discord: CVAT Discord Server
- Check documentation: Review relevant guides
Best Practices
Do:
- Keep PRs focused and reasonably sized
- Write clear descriptions and commit messages
- Add tests for your changes
- Update documentation when needed
- Respond to reviews promptly
- Be patient and respectful
Don’t:
- Submit massive PRs that are hard to review
- Make unrelated changes in the same PR
- Push without running tests locally
- Ignore review feedback
- Force-push over others’ commits
- Be discouraged by feedback
Resources
- GitHub Pull Request Documentation
- CVAT Contributing Guide
- Code Style Guidelines
- Testing Guide
- Architecture Overview