Child pages
  • How to merge pull requests
Skip to end of metadata
Go to start of metadata

This section documents the process for reviewing and merging code changes contributed via Github pull requests. It assumes you have a clone of Falcon's Git repository.

falcon_merge_pr.py is a script that automates the process of accepting a code change into the project. It creates a temporary branch from apache/master, squashes the commits in the pull request, rewrites the commit message in the squashed commit to follow a standard format including information about each original commit, merges the squashed commit into the temporary branch, pushes the code to apache/trunk and closes the JIRA ticket. The push will then be mirrored to apache-github/master, which will cause the PR to be closed due to the pattern in the commit message. Note that the script will ask the user before executing remote updates (i.e. git push and closing JIRA ticket), so it can still be used even if the user wants to skip those steps.

Setting Up

1. Add aliases for the remotes expected by the merge script (if you haven't already):

 

git remote add apache https://git-wip-us.apache.org/repos/asf/falcon.git
 
git remote add apache-github https://github.com/apache/falcon.git

 

2. Install jira-python: 

sudo easy_install jira
Merging

Once the pull request is ready to be merged (it has been reviewed, feedback has been addressed, CI build has been successful and the branch merges cleanly into trunk):

1. Set the JIRA_USERNAME and JIRA_PASSWORD environment variables with the appropriate credentials if you intend to ask the script to close the issue associated with the pull request.

2. Run the merge script:

 

python falcon_merge_pr.py

 

3. Answer the questions prompted by the script.

  • No labels