Pull Request Workflow
How to submit and review code changes.
Branch Naming
<type>/<ticket>-<short-description>
Examples:
feat/CRM-123-add-segment-builder
fix/CRM-456-resolve-identity-bug
chore/CRM-789-update-dependencies
Types:
feat- New featurefix- Bug fixchore- Maintenancedocs- Documentationrefactor- Code refactoringtest- Test changes
Before Creating PR
1. Run Tests
# Run all affected tests
npx nx affected -t test
# Or specific project
npx nx test crm-core
npx nx test crm-backend
2. Run Lint
npx nx lint crm-backend --max-warnings=0
3. Build
npx nx build crm-backend
4. Update Tests
- Add tests for new code
- Update tests for changed behavior
- Minimum 80% coverage for new code
Creating the PR
Title Format
<type>(<scope>): <description>
Examples:
feat(crm): add AI segment builder
fix(crm): resolve identity matching for phones
docs(crm): add deployment runbook
PR Description Template
## Summary
Brief description of the change.
## Changes
- Added X
- Updated Y
- Fixed Z
## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing completed
## Related
- Closes #123
- Related to #456
Review Process
Reviewer Checklist
-
Functionality
- Does it work as intended?
- Are edge cases handled?
-
Code Quality
- Follows coding standards?
- No obvious bugs?
- Appropriate error handling?
-
Testing
- Sufficient test coverage?
- Tests are meaningful?
-
Security
- No sensitive data exposed?
- Auth/authz correct?
- Multi-tenancy enforced?
-
Performance
- No N+1 queries?
- Appropriate indexes?
- No memory leaks?
Leaving Feedback
# Use conventional prefixes
🔴 (blocking): This must be fixed before merge
🟡 (suggestion): Consider this improvement
🟢 (nit): Minor style issue
💭 (question): Need clarification
Merge Requirements
- All CI checks pass
- At least 1 approval
- No unresolved blocking comments
- Up to date with main
After Merge
If Database Changes
- Notify team of migration
- Monitor deployment
- Verify in staging
If Breaking API Changes
- Update API consumers
- Update documentation
- Consider deprecation period
Hotfix Process
For critical production issues:
# Create from main
git checkout main
git pull
git checkout -b hotfix/CRM-999-critical-fix
# Make minimal fix
# ...
# Create PR with hotfix label
# Request expedited review