Skip to content

Commit

Permalink
Release release 10.3.0: Fixing release script (#51)
Browse files Browse the repository at this point in the history
Parent issue: sequentech/meta#748

Fixing release script
  • Loading branch information
edulix committed Apr 16, 2024
2 parents 1172f60 + 7487b06 commit 452c979
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion comprehensive_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"sequentech/mixnet",
"sequentech/documentation",
"sequentech/ballot-verifier",
"sequentech/release-tool",
#"sequentech/release-tool",
]

def get_comprehensive_release_notes(
Expand Down
17 changes: 14 additions & 3 deletions release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ def get_github_issue_from_link(link_text, github):
object: A PyGithub object that represents the retrieved Github issue.
"""
# Extracting the owner, repository name, and issue number from the link
owner, repo, _, issue_number = link_text.split("/")[-4:]
if '#' in link_text and not link_text.startswith('https://'):
owner, repo_issue_number = link_text.split("/")
repo, issue_number = repo_issue_number.split("#")
else:
owner, repo, _, issue_number = link_text.split("/")[-4:]

# Getting the repository object
repo = github.get_repo(f"{owner}/{repo}")
Expand Down Expand Up @@ -130,19 +134,26 @@ def get_release_notes(
for commit in compare_branches.commits:
pr = get_commit_pull(commit)
if pr == None:
verbose_print(args, f"[has no PR associated] ignoring commit:\n\tcommit={commit}\n")
continue

title = pr.title.strip()

if any(label.name in config["changelog"]["exclude"]["labels"] for label in pr.labels):
verbose_print(args, f"[has excluded label] ignoring PR:\n\tcommit={commit}\n\tpr.title={title}\n\tpr.url={pr.html_url}\n")
continue

category = get_label_category(pr.labels, config["changelog"]["categories"])
if category is None:
verbose_print(args, f"[has no category] ignoring PR:\n\tcommit={commit}\n\tpr.title={title}\n\tpr.url={pr.html_url}\n")
continue

title = pr.title.strip()
if pr.closed_at is None:
verbose_print(args, f"[PR not closed] ignoring PR:\n\tcommit={commit}\n\tpr.title={title}\n\tpr.url={pr.html_url}\n\n")
continue

if pr.closed_at < cutoff_date:
verbose_print(args, f"[before cut-off date]ignoring PR: {title}: {pr.html_url}\n")
verbose_print(args, f"[before cut-off date] ignoring PR:\n\tcommit={commit}\n\tpr.title={title}\n\tpr.url={pr.html_url}\n")
continue

parent_issue = None
Expand Down

0 comments on commit 452c979

Please sign in to comment.