Last Comment Bug 917157 - the "creation_time" parameter to Bug.search incorrectly uses the "equals" operator
: the "creation_time" parameter to Bug.search incorrectly uses the "equals" ope...
Status: RESOLVED FIXED
:
Product: bugzilla.mozilla.org
Classification: Other
Component: API (show other bugs)
: Production
: x86 Mac OS X
: -- normal (vote)
: ---
Assigned To: Byron Jones ‹:glob›
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-16 20:54 PDT by Byron Jones ‹:glob›
Modified: 2013-09-17 07:46 PDT (History)
5 users (show)
See Also:
Due Date:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Byron Jones ‹:glob› 2013-09-16 20:54:56 PDT
+++ This bug was initially created as a clone of Bug #916979 +++

I'm using json-rpc interface to access Bugzilla API. It seems that the "creation_time" parameters don't work;

https://bugzilla.mozilla.org/jsonrpc.cgi?method=Bug.search&params=[{"limit":3,"product":"Firefox","component":"Untriaged","status":"UNCONFIRMED","include_fields":["creation_time","id","status","summary","last_change_time" ]}]

and the "creation_time" doesn't return anything:

https://bugzilla.mozilla.org/jsonrpc.cgi?method=Bug.search&params=[{"limit":3,"creation_time":"2011-07-09T17:56:00Z","product":"Firefox","component":"Untriaged","status":"UNCONFIRMED","include_fields":["creation_time","id","status","summary","last_change_time" ]}]
Comment 1 Byron Jones ‹:glob› 2013-09-16 21:03:37 PDT
the documentation for the creation_time parameter has:
> Searches for bugs that were created at this time or later

however the code uses the "equals" operator - it should use "greaterthaneq", so the results returned are incorrect.
Comment 2 Byron Jones ‹:glob› 2013-09-16 21:05:39 PDT
oops -- looks like upstream has the correct operators, but not the bmo backport.  moving back.
Comment 3 Byron Jones ‹:glob› 2013-09-16 21:44:49 PDT
Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bmo/4.2/
modified Bugzilla/WebService/Bug.pm
Committed revision 9007.
Comment 4 David Lawrence [:dkl] 2013-09-17 07:33:50 PDT
(In reply to Byron Jones ‹:glob› from comment #2)
> oops -- looks like upstream has the correct operators, but not the bmo
> backport.  moving back.

My bad. Fixed on BMO and made a note to file an upstream bug as this parameter can cause long running queries. For example try:

/rest/bug?creation_time=1970-01-01

Equals made more sense to mitigate the possible misuse of the query. Will file an upstream bug now.

dkl
Comment 5 David Lawrence [:dkl] 2013-09-17 07:46:03 PDT
(In reply to David Lawrence [:dkl] from comment #4)
> (In reply to Byron Jones ‹:glob› from comment #2)
> > oops -- looks like upstream has the correct operators, but not the bmo
> > backport.  moving back.
> 
> My bad. Fixed on BMO and made a note to file an upstream bug as this
> parameter can cause long running queries. For example try:
> 
> /rest/bug?creation_time=1970-01-01
> 
> Equals made more sense to mitigate the possible misuse of the query. Will
> file an upstream bug now.
> 
> dkl

Ok realize that the proper fix is to limit the number of search results return to API calls which the default currently is 10000 so the admin will know what they are doing if they change that.

dkl

Note You need to log in before you can comment on or make changes to this bug.