|
33 | 33 |
|
34 | 34 | try: |
35 | 35 | import jira.client |
36 | | - JIRA_IMPORTED = True |
| 36 | + JIRA_IMPORTED = False |
37 | 37 | except ImportError: |
38 | 38 | JIRA_IMPORTED = False |
39 | 39 |
|
| 40 | +DB_SPARK_REPO = "[email protected]:databricks/spark.git" |
| 41 | + |
40 | 42 | # Location of your Spark git development area |
41 | 43 | SPARK_HOME = os.environ.get("SPARK_HOME", os.getcwd()) |
42 | 44 | # 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" |
44 | 47 | # 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 |
46 | 50 | # ASF JIRA username |
47 | 51 | JIRA_USERNAME = os.environ.get("JIRA_USERNAME", "") |
48 | 52 | # ASF JIRA password |
|
54 | 58 | GITHUB_OAUTH_KEY = os.environ.get("GITHUB_OAUTH_KEY") |
55 | 59 |
|
56 | 60 |
|
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" |
59 | 63 | JIRA_BASE = "https://issues.apache.org/jira/browse" |
60 | 64 | JIRA_API_BASE = "https://issues.apache.org/jira" |
61 | 65 | # Prefix added to temporary branches |
@@ -110,6 +114,11 @@ def clean_up(): |
110 | 114 |
|
111 | 115 | # merge the requested PR and return the merge hash |
112 | 116 | 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 | + |
113 | 122 | pr_branch_name = "%s_MERGE_PR_%s" % (BRANCH_PREFIX, pr_num) |
114 | 123 | target_branch_name = "%s_MERGE_PR_%s_%s" % (BRANCH_PREFIX, pr_num, target_ref.upper()) |
115 | 124 | run_cmd("git fetch %s pull/%s/head:%s" % (PR_REMOTE_NAME, pr_num, pr_branch_name)) |
|
0 commit comments