You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
toolbox doesn't understand "rawhide" version name #646
The problem is that we don't have an easy way to map rawhide to a numerical value in a way that would stay updated over time without manual intervention.
One option that was suggested in #fedora-devel on Freenode was to parse the metadata in the Fedora RPM repositories for rawhide. That's something that needs to be explored because I don't know off-hand how easy or difficult that would be.
So to give my standard explanation of this stuff for the record:
The "collections API" isn't really an API any more and hasn't been for years. It's a static JSON file that releng update by hand. If they forget to update it or make a booboo while doing it, the data will be wrong. Both these things have happened more than once.
I have some code that needs this same thing, and the way I do it is: rawrel = str(fedfind.helpers.get_current_release(branched=True) + 1). That uses my fedfind library, which formerly used the collections JSON as its data source, then tried using Bodhi's releases API for a bit, and right now is using my own hand-maintained JSON (on the theory that at least I can fix that one without needing someone else to run a playbook), though I might ping it back to the collections JSON.
I'm currently trying to get some momentum behind a project I wrote called releasestream that is intended to work as a better/more reliable/more automated source of this kind of information. The idea would be to deploy an official Fedora releasestream instance and have system/scripts that do release-y things, like branching and EOL and so on, also update releasestream at the same time.
The limitation of PDC is it doesn't have full lifecycle info (it just has 'active' or not; it doesn't distinguish pre-release from stable). I also don't know these days how exactly it gets updated and whether that's any more reliable than the collections JSON. The issue I had with Bodhi is that releases are changed from pre-release to stable state in Bodhi some days before they're actually publicly available.
For toolbox's purposes, neither of those should really be a problem, so you could potentially use either of those sources too. Rawhide's version number should always be one higher than whatever the highest numbered release provided by the data source is.
2026 update: never got time for releasestream, sadly. PDC is gone. fedfind's source-of-truth is still around, but it's probably best to use Bodhi for this. Basically: hit up https://bodhi.fedoraproject.org/releases/?state=pending (it returns JSON when you set that as the Content-Type), and then figure it out somehow. You could take all results with id_prefix "FEDORA", sort their versions, and take the highest one. Or you could just take the one whose id_prefix is "FEDORA" and branch is "rawhide" and read its version. In theory the response can be paginated and protecting against that is a bit of a pain, but in practice filtering to 'pending' releases should always give a response much too short to be paginated. Right now the response contains only ELN and Rawhide; when Branched exists, it will also contain Branched. I recommend filtering on the id_prefix just to ensure you don't get tripped up by some random other 'release' showing up there - Bodhi has 'releases' for things like modules and flatpaks also.
Activity
fedelibre commentedon Jan 17, 2021
For the records, even if Fedora 34 has not been branched yet, toolbox can find a f34 image:
debarshiray commentedon Jan 18, 2021
The problem is that we don't have an easy way to map
rawhideto a numerical value in a way that would stay updated over time without manual intervention.One option that was suggested in
#fedora-develon Freenode was to parse the metadata in the Fedora RPM repositories forrawhide. That's something that needs to be explored because I don't know off-hand how easy or difficult that would be.debarshiray commentedon Feb 10, 2021
It seems to me that the best candidate is to use Fedora's package DB collections API that's also used by GNOME Software.
(Thanks to @AdamWill and @kalev for suggesting that.)
Another option that was presented to me in
#fedora-develon Freenode was to parse the branch names of thefedora-releaseGit repository.AdamWill commentedon Feb 10, 2021
So to give my standard explanation of this stuff for the record:
rawrel = str(fedfind.helpers.get_current_release(branched=True) + 1). That uses my fedfind library, which formerly used the collections JSON as its data source, then tried using Bodhi's releases API for a bit, and right now is using my own hand-maintained JSON (on the theory that at least I can fix that one without needing someone else to run a playbook), though I might ping it back to the collections JSON.debarshiray commentedon Feb 10, 2021
Thanks for putting that on record. For what it's worth, I heartily endorse your efforts on releasestream.
juhp commentedon Dec 24, 2021
Personally I just use https://pdc.fedoraproject.org/rest_api/v1/product-versions/ for this.
Bodhi's API might be slightly more precise, depending on the exact use-case.
AdamWill commentedon Dec 24, 2021
The limitation of PDC is it doesn't have full lifecycle info (it just has 'active' or not; it doesn't distinguish pre-release from stable). I also don't know these days how exactly it gets updated and whether that's any more reliable than the collections JSON. The issue I had with Bodhi is that releases are changed from pre-release to stable state in Bodhi some days before they're actually publicly available.
For toolbox's purposes, neither of those should really be a problem, so you could potentially use either of those sources too. Rawhide's version number should always be one higher than whatever the highest numbered release provided by the data source is.
pkg/utils: Support Fedora rawhide version name
pkg/utils: Support Fedora rawhide version name
pkg/utils: Support Fedora rawhide version name
AdamWill commentedon Jun 4, 2026
2026 update: never got time for releasestream, sadly. PDC is gone. fedfind's source-of-truth is still around, but it's probably best to use Bodhi for this. Basically: hit up https://bodhi.fedoraproject.org/releases/?state=pending (it returns JSON when you set that as the
Content-Type), and then figure it out somehow. You could take all results withid_prefix"FEDORA", sort theirversions, and take the highest one. Or you could just take the one whoseid_prefixis "FEDORA" and branch is "rawhide" and read itsversion. In theory the response can be paginated and protecting against that is a bit of a pain, but in practice filtering to 'pending' releases should always give a response much too short to be paginated. Right now the response contains only ELN and Rawhide; when Branched exists, it will also contain Branched. I recommend filtering on the id_prefix just to ensure you don't get tripped up by some random other 'release' showing up there - Bodhi has 'releases' for things like modules and flatpaks also.