From: Jos Collin Date: Fri, 13 Oct 2017 02:46:08 +0000 (+0530) Subject: ptl-tool: Drop Default Labelling of PRs X-Git-Tag: v13.0.1~537^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=65ddee2c3e5f51288911a56f2041661689f5ab7e;p=ceph.git ptl-tool: Drop Default Labelling of PRs Dropped default labelling of PRs. Allowed --label '', which won't label the PR. The user can omit --label too, if the PR should not be labelled. Signed-off-by: Jos Collin --- diff --git a/src/script/ptl-tool.py b/src/script/ptl-tool.py index dbb81f1835dea..486d3148ce045 100755 --- a/src/script/ptl-tool.py +++ b/src/script/ptl-tool.py @@ -93,7 +93,6 @@ USER = getpass.getuser() with open(expanduser("~/.github.key")) as f: PASSWORD = f.read().strip() BRANCH_PREFIX = "wip-%s-testing-" % USER -TESTING_LABEL = "wip-%s-testing" % USER TESTING_BRANCH_NAME = BRANCH_PREFIX + datetime.datetime.now().strftime("%Y%m%d") SPECIAL_BRANCHES = ('master', 'luminous', 'jewel', 'HEAD') @@ -120,7 +119,7 @@ def build_branch(args): branch = args.branch label = args.label - if label and label != '-': + if label: #Check the label format if re.search(r'\bwip-(.*?)-testing\b', label) is None: log.error("Unknown Label '{lblname}'. Label Format: wip--testing".format(lblname=label)) @@ -253,7 +252,7 @@ def build_branch(args): G.git.merge(c.hexsha, '--no-ff', m=message) - if label and label != '-': + if label: req = requests.post("https://api.github.com/repos/ceph/ceph/issues/{pr}/labels".format(pr=pr), data=json.dumps([label]), auth=(USER, PASSWORD)) if req.status_code != 200: log.error("PR #%d could not be labeled %s: %s" % (pr, label, req)) @@ -286,7 +285,7 @@ def main(): parser = argparse.ArgumentParser(description="Ceph PTL tool") default_base = 'master' default_branch = TESTING_BRANCH_NAME - default_label = TESTING_LABEL + default_label = '' if len(sys.argv) > 1 and sys.argv[1] in SPECIAL_BRANCHES: argv = sys.argv[2:] default_branch = 'HEAD' # Leave HEAD deatched