fedora-packages icon indicating copy to clipboard operation
fedora-packages copied to clipboard

Make active releases return JSON objects instead of HTML strings.

Open relrod opened this issue 11 years ago • 4 comments

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.

relrod avatar Jun 05 '13 00:06 relrod

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.

relrod avatar Sep 28 '13 22:09 relrod

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.

relrod avatar Jan 30 '14 06:01 relrod

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

ralphbean avatar Jan 30 '14 18:01 ralphbean

Well it helps somewhat, but unless it has changed recently, it still has the issue in this comment.

relrod avatar Jan 31 '14 08:01 relrod