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

Update release.py #110

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
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
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