Skip to content

Commit 9e6be80

Browse files
rxinyhuai
authored andcommitted
Update merge script to always use databricks/spark.
## What changes were proposed in this pull request? This patch updates the merge script to point to databricks/spark with minimum configuration. ## How was this patch tested? This is an infra change. Author: Reynold Xin <[email protected]> Closes apache#40 from rxin/rxin-merge-script.
1 parent e17a76e commit 9e6be80

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

dev/merge_spark_pr.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,20 @@
3333

3434
try:
3535
import jira.client
36-
JIRA_IMPORTED = True
36+
JIRA_IMPORTED = False
3737
except ImportError:
3838
JIRA_IMPORTED = False
3939

40+
DB_SPARK_REPO = "[email protected]:databricks/spark.git"
41+
4042
# Location of your Spark git development area
4143
SPARK_HOME = os.environ.get("SPARK_HOME", os.getcwd())
4244
# Remote name which points to the Gihub site
43-
PR_REMOTE_NAME = os.environ.get("PR_REMOTE_NAME", "apache-github")
45+
# PR_REMOTE_NAME = os.environ.get("PR_REMOTE_NAME", "apache-github")
46+
PR_REMOTE_NAME = "databricks-spark-merge-script-special-remote"
4447
# Remote name which points to Apache git
45-
PUSH_REMOTE_NAME = os.environ.get("PUSH_REMOTE_NAME", "apache")
48+
# PUSH_REMOTE_NAME = os.environ.get("PUSH_REMOTE_NAME", "apache")
49+
PUSH_REMOTE_NAME = PR_REMOTE_NAME
4650
# ASF JIRA username
4751
JIRA_USERNAME = os.environ.get("JIRA_USERNAME", "")
4852
# ASF JIRA password
@@ -54,8 +58,8 @@
5458
GITHUB_OAUTH_KEY = os.environ.get("GITHUB_OAUTH_KEY")
5559

5660

57-
GITHUB_BASE = "https://github.com/apache/spark/pull"
58-
GITHUB_API_BASE = "https://api.github.com/repos/apache/spark"
61+
GITHUB_BASE = "https://github.com/databricks/spark/pull"
62+
GITHUB_API_BASE = "https://api.github.com/repos/databricks/spark"
5963
JIRA_BASE = "https://issues.apache.org/jira/browse"
6064
JIRA_API_BASE = "https://issues.apache.org/jira"
6165
# Prefix added to temporary branches
@@ -110,6 +114,11 @@ def clean_up():
110114

111115
# merge the requested PR and return the merge hash
112116
def merge_pr(pr_num, target_ref, title, body, pr_repo_desc):
117+
remotes = run_cmd("git remote")
118+
if PR_REMOTE_NAME in remotes:
119+
run_cmd("git remote rm %s" % PR_REMOTE_NAME)
120+
run_cmd("git remote add %s %s" % (PR_REMOTE_NAME, DB_SPARK_REPO))
121+
113122
pr_branch_name = "%s_MERGE_PR_%s" % (BRANCH_PREFIX, pr_num)
114123
target_branch_name = "%s_MERGE_PR_%s_%s" % (BRANCH_PREFIX, pr_num, target_ref.upper())
115124
run_cmd("git fetch %s pull/%s/head:%s" % (PR_REMOTE_NAME, pr_num, pr_branch_name))

0 commit comments

Comments
 (0)