Code Review & Merge Request Standards

Rationale

Code reviews improve code quality, catch bugs early, and support team learning. They ensure standards are followed and help maintain a healthy codebase.

Code Review Checklist

  • Ensure code follows project standards and best practices.
  • Check for clear naming, formatting, and documentation.
  • Verify tests for new features and bug fixes.
  • Review security, performance, and error handling.
  • Confirm no secrets or sensitive data are committed.
  • Validate deployment steps if relevant.
  • Check for modular, maintainable code structure.
  • Ensure code is self-documenting and uses comments for complex logic.
  • Validate that error handling and edge cases are covered.
  • Confirm that code is free of unused or deprecated dependencies.

Merge Requests

  • Use descriptive titles and summaries for merge requests.
  • Reference related issues or tickets.
  • List changes, motivation, and any follow-up steps.
  • Request review from relevant team members.
  • Address review comments and update code as needed.
  • Use clear, actionable summaries and titles.
  • Link merge requests to related issues or tasks.
  • Delete feature/bugfix branches after merging to keep the repository clean.

Example Merge Request Description:

feat: add user registration form

- Implemented registration form and validation
- Added tests for form and view
- Updated documentation and deployment steps

Best Practices

  • Review code in small, focused changesets.
  • Use automated checks (linting, tests) in CI/CD.
  • Document review process for new team members.
  • Encourage constructive feedback and collaboration.
  • Assign reviewers with relevant expertise.
  • Use labels and milestones to organize and prioritize merge requests.
  • Communicate clearly in review comments and resolve discussions before merging.
  • Use squash and merge for combining many small commits.
  • Review and update code review process as the team grows.