-
Notifications
You must be signed in to change notification settings - Fork 66
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
fix bug on update_package.py #1162
base: main
Are you sure you want to change the base?
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 | ||||
---|---|---|---|---|---|---|
|
@@ -37,7 +37,10 @@ def get_latest_version(org, project, version): | |||||
print(f"GitHub API response not ok: {response.status_code}") | ||||||
return None | ||||||
latest_version = response.json()["tag_name"] | ||||||
return latest_version | ||||||
if latest_version.startswith('v'): | ||||||
return latest_version.replace('v','',1) | ||||||
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. A bit more elegant 😉
Suggested change
|
||||||
else: | ||||||
return latest_version | ||||||
|
||||||
|
||||||
# Get url response's content hash (SHA256) | ||||||
|
@@ -104,6 +107,7 @@ def update_github_url(package): | |||||
|
||||||
latest_version = None | ||||||
for url, org, project, version in matches: | ||||||
# version excludes `v` from the capturing group in the regex therefore latest_version_match mustn't include `v` if the version starts with `v` | ||||||
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. Can you move this comment (maybe with a bit rewording needed) just before the line |
||||||
latest_version_match = get_latest_version(org, project, version) | ||||||
# No newer version available | ||||||
if (not latest_version_match) or (latest_version_match == version): | ||||||
|
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.
@naacbin introduced the support for packages whose version is preceded by
v
in #1067, but it seems thev
was only taken into account when matching the url in the file and not to get the latest version, so it seems like the fix has never worked.What is really getting me confused is that I see upx being correctly updated by our bot in acec181 before #1067, how is this possible? 🕵️♀️