#17 Switch from orphaned pkgdb collections API to Bodhi releases API
Closed by adamwill. Opened by adamwill.

fedfind (like gnome-software) currently uses this orphaned pkgdb API endpoint as a source of truth about Fedora releases (which ones exist, and whether they're under development, stable, or EOL). The data is actually now updated by hand and only if/when someone in releng remembers to do it; we've had multiple cases of it not being updated when it should, or of it being updated incorrectly in some way.

Recently it's been noticed that there's a Bodhi releases API which might potentially be a viable replacement. I can see two major open questions:

  1. When exactly does a release become 'current' so far as Bodhi is concerned?
  2. Is there any way to distinguish a Branched release from a Rawhide release?

If there are satisfactory answers to those two questions, we could switch fedfind to use this API instead of the orphaned pkgdb one, and hopefully that will improve accuracy of release information...

@abompard @mohanboddu @kevin can you folks shed any light on the questions here? Thanks!


I am pretty sure:

  1. At GA release time
  2. not sure... I guess sorting the higher number as rawhide and the lower as branched?

Hm. See for 2, you also have the case of having no Branched to consider.

I guess it would work to just assume that if there are two development releases, the lower-numbered is Branched and the higher-numbered is Rawhide; if there's only one, it's Rawhide. It's very dependent on us continuing to do things the way we currently do them, but hey.

I guess it would work to just assume that if there are two development releases, the lower-numbered is Branched and the higher-numbered is Rawhide; if there's only one, it's Rawhide. It's very dependent on us continuing to do things the way we currently do them, but hey.

This should work, or else we change the status definitions and bodhi has to be updated for them. Also, dont forget there are multiple releases in bodhi that follow one Fedora release. For example F31C or F31M which are Container and Modular releases for F31.

If we are not going to change anything, then if there are two pending releases, then higher numbered one is rawhide and lower numbered one is branched and if there is only one pending release then its rawhide.

You can filter on the state of a release, for example see below for getting all the pending releases.

The way to know if a release is set to behave like rawhide (using the automation in bodhi) is to check that the composed_by_bodhi attribute is set to False.

[cverna@localhost]  [master] $ http GET https://bodhi.fedoraproject.org/releases/?state=pending
HTTP/1.1 200 OK
AppTime: D=659089
Cache-control: private
Connection: Keep-Alive
Content-Length: 1956
Content-Type: application/json
Date: Thu, 20 Feb 2020 20:59:07 GMT
Keep-Alive: timeout=15, max=500
Referrer-Policy: same-origin
Server: Apache/2.4.41 (Fedora) mod_wsgi/4.6.4 Python/3.7
Set-Cookie: 1caa5c4232b1a1f24f8c4f6e0f496284=d7901e6b13e7d569adf9322d2c6fd7f6; path=/; HttpOnly; Secure
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-Content-Type-Options: nosniff
X-Fedora-ProxyServer: proxy05.fedoraproject.org
X-Fedora-RequestID: Xk7zG0vBvQuIhE0MyQt7FAAACAY
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block
{
    "page": 1,
    "pages": 1,
    "releases": [
        {
            "branch": "f33",
            "candidate_tag": "f33-updates-candidate",
            "composed_by_bodhi": false,
            "composes": [],
            "create_automatic_updates": true,
            "dist_tag": "f33",
            "id_prefix": "FEDORA",
            "long_name": "Fedora 33",
            "mail_template": "fedora_errata_template",
            "name": "F33",
            "override_tag": "f33-override",
            "package_manager": "unspecified",
            "pending_signing_tag": "f33-signing-pending",
            "pending_stable_tag": "f33-updates-pending",
            "pending_testing_tag": "f33-updates-testing-pending",
            "stable_tag": "f33",
            "state": "pending",
            "testing_repository": null,
            "testing_tag": "f33-updates-testing",
            "version": "33"
        },
        {
            "branch": "f32",
            "candidate_tag": "f32-container-updates-candidate",
            "composed_by_bodhi": true,
            "composes": [],
            "create_automatic_updates": false,
            "dist_tag": "f32-container",
            "id_prefix": "FEDORA-CONTAINER",
            "long_name": "Fedora 32 Containers",
            "mail_template": "fedora_errata_template",
            "name": "F32C",
            "override_tag": "f32-container-override",
            "package_manager": "unspecified",
            "pending_signing_tag": "",
            "pending_stable_tag": "f32-container-updates-pending",
            "pending_testing_tag": "f32-container-updates-testing-pending",
            "stable_tag": "f32-container-updates",
            "state": "pending",
            "testing_repository": null,
            "testing_tag": "f32-container-updates-testing",
            "version": "32"
        },
        {
            "branch": "f32",
            "candidate_tag": "f32-updates-candidate",
            "composed_by_bodhi": false,
            "composes": [],
            "create_automatic_updates": true,
            "dist_tag": "f32",
            "id_prefix": "FEDORA",
            "long_name": "Fedora 32",
            "mail_template": "fedora_errata_template",
            "name": "F32",
            "override_tag": "f32-override",
            "package_manager": "dnf",
            "pending_signing_tag": "f32-signing-pending",
            "pending_stable_tag": "f32-updates-pending",
            "pending_testing_tag": "f32-updates-testing-pending",
            "stable_tag": "f32",
            "state": "pending",
            "testing_repository": "updates-testing",
            "testing_tag": "f32-updates-testing",
            "version": "32"
        }
    ],
    "rows_per_page": 20,
    "total": 3
}

The way to know if a release is set to behave like rawhide (using the automation in bodhi) is to check that the composed_by_bodhi attribute is set to False.

This is not true since a branched release will have composed_by_bodhi attribute set to False until bodhi activation point, so for two weeks, branched release works as if its a rawhide release.

The way to know if a release is set to behave like rawhide (using the automation in bodhi) is to check that the composed_by_bodhi attribute is set to False.

This is not true since a branched release will have composed_by_bodhi attribute set to False until bodhi activation point, so for two weeks, branched release works as if its a rawhide release.

Yes that's why I said "behave like rawhide" :-). I think doing a max of the version attribute of the pending releases will always get you rawhide.

something like

 [cverna@localhost]  [master] $ ipython
Python 3.7.6 (default, Jan 30 2020, 09:44:41) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.11.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import requests                                                                                                                                                                                                                       
In [2]: releases = requests.get("https://bodhi.fedoraproject.org/releases/?state=pending").json()                                                                                                                                             
In [3]: versions = [ r["version"] for r in releases["releases"] ]                                                                                                                                                                             
In [4]: max(versions)                                                                                                                                                                                                                         
Out[4]: '33'
In [5]:  

Yes that's why I said "behave like rawhide"

Sorry, I thought you meant rawhide is the only one that has composed_by_bodhi attribute set to False

@cverna the problem is not finding Rawhide's release number (although, well, that's a thing I happen to do somewhere else, which could maybe use that approach). The problem is finding the release number of Branched if it exists or the highest stable release if it doesn't, but not Rawhide - this is a function fedfind offers.

It's easy enough to do (I've done it already, just need to write the tests today), it's just that any way of doing it sort of bakes in some assumptions about how we do things. But hey, fedfind is effectively a giant pile of codified Assumptions About How We Do Things, so I'm not gonna stress about it too hard...

Metadata Update from @adamwill:
- Issue status updated to: Closed (was: Open)

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/quality/fedfind/issues/17

Please continue any further discussion there.

Metadata