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

fix bug on update_package.py #1162

Merged
merged 1 commit into from
Nov 22, 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
6 changes: 5 additions & 1 deletion scripts/utils/update_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ 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
# version excludes `v` from the capturing group in the regex in update_github_url therefore latest_version_match mustn't include `v` if the version starts with `v`. Otherwise the github URL would replace the version without the `v` with the github version tag with the `v` which will result in the wrong URL such as: https://github.com/jstrosch/sclauncher/releases/download/vv0.0.6/sclauncher.exe
if latest_version.startswith('v'):
Copy link
Member

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 the v 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? 🕵️‍♀️

Copy link
Member

Choose a reason for hiding this comment

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

I still don't understand how it could work in acec181, but I think the change should fix the issue, so I think we can merge it. But I would still be interested in understanding how this broke, so please if someone (maybe @naacbin) has any clue let me know!

return latest_version[1:]
else:
return latest_version


# Get url response's content hash (SHA256)
Expand Down
Loading