Replace deprecated oraculum with fedora-distro-aliases#28
Open
thrix wants to merge 3 commits into
Open
Conversation
The Fedora image URL resolver in `testcloud/distro_utils/fedora.py` mapped the `latest`/`rawhide`/`branched` aliases to concrete release numbers by querying oraculum (the Packager Dashboard) at `https://packager-dashboard.fedoraproject.org/api/v1/releases`. Oraculum is being deprecated, so this moves the lookup to the [`fedora-distro-aliases`](https://github.com/rpm-software-management/fedora-distro-aliases) library, which sources the same data from Bodhi (`https://bodhi.fedoraproject.org/releases/`). A new `get_fedora_releases()` helper returns a dict shaped like the old oraculum `releases["fedora"]` payload (`{"rawhide", "branched", "stable"}`), so the alias-normalization logic is unchanged. Release lookups are cached via the library's `Cache` (gated on `CACHE_IMAGES`, TTL `TRUST_DEADLINE`), and failures map to `TestcloudImageError` as before. `fedora-distro-aliases>=1.5` is pinned because the caching API (`Cache`, `BadCache`, the `cache=` argument) was introduced in 1.5. Assisted-by: Claude Code Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
LecrisUT
approved these changes
Jun 24, 2026
Comment on lines
+125
to
+161
| if version == "latest": | ||
| version = str(oraculum_releases["fedora"]["stable"]) | ||
| version = str(fedora_releases["stable"]) |
Member
There was a problem hiding this comment.
Why not handle more natively with what fedora_distro_aliases provides?
Contributor
Author
There was a problem hiding this comment.
@LecrisUT did not want to change stuff too much, but there we go, refactored
tcornell-bus
approved these changes
Jun 26, 2026
tcornell-bus
left a comment
There was a problem hiding this comment.
LGTM, test coverage seems good and they pass.
Use a catch-all `except Exception` around `get_fedora_releases()` since every failure maps to the same `TestcloudImageError` with a generic log message, so the specific error source is not preserved anyway (and the enumerated list missed cases such as `ValueError` from `int(...)`). Resolve rawhide/branched from the library's `fedora-development` alias by position instead of matching the magic `"rawhide"` string, relying on the documented sort order (highest is Rawhide, the one below is branched). Assisted-by: Claude Code Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
01b4042 to
c613732
Compare
Move the `_resolve_fedora_version()` call inside the `try` block so that any failure while parsing the alias data (not just fetching it) is mapped to `TestcloudImageError`, consistent with the catch-all error handling. Assisted-by: Claude Code Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Fedora image URL resolver in
testcloud/distro_utils/fedora.pymapped thelatest/rawhide/branchedaliases to concrete release numbers by querying oraculum (the Packager Dashboard) athttps://packager-dashboard.fedoraproject.org/api/v1/releases. Oraculum is being deprecated, so this moves the lookup to thefedora-distro-aliaseslibrary, which sources the same data from Bodhi(
https://bodhi.fedoraproject.org/releases/).A new
get_fedora_releases()helper returns a dict shaped like the old oraculumreleases["fedora"]payload(
{"rawhide", "branched", "stable"}), so the alias-normalization logic is unchanged. Release lookups are cached via the library'sCache(gated onCACHE_IMAGES, TTLTRUST_DEADLINE), and failures map toTestcloudImageErroras before.fedora-distro-aliases>=1.5is pinned because the caching API (Cache,BadCache, thecache=argument) was introduced in 1.5.Assisted-by: Claude Code