This is an automated email from the ASF dual-hosted git repository.
bowenliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new 875add4b7 [KYUUBI #5152] Check milestone and assignees when merging
pull request
875add4b7 is described below
commit 875add4b79d476c6396b860da1e864e2481d121b
Author: liangbowen <[email protected]>
AuthorDate: Mon Aug 14 09:52:18 2023 +0800
[KYUUBI #5152] Check milestone and assignees when merging pull request
### _Why are the changes needed?_
- Show prompt if milestone or assignees not set when merging pull requests.
<img width="611" alt="image"
src="https://github.com/apache/kyuubi/assets/1935105/4f4df661-14ab-45e4-bcfe-9050549048e6">
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including
negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [x] [Run
test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests)
locally before make a pull request
Closes #5152 from bowenliang123/merge-check.
Closes #5152
3a1731d40 [liangbowen] nit
20eb0e2ad [liangbowen] print
51a268e71 [liangbowen] check and print milestone and assignees of pull
requests
Authored-by: liangbowen <[email protected]>
Signed-off-by: liangbowen <[email protected]>
---
dev/merge_kyuubi_pr.py | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/dev/merge_kyuubi_pr.py b/dev/merge_kyuubi_pr.py
index cb3696d1f..fe8893748 100755
--- a/dev/merge_kyuubi_pr.py
+++ b/dev/merge_kyuubi_pr.py
@@ -30,9 +30,9 @@ import os
import re
import subprocess
import sys
-from urllib.request import urlopen
-from urllib.request import Request
from urllib.error import HTTPError
+from urllib.request import Request
+from urllib.request import urlopen
KYUUBI_HOME = os.environ.get("KYUUBI_HOME", os.getcwd())
PR_REMOTE_NAME = os.environ.get("PR_REMOTE_NAME", "apache")
@@ -248,6 +248,8 @@ def main():
user_login = pr["user"]["login"]
base_ref = pr["head"]["ref"]
pr_repo_desc = "%s/%s" % (user_login, base_ref)
+ assignees = pr["assignees"]
+ milestone = pr["milestone"]
# Merged pull requests don't appear as merged in the GitHub API;
# Instead, they're closed by asfgit.
@@ -276,6 +278,17 @@ def main():
print("\n=== Pull Request #%s ===" % pr_num)
print("title:\t%s\nsource:\t%s\ntarget:\t%s\nurl:\t%s\nbody:\n\n%s" %
(title, pr_repo_desc, target_ref, url, body))
+
+ if assignees is None or len(assignees)==0:
+ continue_maybe("Assignees have NOT been set. Continue?")
+ else:
+ print("assignees: %s" % [assignee["login"] for assignee in assignees])
+
+ if milestone is None:
+ continue_maybe("Milestone has NOT been set. Continue?")
+ else:
+ print("milestone: %s" % milestone["title"])
+
continue_maybe("Proceed with merging pull request #%s?" % pr_num)
merged_refs = [target_ref]