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 arm64 error at google/versions #39

Merged
merged 1 commit into from
Jun 28, 2024
Merged

Fix arm64 error at google/versions #39

merged 1 commit into from
Jun 28, 2024

Conversation

F-X64
Copy link
Member

@F-X64 F-X64 commented Jun 28, 2024

Behavior
When accessing /google/versions an error is thrown

  web-1  |   File "/code/cid/main.py", line 86, in google_versions
  web-1  |     return crud.find_available_google_versions(db)
  web-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  web-1  |   File "/code/cid/crud.py", line 348, in find_available_google_versions
  web-1  |     return sorted(versions, key=Version, reverse=True)
  web-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  web-1  |   File "/usr/local/lib/python3.12/site-packages/packaging/version.py", line 202, in __init__
  web-1  |     raise InvalidVersion(f"Invalid version: '{version}'")
  web-1  | packaging.version.InvalidVersion: Invalid version: '9.arm64'

Expected Behavior
/google/versions should successfully return all unique versions, including arm64.

Fix
Add method to drop arm64 suffix before sorting.
Increase test coverage with edge cases and arm64 values.

@F-X64 F-X64 added the bug Something isn't working label Jun 28, 2024
@F-X64 F-X64 requested a review from major June 28, 2024 07:49
Add method to drop arm64 suffix before sort
@F-X64 F-X64 force-pushed the fix-google-version-regex branch from 2020a75 to 7d5b493 Compare June 28, 2024 07:53
@major major merged commit be828f8 into main Jun 28, 2024
3 checks passed
@major major deleted the fix-google-version-regex branch June 28, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants