Pull Request Process
All code changes go through pull requests with CI checks and team review before merging to main.
Branch Naming
| Prefix | Use Case | Example |
|---|---|---|
feature/ | New features | feature/add-audience-segments |
fix/ | Bug fixes | fix/post-scheduling-timezone |
refactor/ | Code refactoring | refactor/ai-service-cleanup |
docs/ | Documentation changes | docs/update-api-reference |
chore/ | Dependencies, configs | chore/upgrade-prisma |
hotfix/ | Urgent production fixes | hotfix/auth-token-expiry |
# Create a new feature branch
git checkout -b feature/add-audience-segments
PR Checklist
Before submitting your PR, verify:
Required
- Code compiles without errors:
npm run build - Types check:
npm run typecheck - No console.logs left in production code
- All workspace-scoped queries include
workspaceId
If Schema Changed
- Database migration created:
npx prisma migrate dev --name description - Migration SQL reviewed for correctness
- New fields are nullable or have defaults (for backward compatibility)
-
workspaceIdfield + index added to new models
If API Changed
- New shared types added to
packages/shared/src/types/ - New Zod validators added to
packages/shared/src/validators/ - Exported from
index.tsfiles - Shared package rebuilds successfully
If Frontend Changed
- i18n translations added (both EN and AR)
- RTL tested with Arabic language
- Responsive on mobile breakpoints
- Route added to router (if new page)
- Navigation updated (if new page)
If Environment Changed
- New environment variables documented
-
.env.exampleupdated - Default values provided where possible
Commit Messages
Use conventional commits:
<type>: <description>
[optional body]
[optional footer]
| Type | Usage |
|---|---|
feat | New feature |
fix | Bug fix |
refactor | Code refactoring (no behavior change) |
docs | Documentation only |
chore | Dependencies, configs, CI |
test | Adding or fixing tests |
perf | Performance improvement |
style | Code formatting (no logic change) |
Examples
feat: add audience segmentation with rule builder
fix: correct timezone handling in scheduler
Fixes posts publishing at wrong times for users in non-UTC timezones.
refactor: simplify AI service interface
Consolidate callGemini variants into single function with options.
chore: upgrade Prisma to v6.2 and regenerate client
Review Process
CI Checks (Automated)
| Check | Command | Must Pass |
|---|---|---|
| Build | npm run build | Yes |
| Lint | npm run lint | Yes |
| Type check | npm run typecheck | Yes |
Code Review Guidelines
Reviewers should check for:
| Category | What to Look For |
|---|---|
| Security | Workspace scoping, auth guards, input validation |
| Performance | N+1 queries, unnecessary re-renders, large payloads |
| Types | Proper typing, no any, shared types used |
| Error handling | AppError thrown for expected cases, errors propagated |
| Testing | Critical paths have test coverage |
| i18n | All user-facing strings use t() |
| Consistency | Follows established patterns in codebase |
Merge Strategy
| Strategy | When |
|---|---|
| Squash and merge | Feature branches with many small commits |
| Merge commit | Large features where commit history matters |
| Rebase | Never on shared branches |
After Merge
- CI/CD automatically deploys to production (if configured)
- Delete the feature branch
- Verify deployment via Control Center
Cross-Reference
- Code Style -- coding conventions
- Testing -- test requirements
- New Feature Checklist -- full feature guide
- CI/CD -- monitoring CI pipeline