Unhelpful error on badly declared API export

Bug #539070 reported by Jonathan Lange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lazr.restful
Fix Released
Low
Benji York

Bug Description

Recently, didrocks & I were trying to expose GPG keys via the API.

As part of an early attempt, we accidentally said that IPerson.gpgkeys was a list of IGPGKeySets rather than IGPGKeys.

That is, we wrote:
    gpg_keys = exported(
        CollectionField(
            title=_("List of valid OpenPGP keys ordered by ID"),
            readonly=False, required=False,
            value_type=Reference(schema=IGPGKeySet)))

Rather than:
    gpg_keys = exported(
        CollectionField(
            title=_("List of valid OpenPGP keys ordered by ID"),
            readonly=False, required=False,
            value_type=Reference(schema=IGPGKey)))

When we tried to test this (a step which demanded building the wadl & apidocs first), we got an obsure error: ` AssertionError: No IEntry adapter found for IGPGKeySet (web service version: devel).`

The error gave no hint of which declaration was causing the problems, not even which file the bad declaration was in, so we spent a lot of time trying to expose IGPGKeySet as a collection.

It would be very useful if the error message included some reference to the declaration that causes the problems. Bonus points for not being an assertion error.

Related branches

Revision history for this message
Gary Poster (gary) wrote :

FWIW, I added this to my list of things to talk to Jonathan Lange about to possible start soon.

Changed in launchpad-foundations:
status: New → Triaged
importance: Undecided → Low
Benji York (benji)
Changed in launchpad-foundations:
assignee: nobody → Benji York (benji)
status: Triaged → In Progress
Benji York (benji)
Changed in launchpad-foundations:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
affects: launchpad → lazr.restful
Benji York (benji)
tags: added: qa-untestable
Benji York (benji)
Changed in lazr.restful:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.