mirror of https://github.com/apache/kafka.git
Support overriding of commit message title in kafka-merge-pr.py
This commit is contained in:
parent
23a36eb549
commit
e042242734
|
@ -380,22 +380,24 @@ def main():
|
||||||
|
|
||||||
url = pr["url"]
|
url = pr["url"]
|
||||||
|
|
||||||
|
pr_title = pr["title"]
|
||||||
|
commit_title = raw_input("Commit title [%s]: " % pr_title)
|
||||||
|
if commit_title == "":
|
||||||
|
commit_title = pr_title
|
||||||
|
|
||||||
# Decide whether to use the modified title or not
|
# Decide whether to use the modified title or not
|
||||||
modified_title = standardize_jira_ref(pr["title"])
|
modified_title = standardize_jira_ref(commit_title)
|
||||||
if modified_title != pr["title"]:
|
if modified_title != commit_title:
|
||||||
print "I've re-written the title as follows to match the standard format:"
|
print "I've re-written the title as follows to match the standard format:"
|
||||||
print "Original: %s" % pr["title"]
|
print "Original: %s" % commit_title
|
||||||
print "Modified: %s" % modified_title
|
print "Modified: %s" % modified_title
|
||||||
result = raw_input("Would you like to use the modified title? (y/n): ")
|
result = raw_input("Would you like to use the modified title? (y/n): ")
|
||||||
if result.lower() == "y":
|
if result.lower() == "y":
|
||||||
title = modified_title
|
commit_title = modified_title
|
||||||
print "Using modified title:"
|
print "Using modified title:"
|
||||||
else:
|
else:
|
||||||
title = pr["title"]
|
|
||||||
print "Using original title:"
|
print "Using original title:"
|
||||||
print title
|
print commit_title
|
||||||
else:
|
|
||||||
title = pr["title"]
|
|
||||||
|
|
||||||
body = pr["body"]
|
body = pr["body"]
|
||||||
target_ref = pr["base"]["ref"]
|
target_ref = pr["base"]["ref"]
|
||||||
|
@ -428,13 +430,13 @@ def main():
|
||||||
continue_maybe(msg)
|
continue_maybe(msg)
|
||||||
|
|
||||||
print ("\n=== Pull Request #%s ===" % pr_num)
|
print ("\n=== Pull Request #%s ===" % pr_num)
|
||||||
print ("title\t%s\nsource\t%s\ntarget\t%s\nurl\t%s" % (
|
print ("PR title\t%s\nCommit title\t%s\nSource\t\t%s\nTarget\t\t%s\nURL\t\t%s" % (
|
||||||
title, pr_repo_desc, target_ref, url))
|
pr_title, commit_title, pr_repo_desc, target_ref, url))
|
||||||
continue_maybe("Proceed with merging pull request #%s?" % pr_num)
|
continue_maybe("Proceed with merging pull request #%s?" % pr_num)
|
||||||
|
|
||||||
merged_refs = [target_ref]
|
merged_refs = [target_ref]
|
||||||
|
|
||||||
merge_hash = merge_pr(pr_num, target_ref, title, body, pr_repo_desc)
|
merge_hash = merge_pr(pr_num, target_ref, commit_title, body, pr_repo_desc)
|
||||||
|
|
||||||
pick_prompt = "Would you like to pick %s into another branch?" % merge_hash
|
pick_prompt = "Would you like to pick %s into another branch?" % merge_hash
|
||||||
while raw_input("\n%s (y/n): " % pick_prompt).lower() == "y":
|
while raw_input("\n%s (y/n): " % pick_prompt).lower() == "y":
|
||||||
|
@ -444,7 +446,7 @@ def main():
|
||||||
if JIRA_USERNAME and JIRA_PASSWORD:
|
if JIRA_USERNAME and JIRA_PASSWORD:
|
||||||
continue_maybe("Would you like to update an associated JIRA?")
|
continue_maybe("Would you like to update an associated JIRA?")
|
||||||
jira_comment = "Issue resolved by pull request %s\n[%s/%s]" % (pr_num, GITHUB_BASE, pr_num)
|
jira_comment = "Issue resolved by pull request %s\n[%s/%s]" % (pr_num, GITHUB_BASE, pr_num)
|
||||||
resolve_jira_issues(title, merged_refs, jira_comment)
|
resolve_jira_issues(commit_title, merged_refs, jira_comment)
|
||||||
else:
|
else:
|
||||||
print "JIRA_USERNAME and JIRA_PASSWORD not set"
|
print "JIRA_USERNAME and JIRA_PASSWORD not set"
|
||||||
print "Exiting without trying to close the associated JIRA."
|
print "Exiting without trying to close the associated JIRA."
|
||||||
|
|
Loading…
Reference in New Issue