Skip to content

Commit 1ea6ed1

Browse files
committed
[SPARK-57795][INFRA][FOLLOWUP] Refine the merge summary comment in merge_spark_pr.py
### What changes were proposed in this pull request? Follow-up to #56917 (SPARK-57795), which added a merge summary comment posted by `merge_spark_pr.py`. This PR refines the format of that comment: 1. Rename the header from `**Merge summary** (posted by `merge_spark_pr.py`):` to `**Merge Summary:**`. 2. Use the full commit SHA in the commit links (previously truncated to 8 characters). The `[:8]` truncation is dropped in `merge_pr` and `_do_cherry_pick`, with `.strip()` added since `run_cmd` does not strip the trailing newline. 3. Move the `merge_spark_pr.py` attribution to a trailing italic line: `*Posted by `merge_spark_pr.py`*`. Example rendered comment: > **Merge Summary:** > - merged into master &lt;full-sha&gt; > - merged into branch-4.x &lt;full-sha&gt; > > *Posted by `merge_spark_pr.py`* ### Why are the changes needed? A cleaner, more readable merge summary comment. Full SHAs are unambiguous and link-stable, and moving the tool attribution to the end keeps the summary itself front and center. ### Does this PR introduce _any_ user-facing change? No. This only affects the developer merge tooling. ### How was this patch tested? Manually verified the generated comment body and confirmed the full SHA is carried through. Existing lint (`ruff`) passes. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (model: claude-opus-4-8) Closes #56923 from zhengruifeng/merge-summary-format-dev6. Authored-by: Ruifeng Zheng <ruifengz@apache.org> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
1 parent 890ce8d commit 1ea6ed1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

dev/merge_spark_pr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ def post_merge_comment(pr_num, merged_commits):
450450
"- merged into %s %s/%s" % (ref, GITHUB_COMMIT_BASE, commit_hash)
451451
for ref, commit_hash in merged_commits
452452
]
453-
body = "**Merge summary** (posted by `merge_spark_pr.py`):\n" + "\n".join(lines)
453+
body = "**Merge Summary:**\n" + "\n".join(lines) + "\n\n*Posted by `merge_spark_pr.py`*"
454454
print("Posting merge comment on PR #%s:\n%s" % (pr_num, body))
455455
if not GITHUB_OAUTH_KEY:
456456
print_error("GITHUB_OAUTH_KEY is not set; skipping the merge comment.")
@@ -560,7 +560,7 @@ def merge_pr(pr_num, target_ref, title, body, pr_repo_desc, pr_author, co_author
560560
clean_up()
561561
print_error("Exception while pushing: %s" % e)
562562

563-
merge_hash = run_cmd("git rev-parse %s" % target_branch_name)[:8]
563+
merge_hash = run_cmd("git rev-parse %s" % target_branch_name).strip()
564564
clean_up()
565565
print("Pull request #%s merged!" % pr_num)
566566
print("Merge hash: %s" % merge_hash)
@@ -594,7 +594,7 @@ def _do_cherry_pick(pr_num, merge_hash, pick_ref):
594594
except Exception as e:
595595
fail("Exception while pushing: %s" % e)
596596

597-
pick_hash = run_cmd("git rev-parse %s" % pick_branch_name)[:8]
597+
pick_hash = run_cmd("git rev-parse %s" % pick_branch_name).strip()
598598
clean_up()
599599

600600
print("Pull request #%s picked into %s!" % (pr_num, pick_ref))

0 commit comments

Comments
 (0)