Pull Requests - SE701Group2/daily-focus GitHub Wiki
Pull Requests
How it works
Pull requests are a feature that makes it easier for developers to collaborate. They provide a user-friendly web interface for discussing proposed changes before integrating them into the official project.
Pull requests are a mechanism for a developer to notify team members that they have completed a feature. Once their feature branch is ready, the developer files a pull request via their Bitbucket account. This lets everybody involved know that they need to review the code and merge it into the master branch.
But, the pull request is more than just a notification โ itโs a dedicated forum for discussing the proposed feature. If there are any problems with the changes, teammates can post feedback in the pull request and even tweak the feature by pushing follow-up commits. All of this activity is tracked directly inside of the pull request.
Workflow
Creating pull requests
There are two methods to create pull requests:
- Compare and pull request (Recommended)
When pushes are made to a remote forked branch, a notification will appear in the upstream repository - simply click on "Compare & pull request" to create the pull request.
- Manual entry
Alternatively, you can navigate to the "Pull requests" tab in the upstream repository and click on "Create pull request" - this will prompt the user to select which branches to compare.
What to include
Pull request title
Titles for the pull request should follow the following format: DO LATER
Description
Please fill in the template as per follows:
- Issue: Describe the issue the pull request is trying to resolve
- Solution: Describe how the issue was solved in the pull request
- Risk: Note down any potential risks involved with the changes made to the repository
- Reviewed by: Filled in by whoever approves the pull request
Reviews
For a pull request to be approved, there must be at least 2 approving requests in order for the pull request to be merged into the main branch. Reviewers can be requests through the right hand panel of the pull request.
Labels
Attach the relevant labels related to the pull request here.
Linked Issues
Every pull request should be linked to an existing issue - if no suitable issue exists, please create an issue first (see here).
Approving Pull Requests
How to get approval
After creating a pull request:
Send a message to the #pull-requests channel in the Discord.
Include a link to the issue.
Wait for at least 2 thumbs up reacts or comments of approval on your issue indicating you should go ahead with the work.
How to approve
Keep an eye on the #pull-requests channel in the Discord.
Approve the pull request if you think the pull request is good.
Request changes on the pull request if you disagree with the pull request. Leave comments explaining why.
Comment if you think the pull request is incomplete.
Merging
Once the pull request has been approved, please use "Squash and Merge" to merge into the main branch of the repository. By selecting this option, the pull request's commits are squashed into a single commit. Instead of seeing all of a contributor's individual commits from a topic branch, the commits are combined into one commit and merged into the specified branch.