Yicong-Huang commented on code in PR #58288:
URL: https://github.com/apache/spark/pull/58288#discussion_r3995031677
##########
dev/merge_spark_pr.py:
##########
@@ -1247,6 +1310,65 @@ def reconcile_jira_components(issue, title_components):
jira_ops.update_components(issue, new_names)
+def reconcile_jira_affects_versions(
+ issue, fix_version_names: list[str], affects_available: set[str]
+) -> None:
+ """Prompt the committer to fix the Affects Version/s when they sit above
the fix.
+
+ The Affects Version/s should reach down to the earliest fixed release; the
caller
+ gates on ``fix_precedes_affects`` so this runs only when they do not. The
merge target
+ cannot reveal when the bug was introduced, so nothing is pre-filled: the
committer
+ enters the affected version(s) explicitly (blank leaves them unchanged),
validated
+ against ``affects_available`` (all unarchived versions, since an affected
version may
+ be released). When the issue already lists Affects Version/s, the
committer then
+ chooses to append the entered version(s) (default, so a still-valid
existing version
+ is never dropped silently), overwrite, or keep the field unchanged. The
result is
+ written through ``jira_ops`` so a dry run only logs it.
Review Comment:
ok, trimmed it down to be shorter and higher level.
##########
dev/merge_spark_pr.py:
##########
@@ -1247,6 +1310,65 @@ def reconcile_jira_components(issue, title_components):
jira_ops.update_components(issue, new_names)
+def reconcile_jira_affects_versions(
+ issue, fix_version_names: list[str], affects_available: set[str]
+) -> None:
+ """Prompt the committer to fix the Affects Version/s when they sit above
the fix.
+
+ The Affects Version/s should reach down to the earliest fixed release; the
caller
+ gates on ``fix_precedes_affects`` so this runs only when they do not. The
merge target
+ cannot reveal when the bug was introduced, so nothing is pre-filled: the
committer
+ enters the affected version(s) explicitly (blank leaves them unchanged),
validated
+ against ``affects_available`` (all unarchived versions, since an affected
version may
+ be released). When the issue already lists Affects Version/s, the
committer then
+ chooses to append the entered version(s) (default, so a still-valid
existing version
+ is never dropped silently), overwrite, or keep the field unchanged. The
result is
+ written through ``jira_ops`` so a dry run only logs it.
+ """
+ current_names = [v.name for v in issue.fields.versions]
+ print()
+ print("=" * 80)
+ print(
+ f"JIRA {issue.key} Affects Version/s "
+ f"{current_names if current_names else '(none)'} do not cover the fix "
+ f"version(s) {fix_version_names}; the affected version is likely
wrong."
Review Comment:
ok, reworded to your suggestion.
--
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]