-
Notifications
You must be signed in to change notification settings - Fork 9
ENT-13001: Expand release-information with history of releases.json files #18
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,3 +91,36 @@ def finalize_vcf(versions_dict, checksums_dict, files_dict): | |
| ) | ||
|
|
||
| return versions_dict, checksums_dict, files_dict | ||
|
|
||
|
|
||
| def filter_unstable_releases(data): | ||
| # Filter the data to only include stable releases (not debug, alpha, or beta releases): | ||
| filtered_data = [] | ||
|
|
||
| for release_data in data.get("releases", []): | ||
| if release_data.get("debug") is True: | ||
| continue | ||
| if release_data.get("alpha") is True: | ||
| continue | ||
| if release_data.get("beta") is True: | ||
| continue | ||
|
|
||
| filtered_data.append(release_data) | ||
|
|
||
| return filtered_data | ||
|
Comment on lines
+97
to
+110
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logic is correct but the three if/continue blocks are redundant. They can be collapsed into a single condition. You could also consider using list comprehension which is an idiomatic pattern in Python. |
||
|
|
||
|
|
||
| def sort_release_data(file_checksums_dict): | ||
| # Newest versions first, and files sorted alphabetically within each version | ||
| for v in file_checksums_dict.keys(): | ||
| file_checksums_dict[v] = dict_sorted_by_key(file_checksums_dict[v]) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function mutates its input ( |
||
|
|
||
| sorted_dict = OrderedDict( | ||
| sorted( | ||
| file_checksums_dict.items(), | ||
| key=lambda p: version_as_comparable_list(p[0]), | ||
| reverse=True, | ||
| ) | ||
| ) | ||
|
|
||
| return sorted_dict | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name says "filter unstable" but it's actually returning stable releases. Worth considering a name like
get_stable_releasesorfilter_out_unstable_releasesfor clarity.