Skip to content

Mohcin Bounouara

Thoughts about software engineering and life

Create a good pull request

As a software developer throughout my career, I’ve learned many things from several mistakes, one of which is related to creating effective pull requests. Here are some steps to provide a well-structured pull request that simplifies the review process:

1. Break Down Large Tasks: If you’re dealing with a large task that requires extensive changes across multiple files, consider requesting to split it into smaller, more manageable tickets. This promotes a more focused and efficient review process.

2. Explain Changes and Motivations: When making modifications, whether to functions, classes, or properties, always include a clear description of what you changed and why you made those changes. Understanding the rationale behind your changes helps reviewers provide more meaningful feedback.

3. Justify Refactoring Efforts: If you perform code refactoring, ensure you communicate the necessity of these changes. Explain why the refactoring was needed and how it benefits the codebase in terms of maintainability, performance, or other relevant aspects.

4. Document UI/UX: When you alter user interface (UI) or user experience (UX) elements, provide a detailed explanation of the reasons behind these adjustments. Additionally, attach before-and-after screenshots to visually illustrate the changes and their impact.

5. Clarify Database Changes: If you modify database migrations, it’s essential to explain why these changes were required. Be sure to mention if there are related table relationships or adjustments needed elsewhere, such as in the API.

6. Include Tests: Prior to submitting a pull request, write unit tests or end-to-end tests for the code changes you’ve made. Ensure that these tests pass locally, demonstrating the correctness and reliability of your modifications.

7. Communicate Delays: If your pull request requires more time for completion or if you encounter unexpected delays, communicate this with your team or project manager to manage expectations effectively.

By following these steps, you’ll not only enhance the quality of your pull requests but also facilitate a smoother and more effective collaboration with your team.