Skip to content

Commit f9c9d80

Browse files
committed
[SPARK-24929][INFRA] Make merge script don't swallow KeyboardInterrupt
## What changes were proposed in this pull request? If you want to get out of the loop to assign JIRA's user by command+c (KeyboardInterrupt), I am unable to get out. I faced this problem when the user doesn't have a contributor role and I just wanted to cancel and manually take an action to the JIRA. **Before:** ``` JIRA is unassigned, choose assignee [0] todd.chen (Reporter) Enter number of user, or userid, to assign to (blank to leave unassigned):Traceback (most recent call last): File "./dev/merge_spark_pr.py", line 322, in choose_jira_assignee "Enter number of user, or userid, to assign to (blank to leave unassigned):") KeyboardInterrupt Error assigning JIRA, try again (or leave blank and fix manually) JIRA is unassigned, choose assignee [0] todd.chen (Reporter) Enter number of user, or userid, to assign to (blank to leave unassigned):Traceback (most recent call last): File "./dev/merge_spark_pr.py", line 322, in choose_jira_assignee "Enter number of user, or userid, to assign to (blank to leave unassigned):") KeyboardInterrupt ``` **After:** ``` JIRA is unassigned, choose assignee [0] Dongjoon Hyun (Reporter) Enter number of user, or userid to assign to (blank to leave unassigned):Traceback (most recent call last): File "./dev/merge_spark_pr.py", line 322, in choose_jira_assignee "Enter number of user, or userid to assign to (blank to leave unassigned):") KeyboardInterrupt Restoring head pointer to master git checkout master Already on 'master' git branch ``` ## How was this patch tested? I tested this manually (I use my own merging script with few fixes). Author: hyukjinkwon <[email protected]> Closes apache#21880 from HyukjinKwon/key-error.
1 parent dc3713c commit f9c9d80

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dev/merge_spark_pr.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def choose_jira_assignee(issue, asf_jira):
319319
annotations.append("Commentor")
320320
print("[%d] %s (%s)" % (idx, author.displayName, ",".join(annotations)))
321321
raw_assignee = input(
322-
"Enter number of user, or userid, to assign to (blank to leave unassigned):")
322+
"Enter number of user, or userid, to assign to (blank to leave unassigned):")
323323
if raw_assignee == "":
324324
return None
325325
else:
@@ -331,6 +331,8 @@ def choose_jira_assignee(issue, asf_jira):
331331
assignee = asf_jira.user(raw_assignee)
332332
asf_jira.assign_issue(issue.key, assignee.key)
333333
return assignee
334+
except KeyboardInterrupt:
335+
raise
334336
except:
335337
traceback.print_exc()
336338
print("Error assigning JIRA, try again (or leave blank and fix manually)")

0 commit comments

Comments
 (0)