diff --git a/comprehensive_release_notes.py b/comprehensive_release_notes.py index 01af7cf..7cdf5b5 100644 --- a/comprehensive_release_notes.py +++ b/comprehensive_release_notes.py @@ -38,7 +38,7 @@ "sequentech/mixnet", "sequentech/documentation", "sequentech/ballot-verifier", - "sequentech/release-tool", + #"sequentech/release-tool", ] def get_comprehensive_release_notes( diff --git a/release_notes.py b/release_notes.py index f5cd182..55e0fb1 100644 --- a/release_notes.py +++ b/release_notes.py @@ -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}") @@ -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