You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by si...@apache.org on 2017/04/18 17:59:39 UTC
bookkeeper git commit: BOOKKEEPER-1039: bk-merge-pr.py ask to run
findbugs and rat before merge
Repository: bookkeeper
Updated Branches:
refs/heads/master f74d07d6b -> de59bd2ad
BOOKKEEPER-1039: bk-merge-pr.py ask to run findbugs and rat before merge
Add the ability to optionally run findbugs and apache RAT before every merge using the PR merge script
Author: eolivelli <eo...@apache.org>
Reviewers: Sijie Guo <si...@apache.org>
Closes #132 from eolivelli/BOOKKEEPER-1039-merge-findbugs
Project: http://git-wip-us.apache.org/repos/asf/bookkeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/bookkeeper/commit/de59bd2a
Tree: http://git-wip-us.apache.org/repos/asf/bookkeeper/tree/de59bd2a
Diff: http://git-wip-us.apache.org/repos/asf/bookkeeper/diff/de59bd2a
Branch: refs/heads/master
Commit: de59bd2ad038428cfa61cfdefe1266f3356e1937
Parents: f74d07d
Author: eolivelli <eo...@apache.org>
Authored: Tue Apr 18 10:59:33 2017 -0700
Committer: Sijie Guo <si...@apache.org>
Committed: Tue Apr 18 10:59:33 2017 -0700
----------------------------------------------------------------------
dev/bk-merge-pr.py | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/bookkeeper/blob/de59bd2a/dev/bk-merge-pr.py
----------------------------------------------------------------------
diff --git a/dev/bk-merge-pr.py b/dev/bk-merge-pr.py
index e3904a8..b59bfc5 100755
--- a/dev/bk-merge-pr.py
+++ b/dev/bk-merge-pr.py
@@ -152,6 +152,15 @@ def merge_pr(pr_num, target_ref, title, body, default_pr_reviewers, pr_repo_desc
else:
continue_maybe("Unit tests execution FAILED. Do you want to continue with the merge anyway?")
+ # Offer to run findbugs and rat before committing
+ result = raw_input('Do you want to validate findbugs and rat after the merge? (y/n): ')
+ if result.lower() == 'y':
+ test_res = subprocess.call('mvn clean install -DskipTests findbugs:check rat:rat'.split())
+ if test_res == 0:
+ print('QA tests execution succeeded')
+ else:
+ continue_maybe("QA tests execution FAILED. Do you want to continue with the merge anyway?")
+
commit_authors = run_cmd(['git', 'log', 'HEAD..%s' % pr_branch_name,
'--pretty=format:%an <%ae>']).split("\n")
distinct_authors = sorted(set(commit_authors),
@@ -412,8 +421,10 @@ def get_reviewers(pr_num):
username = None
useremail = None
user = get_json("%s/users/%s" % (GITHUB_API_URL, reviewer_id))
- useremail = user['email'].strip() if user['email'] or None
- username = user['name'].strip() if user['name'] or useremail
+ if user['email']:
+ useremail = user['email'].strip()
+ if user['name']:
+ username = user['name'].strip()
if username is None:
continue
reviewers_emails.append('{0} <{1}>'.format(username, useremail))