Before Submitting a PR
Ensure your changes meet all quality standards before opening a pull request.Pre-submission Checklist
Verify commits follow conventions
All commits must use the conventional commit format. Git hooks enforce this automatically.
Update documentation
If your changes affect user-facing features or APIs, update the relevant documentation.
CI checks must pass before your PR can be merged. Running checks locally saves time.
Commit Conventions
Brainbox uses Conventional Commits enforced by commitlint.Commit Format
Commit Types
| Type | Description | Example |
|---|---|---|
feat | New feature | feat: add database export functionality |
fix | Bug fix | fix: resolve sync conflict in offline mode |
docs | Documentation changes | docs: update API documentation |
refactor | Code refactoring (no feature change or fix) | refactor: simplify node permission checks |
test | Adding or updating tests | test: add unit tests for CRDT merge |
chore | Maintenance tasks (deps, config, etc.) | chore: update dependencies |
style | Code style/formatting (not CSS) | style: fix linting errors |
perf | Performance improvements | perf: optimize query performance |
ci | CI/CD changes | ci: add deployment workflow |
build | Build system changes | build: update Vite config |
revert | Reverting previous commits | revert: revert feat: add export feature |
Commit Examples
Simple commit:Commit Message Guidelines
- Use the imperative mood (“add feature” not “added feature”)
- Keep the first line under 72 characters
- Capitalize the first letter of the description
- Don’t end the description with a period
- Use the body to explain what and why, not how
Creating a Pull Request
PR Title
The PR title should follow the same conventional commit format:PR Description
Include a clear description with:- Summary: Brief explanation of the changes
- Motivation: Why these changes are needed
- Related Issues: Link to relevant issues
- Testing: How you tested the changes
- Screenshots: For UI changes (if applicable)
Draft PRs
Use draft PRs for work-in-progress:- Open a draft PR early to get feedback
- Mark as “Ready for review” when complete
- CI checks still run on draft PRs
Review Process
Requesting a Review
Review Requirements
- At least one approval required before merging
- All CI checks must pass
- No unresolved conversations
- Up to date with base branch
For Reviewers
When reviewing PRs:- Check functionality: Does it work as intended?
- Review tests: Are there adequate tests?
- Assess code quality: Is it maintainable and readable?
- Verify documentation: Is documentation updated?
- Consider edge cases: Are edge cases handled?
- Check performance: Any performance concerns?
Review Comments
Use clear, constructive feedback: Good:Merging
Merge Strategy
Brainbox uses squash and merge for most PRs:- Combines all commits into a single commit
- Keeps main branch history clean
- Preserves full history in the PR
Before Merging
Ensure:- All CI checks pass
- At least one approval received
- All review comments addressed
- Branch is up to date with
main - PR title follows conventional commit format
After Merging
- Delete the feature branch
- Close any related issues
- Monitor CI for post-merge issues
Handling Review Feedback
Making Changes
When addressing review comments:Resolving Conversations
After addressing a comment:- Respond to explain your changes
- Mark the conversation as resolved (if you agree)
- Let the reviewer resolve (if requesting re-review)
Common PR Issues
Failing CI Checks
Linting errors:Merge Conflicts
Resolve conflicts with the base branch:Prefer merging
main into your branch over rebasing to avoid force-pushing.Large PRs
If your PR becomes too large:- Consider splitting into multiple smaller PRs
- Create a parent issue tracking the overall feature
- Submit PRs incrementally, referencing the parent issue
PR Size Guidelines
| Size | Lines Changed | Recommendation |
|---|---|---|
| Small | < 200 | Ideal size, quick to review |
| Medium | 200-500 | Good, may need more review time |
| Large | 500-1000 | Consider splitting if possible |
| Extra Large | > 1000 | Difficult to review, strongly consider splitting |
Questions?
If you have questions about the PR process:- Check existing GitHub Issues
- Ask in PR comments
- Review merged PRs for examples