[ 
https://issues.apache.org/jira/browse/ARROW-587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16220605#comment-16220605
 ] 

ASF GitHub Bot commented on ARROW-587:
--------------------------------------

wesm closed pull request #1248: ARROW-587: Add fix version to PR merge tool 
URL: https://github.com/apache/arrow/pull/1248
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/dev/merge_arrow_pr.py b/dev/merge_arrow_pr.py
index 99ccc4339..6c0e66376 100755
--- a/dev/merge_arrow_pr.py
+++ b/dev/merge_arrow_pr.py
@@ -257,11 +257,47 @@ def resolve_jira(title, merge_branches, comment):
     print("summary\t\t%s\nassignee\t%s\nstatus\t\t%s\nurl\t\t%s/%s\n"
           % (cur_summary, cur_assignee, cur_status, JIRA_BASE, jira_id))
 
+    jira_fix_versions = _get_fix_version(asf_jira, merge_branches)
+
     resolve = [x for x in asf_jira.transitions(jira_id)
                if x['name'] == "Resolve Issue"][0]
-    asf_jira.transition_issue(jira_id, resolve["id"], comment=comment)
-
-    print("Succesfully resolved %s!" % (jira_id))
+    asf_jira.transition_issue(jira_id, resolve["id"], comment=comment,
+                              fixVersions=jira_fix_versions)
+
+    print("Successfully resolved %s!" % (jira_id))
+
+
+def _get_fix_version(asf_jira, merge_branches):
+    versions = asf_jira.project_versions("ARROW")
+    versions = sorted(versions, key=lambda x: x.name, reverse=True)
+    versions = [x for x in versions if not x.raw['released']]
+
+    default_fix_versions = [fix_version_from_branch(x, versions).name
+                            for x in merge_branches]
+    for v in default_fix_versions:
+        # Handles the case where we have forked a release branch but not yet
+        # made the release.  In this case, if the PR is committed to the master
+        # branch and the release branch, we only consider the release branch to
+        # be the fix version. E.g. it is not valid to have both 1.1.0 and 1.0.0
+        # as fix versions.
+        (major, minor, patch) = v.split(".")
+        if patch == "0":
+            previous = "%s.%s.%s" % (major, int(minor) - 1, 0)
+            if previous in default_fix_versions:
+                default_fix_versions = [x for x in default_fix_versions
+                                        if x != v]
+    default_fix_versions = ",".join(default_fix_versions)
+
+    fix_versions = input("Enter comma-separated fix version(s) [%s]: "
+                         % default_fix_versions)
+    if fix_versions == "":
+        fix_versions = default_fix_versions
+    fix_versions = fix_versions.replace(" ", "").split(",")
+
+    def get_version_json(version_str):
+        return [x for x in versions if x.name == version_str][0].raw
+
+    return [get_version_json(v) for v in fix_versions]
 
 
 if not JIRA_USERNAME:


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add JIRA fix version to merge tool
> ----------------------------------
>
>                 Key: ARROW-587
>                 URL: https://issues.apache.org/jira/browse/ARROW-587
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: Python
>            Reporter: Wes McKinney
>            Assignee: Wes McKinney
>              Labels: pull-request-available
>             Fix For: 0.8.0
>
>
> Like parquet-mr's tool. This will make releases less painful



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to