Skip to content

Commit ae08387

Browse files
committed
[SPARK-28616][INFRA] Improve merge-spark-pr script to warn WIP PRs and strip trailing dots
## What changes were proposed in this pull request? This PR aims to improve the `merge-spark-pr` script in the following two ways. 1. `[WIP]` is useful when we show that a PR is not ready for merge. Apache Spark allows merging `WIP` PRs. However, sometime, we accidentally forgot to clean up the title for the completed PRs. We had better warn once more during merging stage and get a confirmation from the committers. 2. We have two kinds of PR titles in terms of the ending period. This PR aims to remove the trailing `dot` since the shorter is the better in the commit title. Also, the PR titles without the trailing `dot` is dominant in the Apache Spark commit logs. ``` $ git log --oneline | grep '[.]$' | wc -l 4090 $ git log --oneline | grep '[^.]$' | wc -l 20747 ``` ## How was this patch tested? Manual. ``` $ dev/merge_spark_pr.py git rev-parse --abbrev-ref HEAD Which pull request would you like to merge? (e.g. 34): 25157 The PR title has `[WIP]`: [WIP][SPARK-28396][SQL] Add PathCatalog for data source V2 Continue? (y/n): ``` ``` $ dev/merge_spark_pr.py git rev-parse --abbrev-ref HEAD Which pull request would you like to merge? (e.g. 34): 25304 I've re-written the title as follows to match the standard format: Original: [SPARK-28570][CORE][SHUFFLE] Make UnsafeShuffleWriter use the new API. Modified: [SPARK-28570][CORE][SHUFFLE] Make UnsafeShuffleWriter use the new API Would you like to use the modified title? (y/n): ``` Closes #25356 from dongjoon-hyun/SPARK-28616. Authored-by: Dongjoon Hyun <dhyun@apple.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
1 parent 21a18c6 commit ae08387

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dev/merge_spark_pr.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,13 @@ def main():
473473

474474
url = pr["url"]
475475

476+
# Warn if the PR is WIP
477+
if "[WIP]" in pr["title"]:
478+
msg = "The PR title has `[WIP]`:\n%s\nContinue?" % pr["title"]
479+
continue_maybe(msg)
480+
476481
# Decide whether to use the modified title or not
477-
modified_title = standardize_jira_ref(pr["title"])
482+
modified_title = standardize_jira_ref(pr["title"]).rstrip(".")
478483
if modified_title != pr["title"]:
479484
print("I've re-written the title as follows to match the standard format:")
480485
print("Original: %s" % pr["title"])

0 commit comments

Comments
 (0)