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

[PR #2359/cd7fc140 backport][3.14] Apply a sort prior to the changelog limit #2370

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
1 change: 1 addition & 0 deletions CHANGES/2363.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an edge case with the changelog limit.
3 changes: 3 additions & 0 deletions pulp_rpm/app/metadata_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def process_other_package_element(element):
text = subelement.text
changelogs.append((author, date, text))

# make sure the changelogs are sorted by date
changelogs.sort(key=lambda t: t[1])

if settings.KEEP_CHANGELOG_LIMIT is not None:
# always keep at least one changelog, even if the limit is set to 0
changelog_limit = settings.KEEP_CHANGELOG_LIMIT or 1
Expand Down