Skip to content

Commit

Permalink
Update release.py
Browse files Browse the repository at this point in the history
This picks up:

* fix bug links in bugzilla bug description (willkg/socorro-release#38)
* make release.py work with https protocol (willkg/socorro-release#40)
  • Loading branch information
willkg committed Dec 8, 2023
1 parent b0a1aeb commit ddde451
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/license-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""

Expand Down
17 changes: 15 additions & 2 deletions bin/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""

Expand All @@ -27,6 +27,7 @@
import datetime
import json
import os
import re
import shlex
import subprocess
import sys
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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}.")
Expand Down Expand Up @@ -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:
Expand All @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion bin/service-status.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
requires the tomli library.
repo: https://github.com/willkg/socorro-release/
sha: 036f7078ba7991200f7f4fc85742a6ed3dc97b6f
sha: 8c609f3a0934b5f5fc4a954bed4e0c5cce16c429
"""

Expand Down

0 comments on commit ddde451

Please sign in to comment.