General Code Review Guidelines

General code review rules applicable across all teams and tech stacks

👤 Ritu Kataria

Code Review Guidelines - General

This document contains general code review rules applicable across all teams and tech stacks.


Part 1: Review Process Workflow


Part 2: Issue Severity Classification

SeverityDefinitionActionExamples
🔴 CriticalSecurity risk, data loss, production breakBlock mergeSQL injection, exposed secrets, missing auth
🟠 MajorViolates architecture, significant bugsBlock mergeMissing base class inheritance, N+1 queries, no tests
🟡 MinorStyle violations, minor improvementsRequest change, can merge after fixNaming inconsistency, missing docstring
🔵 SuggestionNice-to-have, refactoring ideasComment only, don't blockAlternative approach, future improvement

Part 3: Approval Requirements

Change TypeMinimum ReviewersSenior Approval Required
Bug fix (small)1No
Feature (new)2Yes
Database/Migration changes2Yes (mandatory)
Security-related2Yes (mandatory)
Core/Shared utilities2Yes (mandatory)
Hotfix (production)1Yes (post-merge review)

Part 4: PR Template

## Summary
<!-- What does this PR do and why? -->

## Type of Change
- [ ] Bug fix (non-breaking change fixing an issue)
- [ ] New feature (non-breaking change adding functionality)
- [ ] Breaking change (fix or feature causing existing functionality to change)
- [ ] Refactor (code change that neither fixes a bug nor adds a feature)
- [ ] Documentation update

## Related Ticket
<!-- Link to Jira/Linear ticket -->

## Testing Performed
<!-- Describe the tests you ran -->
- [ ] Manual testing completed
- [ ] Tested on local environment

## Screenshots (if UI changes)
<!-- Add screenshots here -->

## Breaking Changes
<!-- List any breaking changes and migration steps -->

## Developer Checklist
- [ ] Pre-commit hooks pass
- [ ] Self-review of code completed
- [ ] No debug code or print statements
- [ ] Module owner added as reviewer (if applicable)

Part 5: Review Comment Guidelines

Comment Format

Use prefixes to indicate severity:

  • [CRITICAL] - Must fix before merge
  • [MAJOR] - Should fix before merge
  • [MINOR] - Nice to fix, can merge after
  • [SUGGESTION] - Optional improvement
  • [QUESTION] - Seeking clarification
  • [PRAISE] - Positive feedback

Example Comments

Good:

[MAJOR] This query inside the loop will cause N+1 issues.
Consider using eager loading on line 45.

Bad:

Fix this.

Response SLAs

PR SizeInitial ReviewRe-review
Small (<100 lines)4 hours2 hours
Medium (100-500 lines)8 hours4 hours
Large (>500 lines)24 hours8 hours

Part 6: Reviewer Assignment Rules

Weekly Rotating Review Group

A rotating group of 3-4 engineers is assigned weekly to handle PR reviews:

RuleDescription
Group Size3-4 engineers per week
RotationChanges every Monday
Team RepresentationAt least one member from each team for fair representation
Notification Channel#eng-pr-reviews Slack channel
ResponsibilityGroup ensures all assigned PRs are reviewed and merged

Weekly Rotation Schedule Example:

Week 1: @dev-A (Team Alpha), @dev-B (Team Beta), @dev-C (Team Gamma)
Week 2: @dev-D (Team Alpha), @dev-E (Team Beta), @dev-F (Team Gamma)
Week 3: @dev-G (Team Alpha), @dev-H (Team Beta), @dev-I (Team Gamma)
... (continues rotating)

Module Owner Requirement (Developer Responsibility)

Important

Adding the module owner as a reviewer is the developer's sole responsibility.

Developers MUST add the relevant module owner to their PR based on the areas of code changed.

If the developer fails to add the module owner:

  • The developer is solely responsible for any issues that arise
  • PRs may be reverted if module owner review was skipped
  • Repeated violations will be flagged in performance reviews

Review Assignment Checklist (for Developers)

Before requesting review, ensure:
- [ ] At least 1 reviewer from the weekly rotating group is added
- [ ] Module owner is added (if applicable to changed areas)
- [ ] Posted PR link in #eng-pr-reviews channel

General Rules

  1. Author cannot approve: Developer cannot approve their own PR
  2. Escalation: If no review within SLA, post reminder in #eng-pr-reviews
  3. Blocking reviews: Module owner approval is required for merge (when applicable)
  4. Load balancing: Rotating group helps distribute review load fairly

Part 7: Pre-Submission Checklist (All Teams)

#CheckVerification
1Pre-commit hooks passMust show all green
2Tests added/updatedNew features require tests; bug fixes require regression tests
3Self-review completedRead your own diff line-by-line before submission
4No debug codeRemove print(), console.log(), debugger, commented code
5Documentation updatedDocstrings/comments for new classes/complex methods

PR Title Format

[TYPE] Brief description where TYPE = FEAT, FIX, REFACTOR, DOCS, TEST, CHORE

Required PR Sections

  • Summary (what and why)
  • Type of change
  • Testing performed
  • Related ticket/issue link
  • Checklist confirmation
  • Dependent PRs if any
  • Dependent SQL Queries if any

On this page