non proxied swarming API doesn't respect query params |
|||||||
Issue descriptionWhat steps will reproduce the problem? (1) Navigate to https://2365-bd022ad-tainted-kjlubick-dot-chromium-swarm-dev.appspot.com/newui/botlist?c=id&c=os&c=task&c=status&f=os%3AWindows&l=5&s=id%3Aasc (2) log in, open Dev Tools and refresh the page. (3) Look at the network request to https://2365-bd022ad-tainted-kjlubick-dot-chromium-swarm-dev.appspot.com/api/swarming/v1/bots/list?dimensions=os%3AWindows&limit=5 (4) Notice that it is https://paste.googleplex.com/5913464669208576, which includes bots that are not os:Windows and is not returning only 5 results. You may notice the UI seems to be showing only Windows bots - this is because it filters client side as well.
,
Sep 26 2016
cloud endpoints silently ignores query string parameter if this value is already present in request body. gross
,
Sep 26 2016
cloud endpoints silently ignores URL path parameter if it is present in request body curl -X PUT https://cr-buildbucket-dev.appspot.com/_ah/api/buildbucket/v1/builds/9000428170515905216/retry?tags=x:y --data '{"id":1}' -H "Content-Type: applica tion/json" { "error": { "message": "Build 1 not found", "reason": "BUILD_NOT_FOUND" }, "kind": "buildbucket#resourcesItem", "etag": "\"c-RgmKx2yA5Oax82ub_lSFN0Vss/4KLd_EpgywIfdgooqK_APWoCCqU\"" } grooooooooss
,
Sep 26 2016
I am hesitant to implement these bugs in the adapter. I'd rather fix swarming to use resource container for GET request handlers. M-A, thoughts?
,
Sep 27 2016
You mean put everything in the URL path? That means creating a new API version.
,
Sep 27 2016
no need for breaking changes. If you use ResourceContainer with same fields instead of subclass of message.Message, the adapter will start working. Also that's the recommended practice for query string parameters (which means, for all GET request handlers), see docs list above. however, it would involve code duplication: you reuse swarming_rpcs.TaskRequest and defining a resource container with same fields would not be nice. i am ok supporting a message.Message subclass only for GET requests. This will fix this particular problem and won't introduce ambiguity that Cloud Endpoints (because there is no request body). I will do it tomorrow.
,
Sep 27 2016
,
Sep 28 2016
,
Sep 28 2016
The following revision refers to this bug: https://chromium.googlesource.com/external/github.com/luci/luci-py.git/+/618c81d1957a49e75b6f351bff3f7ac325bf51eb commit 618c81d1957a49e75b6f351bff3f7ac325bf51eb Author: nodir <nodir@chromium.org> Date: Wed Sep 28 22:58:08 2016 endpoints_webapp2: honor GET requests with messages Add support for GET request handlers that accept a message instead of a resource container. R=maruel@chromium.org BUG= 650245 Review-Url: https://codereview.chromium.org/2370413002 [modify] https://crrev.com/618c81d1957a49e75b6f351bff3f7ac325bf51eb/appengine/components/components/endpoints_webapp2.py [add] https://crrev.com/618c81d1957a49e75b6f351bff3f7ac325bf51eb/appengine/components/components/endpoints_webapp2_test.py
,
Oct 26 2016
the botlist and tasklist apis seem to now respect query params. However, /bot/[id]/tasks and /bot/id/events don't seem to respect their query params, neither fields= nor limit=
,
Oct 26 2016
yes, fields parameter is not supported by https://cs.chromium.org/chromium/infra/luci/appengine/components/components/endpoints_webapp2.py ATM, see below limit works though: curl https://chromium-swarm.appspot.com/_ah/api/swarming/v1/bot/build1-b4/events?limit=1 -H "Authorization: Bearer `authutil token`" returns one event I am closing this bug because proxied swarming API respects query params. The fields parameter is special, implemented inside google api guts. I considered supporting it, but the syntax of fields is not publicly documented and quite involved, e.g. it includes attribute filters. If `fields` parameter is a big deal, consider filing a separate bug.
,
Oct 27 2016
limit does not work indeed, my example has _ah and i meant to test without it
,
Oct 27 2016
The following revision refers to this bug: https://chromium.googlesource.com/external/github.com/luci/luci-py.git/+/98093011fef28b43e0596777525aae707198eaf4 commit 98093011fef28b43e0596777525aae707198eaf4 Author: nodir <nodir@chromium.org> Date: Thu Oct 27 17:19:21 2016 endpoints_webapp2: fix parsing params in GET request If a GET handler uses a resource container, the adaptor did not parse fields defined in the message. This was a bug in https://codereview.chromium.org/2370413002. R=maruel@chromium.org, kjlubick@chromium.org BUG= 650245 Review-Url: https://codereview.chromium.org/2456663004 [modify] https://crrev.com/98093011fef28b43e0596777525aae707198eaf4/appengine/components/components/endpoints_webapp2.py [modify] https://crrev.com/98093011fef28b43e0596777525aae707198eaf4/appengine/components/components/endpoints_webapp2_test.py
,
Nov 11 2016
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by no...@chromium.org
, Sep 26 2016Status: Started (was: Untriaged)