Skip to content

Final Checks Before PR Creation

Antonio edited this page Mar 15, 2024 · 1 revision

Final Checks Before PR Creation

Before submitting a Pull Request (PR), it's crucial to conduct several final checks. These steps ensure your contribution is ready for review, aligns with the project's standards, and integrates seamlessly with the existing code.

Testing Your Code

Thorough testing is fundamental to maintaining high-quality software. Follow these guidelines to ensure your code is robust and ready:

Verify Functionality

  • Test new features or bug fixes under different scenarios to ensure they work as expected.
  • Use manual testing strategies to simulate real-world use cases and edge cases.

Automated Tests

  • Run any existing automated tests (if any) to check that your changes haven't adversely affected the codebase.
  • Add new tests if your changes introduce new functionality or modify existing behaviors. Ensure these tests pass successfully.

Integrating Recent Changes from the Target Branch

Keeping your branch up to date with the target branch (e.g., main or master) minimizes conflicts and ensures compatibility.

Merge Latest Changes

  • Before creating your PR, merge the most recent version of the target branch into your feature or bugfix branch.
  • Use commands like git fetch origin and git merge origin/main to incorporate the latest changes.

Handling Merge Conflicts

Merge conflicts can arise during integration. Address them carefully to preserve code integrity.

Manual Review and Resolution

  • Carefully examine each conflict to understand the discrepancies between the changes.
  • Decide the best course of action to integrate the conflicting changes cohesively.

Collaboration

  • If conflicts involve changes made by another team member, especially in the same code sections, consult with them to resolve the issue.
  • A collaborative approach can help determine which changes should take precedence or how to best merge the differing code.

Following these guidelines before creating your PR ensures that your contributions are of high quality, align with the project's standards, and are ready for a smooth review process.