fedora-packages
fedora-packages copied to clipboard
Make active releases return JSON objects instead of HTML strings.
Right now query_active_releases returns a bunch of HTML strings with information about releases, including the karma + karma icon for releases in testing.
This makes using the API to get just the versions of packages really hard.
Just a note that this also affects the pkgwat CLI and Python lib:
$ pkgwat releases firefox
Starting new HTTPS connection (1): apps.fedoraproject.org
+---------------+----------------+---------------------+
| release | stable_version | testing_version |
+---------------+----------------+---------------------+
| Rawhide | 24.0-1.fc21 | None |
| Fedora 20 | 24.0-1.fc20 | 24.0-1.fc20 3 karma | <--------
| Fedora 19 | 24.0-1.fc19 | None |
| Fedora 18 | 24.0-1.fc18 | None |
| Fedora EPEL 6 | None | None |
| Fedora EPEL 5 | None | None |
+---------------+----------------+---------------------+
As well as Fedora Mobile, and the pkgwat Scala port of the Python lib.
This is also in other fields, not just just the releases.
λ> import Fedora.Packages.Lens
λ> head rows ^. name
"<span class=\"match\">firefox</span>"
Ideally the API should never return HTML, or only if given a special flag that tells it to.
Ideally the API should never return HTML, or only if given a special flag that tells it to.
Agreed. pkgwat.api
has a strip_tags
function to try and workaround this: https://github.com/fedora-infra/pkgwat.api/blob/develop/pkgwat/api/utils.py
Well it helps somewhat, but unless it has changed recently, it still has the issue in this comment.