You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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

kafka-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/trunk, 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/trunk, 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 (ie 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/kafka.git

  git remote add apache-github https://github.com/apache/kafka.git

2. Install jira-python: 

sudo easy_install jira
Merging

Once the pull request is ready to be merged:

  1. It has been reviewed and feedback has been addressed.
  2. The branch merges cleanly to trunk. If the branch merges cleanly to a stable branch, the code hasn't diverged and the committer deems it safe, it's OK to cherry-pick to a stable branch via the merge script. Otherwise, a separate PR should be submitted for the backport so that it can be reviewed and tested.
  3. Unit and integration tests have passed via the automated PR builds.
  4. System tests have passed, if applicable. For non trivial changes, we recommend running the system tests via https://jenkins.confluent.io/job/system-test-kafka-branch-builder/ before merging the PR. This is a manual process at the moment and it would be good to automate it in the future.

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 kafka-merge-pr.py

3. Answer the questions prompted by the script.

  • No labels