diff options
author | Jos Collin <jcollin@redhat.com> | 2017-10-13 04:46:08 +0200 |
---|---|---|
committer | Jos Collin <jcollin@redhat.com> | 2017-10-17 16:50:36 +0200 |
commit | 65ddee2c3e5f51288911a56f2041661689f5ab7e (patch) | |
tree | 16d6aa046b638e6e233cb90018dafb345560a556 /src/script | |
parent | Merge pull request #18231 from batrick/ptl-tool-labeled-prs (diff) | |
download | ceph-65ddee2c3e5f51288911a56f2041661689f5ab7e.tar.xz ceph-65ddee2c3e5f51288911a56f2041661689f5ab7e.zip |
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 <jcollin@redhat.com>
Diffstat (limited to 'src/script')
-rwxr-xr-x | src/script/ptl-tool.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/script/ptl-tool.py b/src/script/ptl-tool.py index dbb81f1835d..486d3148ce0 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-<name>-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 |