Skip to content

Commit d1a7c29

Browse files
committed
[MINOR][INFRA] Skip JIRA updates for minor, trivial, and follow-up PRs
### What changes were proposed in this pull request? This PR updates `dev/merge_spark_pr.py` so `update_jira_for_pr` returns without prompting for JIRA updates when the PR title is tagged `[MINOR]`, `[TRIVIAL]`, or `[FOLLOWUP]`. The merge paths now call `update_jira_for_pr` directly and let that function own the skip policy. ### Why are the changes needed? Follow-up PRs can intentionally point at an already-resolved JIRA from the original work. The merge helper should not ask committers to perform JIRA update operations for those follow-up PRs, and the same local policy should also cover minor and trivial PRs. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Not run; this is a small dev tooling change. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex (GPT-5) Closes #58268 from zhengruifeng/dev-merge-followup-jira-dev-1. Authored-by: Ruifeng Zheng <ruifengz@apache.org> Signed-off-by: Ruifeng Zheng <ruifengz@foxmail.com>
1 parent 27579ef commit d1a7c29

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

dev/merge_spark_pr.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,6 +1368,23 @@ def resolve_jira_issues(title, merge_branches, comment, title_components=()):
13681368

13691369

13701370
def update_jira_for_pr(pr_num, title, merge_branches, title_components):
1371+
skip_jira_title_tags = ("MINOR", "TRIVIAL", "FOLLOWUP")
1372+
tags = set(title_components)
1373+
try:
1374+
parsed = Title.parse(title)
1375+
tags.update(parsed.leading)
1376+
tags.update(parsed.components)
1377+
except ValueError:
1378+
pass
1379+
skipped = [tag for tag in skip_jira_title_tags if tag in tags]
1380+
if skipped:
1381+
print()
1382+
print_error(
1383+
"Skipping JIRA operations for PR #%s because title has %s."
1384+
% (pr_num, ", ".join("[%s]" % tag for tag in skipped))
1385+
)
1386+
return
1387+
13711388
# asf_jira is guaranteed to be set here: initialize_jira() fails fast otherwise.
13721389
print()
13731390
continue_maybe("Would you like to update an associated JIRA?")
@@ -1797,7 +1814,6 @@ def main():
17971814
# Normalized PR-title component tags, used later to reconcile JIRA components. Empty for
17981815
# Revert/Reapply PRs, whose titles are kept verbatim and not parsed for components.
17991816
title_components: List[str] = []
1800-
is_minor = False
18011817

18021818
# Revert and Reapply PRs keep their title verbatim.
18031819
if not (is_revert_pr or is_reapply_pr):
@@ -1806,7 +1822,6 @@ def main():
18061822
parsed = Title.parse(title)
18071823
except ValueError as e:
18081824
fail("Malformed PR title: %s" % e)
1809-
is_minor = "MINOR" in parsed.leading
18101825

18111826
# Normalize component tags via the registry and track primary.
18121827
components = []
@@ -1957,8 +1972,7 @@ def main():
19571972
post_merge_comment(pr_num, picked_commits)
19581973
# Backport mode may be the first chance to resolve a JIRA after an interrupted
19591974
# original merge. If it was already resolved, add any newly inferred fix versions.
1960-
if not is_minor:
1961-
update_jira_for_pr(pr_num, title, picked_refs, title_components)
1975+
update_jira_for_pr(pr_num, title, picked_refs, title_components)
19621976
sys.exit(0)
19631977

19641978
if not bool(pr["mergeable"]):
@@ -2076,9 +2090,8 @@ def main():
20762090
# Record every branch that successfully received the change on the PR.
20772091
post_merge_comment(pr_num, merged_commits)
20782092
# This is deliberately in the finally block: once the target branch has been pushed,
2079-
# cancelling a later cherry-pick must not bypass the mandatory JIRA update.
2080-
if not is_minor:
2081-
update_jira_for_pr(pr_num, title, merged_refs, title_components)
2093+
# cancelling a later cherry-pick must not bypass the JIRA update decision.
2094+
update_jira_for_pr(pr_num, title, merged_refs, title_components)
20822095

20832096

20842097
if __name__ == "__main__":

0 commit comments

Comments
 (0)