Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-6616

kafka-merge-pr.py should use GitHub's REST API to merge

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      The merge script currently squashes the commits in the pull request locally and then merges it to the target branch. It can also cherry-pick it to other branches. The downside is that GitHub doesn't know that the pull request has been merged. As a workaround, the script includes a keyword in the commit message to close the pull request. Since the merged commit is different to the pull request branch, GitHub assumes that the PR was not merged.

      hachikuji suggested that an API may be available that mimics what the GitHub merge button does. And he is correct. Given our recent transition to GitBox, committers have write access to GitHub, so it's feasible to update the merge script to do this. Rough steps:

      1. Replace local squashing and merging with GitHub REST API for merging (https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button)
      2. After the merge, pull changes from target branch and offer the option to cherry-pick to other branches (i.e. the code may have to be updated a little for the rest of the workflow to work).
      3. Remove the code that adds "Closes #1234..." (e.g. "Closes #3917 from ewencp/stage-docs") to the squashed commit message.
      4. Update wiki documentation and code to state that GITHUB_OAUTH_KEY must be set (it's currently optional since we don't rely on any operations that require authentication).
      5. Update wiki documentation to remove the main downside for using the merge script and perhaps to recommend it.

      Wiki documentation: https://cwiki.apache.org/confluence/display/KAFKA/Merging+Github+Pull+Requests

      Attachments

        Activity

          People

            jagsancio Jose Armando Garcia Sancio
            ijuma Ismael Juma
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: