Skip to content

Conversation

@sarutak
Copy link
Member

@sarutak sarutak commented Jul 26, 2025

Description

This PR proposes adding merge_connect_rust_pr.py and PULL_REQUEST_TEMPLATE like the Spark repository does.
These files are brought from Spark repository and tweaked. The diffs are:

  • diff spark-connect-rust/dev/merge_connect_rust_pr.py spark/dev/merge_spark_pr.py
> # Location of your Spark git development area
> SPARK_HOME = os.environ.get("SPARK_HOME", os.getcwd())
65,66c67,68
< GITHUB_BASE = "https://github.com/apache/spark-connect-rust/pull"
< GITHUB_API_BASE = "https://api.github.com/repos/apache/spark-connect-rust"
---
> GITHUB_BASE = "https://github.com/apache/spark/pull"
> GITHUB_API_BASE = "https://api.github.com/repos/apache/spark"
602a605
>     os.chdir(SPARK_HOME)
  • diff spark-connect-rust/.github/PULL_REQUEST_TEMPLATE spark/.github/PULL_REQUEST_TEMPLATE
>   7. If you want to add a new configuration, please read the guideline first for naming configurations in
>      'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
>   8. If you want to add or modify an error type or message, please read the guideline first in
>      'common/utils/src/main/resources/error/README.md'.
44a49
> If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.

I confirmed this script works by:

  1. Changing the script to direct my own repository instead of Apache's one like as follows and push this change to my master branch.
--- a/dev/merge_connect_rust_pr.py
+++ b/dev/merge_connect_rust_pr.py
@@ -43,9 +43,9 @@ except ImportError:
     JIRA_IMPORTED = False
 
 # Remote name which points to the Github site
-PR_REMOTE_NAME = os.environ.get("PR_REMOTE_NAME", "apache-github")
+PR_REMOTE_NAME = os.environ.get("PR_REMOTE_NAME", "sarutak-github")
 # Remote name which points to Apache git
-PUSH_REMOTE_NAME = os.environ.get("PUSH_REMOTE_NAME", "apache")
+PUSH_REMOTE_NAME = os.environ.get("PUSH_REMOTE_NAME", "sarutak")
 # ASF JIRA username
 JIRA_USERNAME = os.environ.get("JIRA_USERNAME", "")
 # ASF JIRA password
@@ -62,8 +62,8 @@ JIRA_ACCESS_TOKEN = os.environ.get("JIRA_ACCESS_TOKEN")
 GITHUB_OAUTH_KEY = os.environ.get("GITHUB_OAUTH_KEY")
 
 
-GITHUB_BASE = "https://github.com/apache/spark-connect-rust/pull"
-GITHUB_API_BASE = "https://api.github.com/repos/apache/spark-connect-rust"
+GITHUB_BASE = "https://github.com/sarutak/spark-connect-rust/pull"
+GITHUB_API_BASE = "https://api.github.com/repos/sarutak/spark-connect-rust"
 JIRA_BASE = "https://issues.apache.org/jira/browse"
 JIRA_API_BASE = "https://issues.apache.org/jira"
 # Prefix added to temporary branches
  1. Create a PR to my master branch
  2. Merge the PR using the script and the PR is automatically closed

The commit log of the change merged by this script is like as follows.

Author: Kousuke Saruta <sarutak@amazon.co.jp>
Date:   Tue Jul 29 01:58:47 2025 +0900

    Add test.txt
    
    ### What changes were proposed in this pull request?
    test
    
    ### Why are the changes needed?
    test
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    test
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No
    
    Closes #3 from sarutak/merge-test-pr.
    
    Authored-by: Kousuke Saruta <sarutak@amazon.co.jp>
    Signed-off-by: Kousuke Saruta <sarutak@amazon.co.jp>

Related Issue(s)

SPARK-52964

@sarutak sarutak force-pushed the add-merge-script branch from b3bd318 to 93691ff Compare July 28, 2025 16:50
@xuanyuanking
Copy link
Member

Thanks @sarutak for this change!
Do we also need to disable the merge button here https://github.com/apache/spark-connect-rust/blob/master/.asf.yaml#L28?

@sarutak
Copy link
Member Author

sarutak commented Aug 7, 2025

@xuanyuanking Thank you for pointing it out. I'll update it.

@sarutak
Copy link
Member Author

sarutak commented Aug 7, 2025

@xuanyuanking I checked the way Spark, spark-connect-swift and spark-connect-go.

These all don't disable the merge button so how about leaving it as it is?

@xuanyuanking
Copy link
Member

@sarutak ah make sense. Then let's just not use the button after merging the merge_script. Thanks for the further check!

@xuanyuanking xuanyuanking merged commit 589ea87 into apache:master Aug 7, 2025
3 checks passed
@sarutak
Copy link
Member Author

sarutak commented Aug 7, 2025

@xuanyuanking Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants