AlmaLinux / AlmaLinux/mirrors

Mirrorlist should deal with unmatched, slightly incorrect versions and multiple minors for one major

Open
#1,143 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
93
Forks
483
Avg merge
1d 1h
Merged PRs (30d)
6

Description

This came up while releasing 9.5 - the mirror system currently cannot handle 9.5 and 9.4 being support versions at the same time because only one exists in the `duplicated_versions` mapping. This is a regression introduced by the kitten support PR.

Relevant points in code and errors:

https://github.com/AlmaLinux/mirrors/blob/mirrors_service/src/backend/api/handlers.py#L434
https://github.com/AlmaLinux/mirrors/blob/mirrors_service/src/backend/api/handlers.py#L434

```
/opt/mirror_service/src/backend/update_mirrors.py:272: DeprecationWarning: There is no current event loop
loop = asyncio.get_event_loop()
Traceback (most recent call last):
File "/opt/mirror_service/src/backend/update_mirrors.py", line 273, in
loop.run_until_complete(update_mirrors())
File "/usr/lib64/python3.12/asyncio/base_events.py", line 684, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/opt/mirror_service/src/backend/update_mirrors.py", line 269, in update_mirrors
await task
File "/opt/mirror_service/src/backend/update_mirrors.py", line 103, in update_mirrors_handler
mirror_iso_uris = mirror_processor.get_mirror_iso_uris(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/mirror_service/src/backend/api/mirror_processor.py", line 472, in get_mirror_iso_uris
for arch in arches[base_version]:
~~~~~~^^^^^^^^^^^^^^
KeyError: '9.5'
```

The expected functionality is for versions without a mapping in duplicate_version to still attempt to map to a valid major.

For example:

9.2 should map to 9
9.1111 should map to 9
9.97234 should map to 9

These are all past-supported versions, or invalid minors, but we should map the pattern to the major where we can make reasonable assumptions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.