Skip to main content

Pull Request Process

All code changes go through pull requests with CI checks and team review before merging to main.


Branch Naming​

PrefixUse CaseExample
feature/New featuresfeature/add-audience-segments
fix/Bug fixesfix/post-scheduling-timezone
refactor/Code refactoringrefactor/ai-service-cleanup
docs/Documentation changesdocs/update-api-reference
chore/Dependencies, configschore/upgrade-prisma
hotfix/Urgent production fixeshotfix/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)
  • workspaceId field + 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.ts files
  • 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.example updated
  • Default values provided where possible

Commit Messages​

Use conventional commits:

<type>: <description>

[optional body]

[optional footer]
TypeUsage
featNew feature
fixBug fix
refactorCode refactoring (no behavior change)
docsDocumentation only
choreDependencies, configs, CI
testAdding or fixing tests
perfPerformance improvement
styleCode 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)​

CheckCommandMust Pass
Buildnpm run buildYes
Lintnpm run lintYes
Type checknpm run typecheckYes

Code Review Guidelines​

Reviewers should check for:

CategoryWhat to Look For
SecurityWorkspace scoping, auth guards, input validation
PerformanceN+1 queries, unnecessary re-renders, large payloads
TypesProper typing, no any, shared types used
Error handlingAppError thrown for expected cases, errors propagated
TestingCritical paths have test coverage
i18nAll user-facing strings use t()
ConsistencyFollows established patterns in codebase

Merge Strategy​

StrategyWhen
Squash and mergeFeature branches with many small commits
Merge commitLarge features where commit history matters
RebaseNever on shared branches

After Merge​

  1. CI/CD automatically deploys to production (if configured)
  2. Delete the feature branch
  3. Verify deployment via Control Center

Cross-Reference