You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "HyukjinKwon (via GitHub)" <gi...@apache.org> on 2023/08/11 02:14:06 UTC

[GitHub] [spark] HyukjinKwon commented on a diff in pull request #42429: [SPARK-44760][INFRA] Fix list index out of range for JIRA resolution in merge_spark_pr

HyukjinKwon commented on code in PR #42429:
URL: https://github.com/apache/spark/pull/42429#discussion_r1290833694


##########
dev/merge_spark_pr.py:
##########
@@ -280,14 +271,30 @@ def resolve_jira_issue(merge_branches, comment, default_jira_id=""):
     )
 
     versions = asf_jira.project_versions("SPARK")
+    # Consider only x.y.z, unreleased, unarchived versions
+    versions = [
+        x
+        for x in versions
+        if not x.raw["released"] and not x.raw["archived"] and re.match(r"\d+\.\d+\.\d+", x.name)
+    ]
     versions = sorted(versions, key=lambda x: x.name, reverse=True)
-    versions = list(filter(lambda x: x.raw["released"] is False, versions))
-    # Consider only x.y.z versions
-    versions = list(filter(lambda x: re.match(r"\d+\.\d+\.\d+", x.name), versions))
 
-    default_fix_versions = list(
-        map(lambda x: fix_version_from_branch(x, versions).name, merge_branches)
-    )
+    default_fix_versions = []

Review Comment:
   Actually seems this breaks the script:
   
   ```
   Traceback (most recent call last):
     File "/usr/local/lib/python3.9/site-packages/jira/resources.py", line 222, in __getattr__
       return self[item]  # type: ignore
   TypeError: 'Version' object is not subscriptable
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "/.../spark/./dev/merge_spark_pr.py", line 606, in <module>
       main()
     File "/.../spark/./dev/merge_spark_pr.py", line 590, in main
       resolve_jira_issues(title, merged_refs, jira_comment)
     File "/.../spark/./dev/merge_spark_pr.py", line 397, in resolve_jira_issues
       resolve_jira_issue(merge_branches, comment, jira_id)
     File "/.../spark/./dev/merge_spark_pr.py", line 303, in resolve_jira_issue
       (major, minor, patch) = v.split(".")
     File "/usr/local/lib/python3.9/site-packages/jira/resources.py", line 227, in __getattr__
       raise AttributeError(
   AttributeError: <class 'jira.resources.Version'> object has no attribute 'split' ('Version' object is not subscriptable)
   ```
   
   The reason seems that `default_fix_versions` has to be `Version` instance, and you should get the version from it via `.name`.
   
   I am reverting this for now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org