archive.getPublishedSources matches package_name as substring

Bug #512878 reported by Martin Pool
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

It looks like getPublishedSources matches source_name as a substring by default, so searching for 'under' returns 'thunderbird' amongst others.

This seems at least a bit weird. Apparently there is an exact_match option.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

exact_match defaults to False. I don't think this can realistically be changed now without affecting all the users of this.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Actually let me re-phrase that, how would you change this? I'm happy to accept any reasonable suggestion :)

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 512878] Re: archive.getPublishedSources matches package_name as substring

2010/1/26 Julian Edwards <email address hidden>:
> exact_match defaults to False.  I don't think this can realistically be
> changed now without affecting all the users of this.

Is inexact matching a general pattern in Launchpad APIs? It seems pretty weird.

--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
Julian Edwards (julian-edwards) wrote : Re: [Bug 512878] Re: archive.getPublishedSources matches package_name as substring

On Tuesday 26 January 2010 17:41:25 Martin Pool wrote:
> 2010/1/26 Julian Edwards <email address hidden>:
> > exact_match defaults to False. I don't think this can realistically be
> > changed now without affecting all the users of this.
>
> Is inexact matching a general pattern in Launchpad APIs? It seems
> pretty weird.
>

I don't think it is. Unfortunately this API was exposed as a complete match
of what the internal method is, without really thinking about it :(

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 512878] Re: archive.getPublishedSources matches package_name as substring

2010/1/26 Julian Edwards <email address hidden>:
> On Tuesday 26 January 2010 17:41:25 Martin Pool wrote:
>> 2010/1/26 Julian Edwards <email address hidden>:
>> > exact_match defaults to False.  I don't think this can realistically be
>> > changed now without affecting all the users of this.
>>
>> Is inexact matching a general pattern in Launchpad APIs?  It seems
>> pretty weird.
>
> I don't think it is.  Unfortunately this API was exposed as a complete match
> of what the internal method is, without really thinking about it :(

So I would hazard a guess that if anyone is using this api, they're
probably getting confusing results in the same way that we were, and
if they really want substring matching they are probably saying so.

However, perhaps we could at least add a big warning about this to the
apidoc? I suppose getPublishedBinaries etc would be similar.

--
Martin <http://launchpad.net/~mbp/>

Revision history for this message
Julian Edwards (julian-edwards) wrote : Re: [Bug 512878] Re: archive.getPublishedSources matches package_name as substring

Well what we could do is change the default and just suck it up. I know the
two main users of this method and it would be easy to warn them. A message to
-users should cover the rest.

I agree that it's a bit crack.

affects: launchpad → soyuz
Changed in soyuz:
status: New → Triaged
importance: Undecided → Low
tags: added: api
tags: added: trivial
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.