Comment 3 for bug 808952

Revision history for this message
Richard Harding (rharding) wrote :

This bug is caused because the comment in question here (#11) is a Message
object with a parent that is another Message object. That is the message that
the milestone was changed from undefined -> 4.4.0.

Not all messages are exposed to the api as a resource. The lazr.restful needs
to be able to generate CanonicalUrls for all properties of the original Message,
including the parent. That parent could be a legitimate resource. The main path
of information is:

lib/canonical/launchpad/webapp/publisher.py - line 496 -
    urldata = ICanonicalUrlData(current_object, None)

Which eventually gets into the adapter code:

message_to_canonical_url_data()

This adapter has an else check that attempts to determine the CanonicalUrl for
the plain Message object (the parent) passed in, which returns None, and
causes the publisher to raise a NoCanonicalUrl exception.

lazr.restful should expect all of these properties to have a CanonicalUrl for
it. To fix this, we'd need to determine some method to expose all messages
via a CanonicalUrl that the api could then link to. The adapter could then be
updated to generate this.

I don't have time right now to implement this exposing, but hopefully this
helps the next developer down the road.