Lishu Gupta 2018
Lishu Gupta

WritingDevelopment

Checklist for a Perfect Merge Request

A comprehensive checklist and best practices to ensure your merge requests are clean, maintainable, and easy to review.

The year of commits up to this post

A well-prepared merge request (MR) streamlines code review, improves quality, and helps teams ship faster. Use this checklist to ensure your MR is thorough, maintainable, and easy for reviewers to approve.


Before Starting on the Story

  • Review and understand the story requirements and acceptance criteria.
  • Ensure the local development environment is correctly set up.
  • Plan test cases for edge cases and negative scenarios.
  • Check for feature flags if needed.

During the Story

  • Follow coding standards and best practices for the repository (naming conventions, formatting).
  • Ensure type safety (if using TypeScript).
  • Implement proper error handling and handle edge cases.
  • Write unit and integration tests as you implement features.
  • Clean up unused code, console logs, and optimize imports.
  • Implement meaningful comments where necessary (avoid self-explanatory comments).
  • Point out outdated code and provide suggestions where applicable.
  • Reference environment variables instead of hardcoding sensitive/configurable values.

Best Practices

  • Use Enums wherever possible.
  • No static values—use CONST where possible.
  • Follow naming conventions:
    code
    camelCase
    for variables,
    code
    PascalCase
    for classes,
    code
    UPPER_SNAKE_CASE
    for constants (check repo conventions).
  • Add proper logs/audits to functions.
  • Apply SOLID principles for maintainable, scalable code.
  • Ensure variable and function names clearly indicate their purpose.
  • Break down large code blocks into smaller, reusable functions/modules.
  • Keep functions pure where possible (no side effects).
  • Avoid unnecessary computations; use efficient algorithms/data structures.
  • Refactor deeply nested code for readability and reduced complexity.
  • Write meaningful commit messages to track changes.
  • Store config values (API keys, DB URLs, etc.) in environment variables.
  • Avoid code duplication by extracting reusable logic.

After the Story

  • Run and verify all tests (unit, integration, end-to-end) for positive and negative cases.
  • Ensure code is cross-browser and mobile-compatible (for frontend changes).
  • Update relevant documentation (README, API docs, comments).
  • Check for vulnerabilities and follow security best practices.
  • Rebase and resolve conflicts; ensure branch is up-to-date with main/relevant branch.
  • Ensure feature flags (if implemented) function correctly for controlled rollout.
  • Conduct final manual testing to ensure real-world functionality.
  • Add mocks, requests, responses, screenshots, descriptions, references, videos, etc., to the MR for easier review.
  • Squash commits if required by the workflow.

FAQ


Conclusion

A perfect merge request is well-tested, maintainable, and easy to review. By following this checklist, you help your team ship high-quality code and improve collaboration.


Tags: merge request, pull request, code review, devops, best practices, workflow

Related posts

Agentic AI in 2025: From Hype to ProductionAPI Versioning Strategies: How to Maintain Backward Compatibility