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 notes should not include PRs #2083

Merged
merged 3 commits into from
Jun 21, 2024
Merged
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
12 changes: 11 additions & 1 deletion scripts/release_notes_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
'feature request',
'customer success',
]
ISSUE_LABELS_ORDERED_BY_IMPORTANCE = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better to just change the order of ISSUE_LABELS to match what you want, rather than creating a new global variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other one is a different order because when picking which category to assign a label to, I want the order to be different. For example, if an issue is labeled both a feature request and internal, I want it to be only put in the internal category of the release notes. So the order for ISSUE_LABELS is intentionally different

'feature request',
'customer success',
'bug',
'documentation',
'internal',
'maintenance',
]
NEW_LINE = '\n'
GITHUB_URL = 'https://api.github.com/repos/sdv-dev/sdv'
GITHUB_TOKEN = os.getenv('GH_ACCESS_TOKEN')
Expand Down Expand Up @@ -64,6 +72,8 @@ def _get_issues_by_milestone(milestone):
if not issues_on_page:
break

# Filter our PRs
issues_on_page = [issue for issue in issues_on_page if issue.get('pull_request') is None]
issues.extend(issues_on_page)
page += 1

Expand Down Expand Up @@ -102,7 +112,7 @@ def _create_release_notes(issues_by_category, version, date):
title = f'## v{version} - {date}'
release_notes = f'{title}{NEW_LINE}{NEW_LINE}'

for category in ISSUE_LABELS + ['misc']:
for category in ISSUE_LABELS_ORDERED_BY_IMPORTANCE + ['misc']:
issues = issues_by_category.get(category)
if issues:
section_text = (
Expand Down
Loading