Comment 5 for bug 688112

Revision history for this message
Anthony Lenton (elachuni) wrote :

Agree that the url for getting reviews will need to change (as noodles
points out) to make specifying the distroseries optional at best.

I think the version should be added at the same level (I'd imagine a POST
variable for each) so that you can optionally specify a version.

I feel like some times we'll want to restrict reviews to *only* certain
values (only reviews in English, only reviews for i386) but other times we'd
want to just push certain reviews to the top of the list (reviews in French
first, then in English, or reviews for my current version first, then other
versions).

This *could* be done by allowing the client to specify this separately for
each argument, with something like

version_first='0.2.2-0ubuntu1', lang_only='en'

Then again, this is ugly.

Optionally, we could make the api only allow you to restrict the reviews you
retrieve (make every argument mean fetch *only* reviews matching this
parameter), and leave sorting up to the client. For this to work each review
the api returns should inform its own version, origin, language, etc., but
this is the case already.

This would allow the client to also *sort* by different attributes (not only
push certain reviews to the top of the list), which might make it an interesting
option, as well as making the api neater (we only have one argument for
each review attribute, with a clear semantic).
Then again, this is more work for the client.

Ftr, we're currently only sorting reviews explicitly by usefulness. Any further
ordering is just Django's implementation and might change.

About omitting origin, the same applies: I think we shouldn't *enforce* the
user to provide an origin, but beyond that we could provide a way to restrict
reviews to *only* a certain origin (and let the client handle showing the right
origin first in the list), or also provide a way to request certain origin to be
listed first.

I wouldn't make the version attribute special in the sense of being able to
request reviews "at this version or older, or newer only if they're
installable". I think that's hard to explain, and doesn't provide all that
much extra value. If you see a review for a version that's newer than the one
you'd install it just means you might not be able to install it. I think it
falls in the same 'ah, this might not apply as much to me' bag as any other
partial match (like reviews for other architectures or distroseries).