nchammas commented on code in PR #58288:
URL: https://github.com/apache/spark/pull/58288#discussion_r3992853035
##########
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:
Nit: Docstring is still a mouthful to me. I would prefer something briefer
and higher level. Not a big deal.
##########
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:
"do not cover" might not be clear to everyone. If I understand the intended
message here, this would be clearer:
> At least one of the values for "Affects Version" must precede the earliest
value for "Fix Version".
--
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]