Skip to content

Commit

Permalink
Remove the unused variable 'no_project_prs.'
Browse files Browse the repository at this point in the history
We won't need the 'no_project_prs' variable because PRs will be added to the CHANGELOG.

Signed-off-by: Tim Liu <[email protected]>
  • Loading branch information
NvTimLiu committed Dec 13, 2024
1 parent cac4b4b commit 5eb3260
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions scripts/generate-changelog
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ query ($after: String, $since: DateTime) {
"""


def process_changelog(resource_type: str, changelog: dict, releases: set, projects: set, no_project_prs: list,
token: str):
def process_changelog(resource_type: str, changelog: dict, releases: set, projects: set, token: str):
if resource_type == PULL_REQUESTS:
items = process_pr(releases=releases, token=token)
time_field = 'mergedAt'
Expand Down Expand Up @@ -313,12 +312,6 @@ def form_subsection(issues: dict, subtitle: str):
return subsection


def print_no_project_pr(no_project_prs: list):
if len(no_project_prs) != 0:
print("\nNOTE: Merged Pull Requests w/o Project:")
for pr in no_project_prs:
print(f"{pr['baseRefName']} #{pr['number']} {pr['title']} {pr['url']}")


def main(rels: str, path: str, token: str):
print('Generating changelog ...')
Expand All @@ -327,25 +320,20 @@ def main(rels: str, path: str, token: str):
changelog = {} # changelog dict
releases = {x.strip() for x in rels.split(',')}
projects = {f"{RELEASE} {rel}" for rel in releases}
no_project_prs = [] # list of merge pr w/o project

print('Processing pull requests ...')
process_changelog(resource_type=PULL_REQUESTS, changelog=changelog,
releases=releases, projects=projects,
no_project_prs=no_project_prs, token=token)
releases=releases, projects=projects, token=token)
print('Processing issues ...')
process_changelog(resource_type=ISSUES, changelog=changelog,
releases=releases, projects=projects,
no_project_prs=no_project_prs, token=token)
releases=releases, projects=projects, token=token)
# form doc
form_changelog(path=path, changelog=changelog)
except Exception as e: # pylint: disable=broad-except
print(e)
sys.exit(1)

print('Done.')
# post action
print_no_project_pr(no_project_prs=no_project_prs)


if __name__ == '__main__':
Expand Down

0 comments on commit 5eb3260

Please sign in to comment.