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

Generate the CHANGELOG based on the PR's target branch [skip ci] #11867

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Changes from 1 commit
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
12 changes: 8 additions & 4 deletions scripts/generate-changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

# Copyright (c) 2020-2023, NVIDIA CORPORATION.
# Copyright (c) 2020-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -183,9 +183,13 @@ def process_changelog(resource_type: str, changelog: dict, releases: set, projec
if resource_type == PULL_REQUESTS:
if '[bot]' in item['title']:
continue # skip auto-gen PR
no_project_prs.append(item)
continue
project = item['projectCards']['nodes'][0]['project']['name']
# Obtain the version from the PR's target branch, e.g. branch-x.y --> x.y
ver = item['baseRefName'].replace('branch-', '')
project = f"{RELEASE} {ver}"
else:
continue
else:
Copy link
Collaborator

@pxLi pxLi Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this should be safe to be removed, as it was trying make the script compatible for classic projects which had been gone for a long time. its also fine we could still leave it here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree; removing compatibility with project cards simplifies the logic."

project = item['projectCards']['nodes'][0]['project']['name']
else:
ver = item["projectItems"]["nodes"][0]['roadmap']['name']
project = f"{RELEASE} {ver}"
Expand Down
Loading