diff --git a/bin/license-check.py b/bin/license-check.py index faf90cc1..1d7067cf 100755 --- a/bin/license-check.py +++ b/bin/license-check.py @@ -12,7 +12,7 @@ See https://github.com/willkg/socorro-release/#readme for details. repo: https://github.com/willkg/socorro-release/ -sha: 036f7078ba7991200f7f4fc85742a6ed3dc97b6f +sha: 8c609f3a0934b5f5fc4a954bed4e0c5cce16c429 """ diff --git a/bin/release.py b/bin/release.py index fd925e3d..e21874a5 100755 --- a/bin/release.py +++ b/bin/release.py @@ -18,7 +18,7 @@ See https://github.com/willkg/socorro-release/#readme for details. repo: https://github.com/willkg/socorro-release/ -sha: 036f7078ba7991200f7f4fc85742a6ed3dc97b6f +sha: 8c609f3a0934b5f5fc4a954bed4e0c5cce16c429 """ @@ -27,6 +27,7 @@ import datetime import json import os +import re import shlex import subprocess import sys @@ -97,6 +98,7 @@ def get_config(): if config_data: for key, default_val in my_config.items(): my_config[key] = config_data.get(key, default_val) + return my_config if os.path.exists("setup.cfg"): config = configparser.ConfigParser() @@ -153,9 +155,15 @@ def get_remote_name(github_user): # Figure out remote to push tag to remote_output = check_output("git remote -v") + def check_ssh(github_user, remote_url): + return f":{github_user}/" in remote_url + + def check_https(github_user, remote_url): + return f"/{github_user}/" in remote_url + for line in remote_output.splitlines(): line = line.split("\t") - if f":{github_user}/" in line[1]: + if check_ssh(github_user, line[1]) or check_https(github_user, line[1]): return line[0] raise Exception(f"Can't figure out remote name for {github_user}.") @@ -343,6 +351,7 @@ def run(): resp = fetch_history_from_github(github_user, github_project, first_commit) commits_since_tag = [] + bug_name_prefix_regexp = re.compile(r"bug-([\d]+)", re.IGNORECASE) for commit in resp["commits"]: # Skip merge commits if len(commit["parents"]) > 1: @@ -356,6 +365,10 @@ def run(): summary = commit["commit"]["message"] summary = summary.splitlines()[0] summary = summary[:80] + # Bug 1868455: While GitHub autolinking doesn't suport spaces, Bugzilla autolinking + # doesn't support hyphens. + if args.cmd == "make-bug": + summary = bug_name_prefix_regexp.sub(r"bug \1", summary) # Figure out who did the commit prefering GitHub usernames who = commit["author"] diff --git a/bin/service-status.py b/bin/service-status.py index e9cdaa6b..d159034e 100755 --- a/bin/service-status.py +++ b/bin/service-status.py @@ -16,7 +16,7 @@ requires the tomli library. repo: https://github.com/willkg/socorro-release/ -sha: 036f7078ba7991200f7f4fc85742a6ed3dc97b6f +sha: 8c609f3a0934b5f5fc4a954bed4e0c5cce16c429 """