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

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

Open
jonathanspw opened this issue Nov 18, 2024 · 0 comments

Comments

@jonathanspw
Copy link
Member

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 <module>
    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.

soksanichenko added a commit that referenced this issue Dec 5, 2024
- Check if SELinux is enabled during Ansible deploying
- PEP8 (long lines, indents, typing etc.)
- The unused import are removed, the rest imports are optimized
- Get right major version if a full version is not listed in duplicated versions (the main issue)
- Old field `versions_arches` is removed from the service config. Field `arches` provides the full compatibility with it
soksanichenko added a commit that referenced this issue Dec 5, 2024
- Check if SELinux is enabled during Ansible deploying
- PEP8 (long lines, indents, typing etc.)
- The unused import are removed, the rest imports are optimized
- Get right major version if a full version is not listed in duplicated versions (the main issue)
- Old field `versions_arches` is removed from the service config. Field `arches` provides the full compatibility with it
jonathanspw pushed a commit that referenced this issue Dec 10, 2024
* Solves #1143

- Check if SELinux is enabled during Ansible deploying
- PEP8 (long lines, indents, typing etc.)
- The unused import are removed, the rest imports are optimized
- Get right major version if a full version is not listed in duplicated versions (the main issue)
- Old field `versions_arches` is removed from the service config. Field `arches` provides the full compatibility with it

* - Fixing the review comments
jonathanspw pushed a commit that referenced this issue Dec 10, 2024
* Solves #1143

- Check if SELinux is enabled during Ansible deploying
- PEP8 (long lines, indents, typing etc.)
- The unused import are removed, the rest imports are optimized
- Get right major version if a full version is not listed in duplicated versions (the main issue)
- Old field `versions_arches` is removed from the service config. Field `arches` provides the full compatibility with it

* - Arch is optional argument, so, we should check its existing

* - Fixing the review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant