Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZOOKEEPER-4212: add committer checklist to zk-merge-pr.py #1610

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions zk-merge-pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ def continue_maybe(prompt):
if result.lower().strip() != "y":
fail("Okay, exiting")

def continue_boolean(prompt):
result = input("\n%s (y/n): " % prompt)
return result.lower().strip() == "y"

def clean_up():
if original_head != get_current_branch():
print("Restoring head pointer to %s" % original_head)
Expand Down Expand Up @@ -395,6 +399,23 @@ def get_remote_repos():
dict[repos[i]] = repos[i+1]
return dict

def ask_committer_checklist():

if continue_boolean("Is this issue a new big feature?"):
continue_maybe("You have verified design and implementation?")

if not continue_boolean("Is this issue a trivial or minor one?"):
continue_maybe("This pull request has been reviewed and approved by two committers?")

if continue_boolean("Is this issue has a performance improvement?"):
continue_maybe("You have verified the provided benchmark?")

if not continue_boolean("CI build status became green(checkstyle,spotbugs,unit cases, etc)?"):
continue_maybe("You have run the whole test suit in the local and all the unit cases have passed?")

continue_maybe("You have verified test coverage?")
continue_maybe("You have verified no typos?")
continue_maybe("You have verified documentation (including upgrade notes)?")

def check_git_remote():
repos = get_remote_repos()
Expand Down Expand Up @@ -504,6 +525,9 @@ def main():
pr_title, commit_title, pr_repo_desc, target_ref, url)))
continue_maybe("Proceed with merging pull request #%s?" % pr_num)

ask_committer_checklist()
print("[FBI WARNING] With great power comes great responsibility!")

merged_refs = [target_ref]

merge_hash = merge_pr(pr_num, target_ref, commit_title, body, pr_repo_desc)
Expand Down