Merge Requests

Merge requests (or pull requests) serve as a formal request for your code to be reviewed and merged.

Before creating a merge request, you should rebase your branch against the branch that you’re intending to merge into.

Merge Request into dev

For a merge request to merge a feature or bugfix branch into dev, your merge request should only contain changes for the specific ticket that you have worked on.

Contents

  • Title: [<issue tracker ID>] <short summmary of issue>
  • Description: be as detailed as possible
    • highlight related files and group them into problems that are being solved
    • highlight the files that should be reviewed first
    • give reasoning for changes

Comments

  • use comments to point out noteworthy changes, for example:
    • simply re-indented lines in 1 file
    • unsure if there’s a better way to write a specific segment of code
    • some lines of code that may require more attention from reviewer (e.g. authentication related changes)

If you find yourself explaining the code with merge request comments, make those comments in code instead.

Note that the reviewer would not have the same context of your task and solution that you do. It is important to give as much context as possible.

Merge Request into UAT or production

For a merge request to merge a staging branch into UAT or production, your merge request is likely to contain many changes that have already been reviewed previously.

Contents

  • Title: [<environment>] <tag version> (e.g. [UAT] v0.1.1)
  • Description: list out all the tickets that are supposed to be included in the deployment
    • along with the ticket, add a link to the merge request for the ticket

Summary

  • DO rebase your feature or bugfix branch before pushing and creating a merge request
  • DO give details on what changes your merge request contains and why
  • DO NOT squash commits on merging, especially to UAT or production branches