Yicong-Huang commented on code in PR #58198:
URL: https://github.com/apache/spark/pull/58198#discussion_r3851057773
##########
dev/merge_spark_pr.py:
##########
@@ -548,12 +583,39 @@ def fail(msg):
sys.exit(-1)
-def run_cmd(cmd):
- print(cmd)
- if isinstance(cmd, list):
- return subprocess.check_output(cmd).decode("utf-8")
- else:
- return subprocess.check_output(cmd.split(" ")).decode("utf-8")
+class Git:
+ """Runs git for the merge script -- the single seam for all git I/O.
Review Comment:
Good point, thanks. I narrowed the docstring to the merge/backport flow and
noted that check_script_up_to_date() calls git merge-base directly, so it no
longer implies this client covers every git invocation.
##########
dev/merge_spark_pr.py:
##########
@@ -1312,23 +1350,99 @@ def choose_jira_assignee(issue):
print("Error assigning JIRA, try again (or leave blank and fix
manually)")
-def grant_contributor_role(user: str):
- role = asf_jira.project_role("SPARK", 10010)
- role.add_user(user)
- print("Successfully added user '%s' to contributors role" % user)
-
+class Jira:
+ """ASF JIRA writes used by the merge script -- the single seam for JIRA
mutations.
-def assign_issue(issue: int, assignee: str) -> bool:
- """
- Assign an issue to a user, which is a shorthand for
jira.client.JIRA.assign_issue.
- The original one has an issue that it will search users again and only
choose the assignee
- from 20 candidates. If it's unmatched, it picks the head blindly. In our
case, the assignee
- is already resolved.
+ Reads stay on the module-level asf_jira client; only the writes
(components, fix versions,
Review Comment:
You're right, thanks. Reworded it to say the pre-write lookups stay on
asf_jira, and to call out that add_fix_versions and resolve_issue read the
issue back after writing (with DryRunJira skipping both the write and that
read-back).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]