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

Release release 10.3.0: Fixing release script #51

Merged
merged 1 commit into from
Apr 16, 2024
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 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
Loading