New REST API - motivation

Mark Côté mcote at bugzilla.org
Sat Dec 6 01:01:13 UTC 2014


On 2014-12-05 3:36 PM, Damien wrote:
> Hey Mark, Alan,
> 
> several things to consider:
> - providing a REST API will need to take permissions / auth in the picture.

The first version of REST API is actually done; you can see the API
documentation at http://bugzilla.readthedocs.org/en/5.0/api/index.html

You can provide username and password directly to API calls for
authenticated access, and we have support for API keys.

> - there are popular solutions to get started quick from an existing DB
> (e.g. django + django-rest-framework after running the ./manage.py
> inspectdb command to generate models automatically); I've considered this
> in the past but the previous point got me stalled (=too much work for me
> with not enough free time)

Bugzilla's security model is quite complex, so a thin layer on top of
the database is not possible, which is why the initial version of the
REST API uses the existing API layer that is shared by XML-RPC and
JSON-RPC.  In other words, we provide RESTish versions of the existing
XML-RPC and JSON-RPC interfaces.

This is related to what I mentioned about the REST API not actually
being very RESTful, since it follows the RPC function model instead of
proper resources.  We plan to move closer to a real REST model in
subsequent versions (and we will have a versioning framework in the API
itself for backwards compatibility).

> - having REST means you can swap frontends :D (e.g. angular bootstrap
> stuff) but also allow external services to integrate better with bugzilla
> provided you configure CORS (e.g. django-cors-headers)

Yes, at Mozilla we actually have quite a few dashboards and tools that
interface with Bugzilla, originally using the separate BzAPI service,
but now most integrate directly to the new native API (we've backported
it from 5.0 to our installation).

I plan to list and categorize them on Mozilla's wiki in case some are of
use to other Bugzilla installations.

> however the current "contribution" workflow is a pain for folks that
> actually want to contribute.

I would love to hear more on this.  One of my goals as Assistant Project
Lead is to increase the number of contributors, which in turn requires
that contributing be relatively painless.

> I would certainly like to see some kickass REST API, I would be able to
> consume that using Angular (see ngResource) and do my own dashboards and
> stuff.

We will have a 5.0 release candidate coming out very soon!  We have four
open blockers: one is approved and should be committed soon, one is in
the review cycle, and the others won't block us from a RC (bug in docs
generation, and one in tests).

Thanks for your input, and I would love to continue the conversation
about contributing.

Mark


-- 
Mark Côté
Assistant Project Lead, Bugzilla
_______________________________________________
dev-apps-bugzilla mailing list
dev-apps-bugzilla at lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-apps-bugzilla


More information about the developers mailing list