fedora-infra / pkgdb2

Updated version of the Package Database
https://admin.fedoraproject.org/pkgdb/
GNU General Public License v2.0
23 stars 26 forks source link

RFE: allow quering of more than one package name via the API #317

Closed jasontibbitts closed 8 years ago

jasontibbitts commented 8 years ago

I have a need to look up the owners of a number of packages on a particular branch as part of formatting a build failure report. Currently all I can think of doing is to query https://admin.fedoraproject.org/pkgdb/api/package/{}?branches={} a couple hundred times. It doesn't take too long, but it would be nice if I could save some round trips.

Trying to fetch the whole thing via https://admin.fedoraproject.org/pkgdb/api/packages/?acls=true times out before providing any data (which is understandable). The data available from the bugzilla endpoint might work but isn't broken down by branch (just Fedora and EPEL).

It would be super great if api/package/ took multiple packages somehow. Either via splitting on commas or spaces(since package names can't contain them), taking multiple pkgname= arguments, or, well, anything. The endpoint already returns an array of packages so it appears to be set up to do this already.

Thanks!

pypingou commented 8 years ago

I wonder if it wouldn't make more sense to adjust the /api/packages endpoint to accept multiple patterns, since semantically /api/package should only return info about a single package

pypingou commented 8 years ago

You can test it in staging if you like :)

https://admin.stg.fedoraproject.org/pkgdb/api/#list_packages