[Buildbot-devel] Filtering a rest request by a nested value
Francesco Di Mizio
francescodimizio at gmail.com
Mon Mar 30 16:28:44 UTC 2015
Got latest and gave websocket a try. As a test, I am sending:
{"_id": 11111, "cmd" : "startConsuming", "path" : "*"}
and the message I get back is:
{"msg":"OK","code":200,"_id":11111}
I on purpose used * just to make sure to catch something.
After that first message, I don't get anything else. I've tried to attach
to the websocket with Javascript and a Chrome extension just to be sure I
was not doing anything wrong. The behevior is the same. I get the ack then
nothing.
On Wed, Mar 18, 2015 at 5:29 PM, Francesco Di Mizio <
francescodimizio at gmail.com> wrote:
> Sweet, looking forward to trying it out!
>
> On Tue, Mar 17, 2015 at 10:30 PM, Pierre Tardy <tardyp at gmail.com> wrote:
>
>> websockets are not really supported in current master (only poc level
>> using old data api).
>>
>> See my PR, which adds proper support for websocket
>> https://github.com/buildbot/buildbot/pull/1603
>>
>> I need add documentation. will do tomorrow.
>>
>>
>> Le mar. 17 mars 2015 à 15:45, Francesco Di Mizio <
>> francescodimizio at gmail.com> a écrit :
>>
>> Pretty sure the exampleis wrong again. It should be changes and not
>>> change. when I send 'change' I get exceptions.InvalidPathError
>>> Alsp the Json itself is wrong as double quotes are needed.
>>>
>>> When I send the right one
>>>
>>> {"req": "startConsuming", "options": {},"path" : ["buildsets"]}
>>>
>>> I get:
>>>
>>> 2015-03-17 14:27:23+0000 [HTTPChannel,20,10.50.13.16] FRAME {"req":
>>> "startConsuming", "options": {},"path" : ["buildsets"]}
>>> 2015-03-17 14:27:23+0000 [HTTPChannel,20,10.50.13.16] Unhandled Error
>>> Traceback (most recent call last):
>>> File
>>> "/home/xxxxxxxxxxxx/buildbot-work/sandbox/local/lib/python2.7/site-packages/twisted/python/log.py",
>>> line 88, in callWithLogger
>>> return callWithContext({"system": lp}, func, *args, **kw)
>>> File
>>> "/home/xxxxxxxxxxxx/buildbot-work/sandbox/local/lib/python2.7/site-packages/twisted/python/log.py",
>>> line 73, in callWithContext
>>> return context.call({ILogContext: newCtx}, func, *args, **kw)
>>> File
>>> "/home/xxxxxxxxxxxx/buildbot-work/sandbox/local/lib/python2.7/site-packages/twisted/python/context.py",
>>> line 118, in callWithContext
>>> return self.currentContext().callWithContext(ctx, func,
>>> *args, **kw)
>>> File
>>> "/home/xxxxxxxxxxxx/buildbot-work/sandbox/local/lib/python2.7/site-packages/twisted/python/context.py",
>>> line 81, in callWithContext
>>> return func(*args,**kw)
>>> --- <exception caught here> ---
>>> File
>>> "/home/xxxxxxxxxxxx/buildbot-work/sandbox/local/lib/python2.7/site-packages/twisted/internet/posixbase.py",
>>> line 614, in _doReadOrWrite
>>> why = selectable.doRead()
>>> File
>>> "/home/xxxxxxxxxxxx/buildbot-work/sandbox/local/lib/python2.7/site-packages/twisted/internet/tcp.py",
>>> line 215, in doRead
>>> return self._dataReceived(data)
>>> File
>>> "/home/xxxxxxxxxxxx/buildbot-work/sandbox/local/lib/python2.7/site-packages/twisted/internet/tcp.py",
>>> line 221, in _dataReceived
>>> rval = self.protocol.dataReceived(data)
>>> File
>>> "/home/xxxxxxxxxxxx/buildbot-work/src/master/buildbot/www/websocket.py",
>>> line 314, in dataReceived
>>> self.parseFrames()
>>> File
>>> "/home/xxxxxxxxxxxx/buildbot-work/src/master/buildbot/www/websocket.py",
>>> line 282, in parseFrames
>>> ProtocolWrapper.dataReceived(self, data)
>>> File
>>> "/home/xxxxxxxxxxxx/buildbot-work/sandbox/local/lib/python2.7/site-packages/twisted/protocols/policies.py",
>>> line 120, in dataReceived
>>> self.wrappedProtocol.dataReceived(data)
>>> File
>>> "/home/xxxxxxxxxxxx/buildbot-work/src/master/buildbot/www/ws.py", line 52,
>>> in dataReceived
>>> d.addErrback("while starting consumption")
>>> File
>>> "/home/xxxxxxxxxxxx/buildbot-work/sandbox/local/lib/python2.7/site-packages/twisted/internet/defer.py",
>>> line 318, in addErrback
>>> errbackKeywords=kw)
>>> File
>>> "/home/xxxxxxxxxxxx/buildbot-work/sandbox/local/lib/python2.7/site-packages/twisted/internet/defer.py",
>>> line 290, in addCallbacks
>>> assert errback == None or callable(errback)
>>> exceptions.AssertionError:
>>>
>>> An other issue to open? Thinking about switching back to 8 :)
>>>
>>>
>>> On Tue, Mar 17, 2015 at 3:14 PM, Francesco Di Mizio <
>>> francescodimizio at gmail.com> wrote:
>>>
>>>> Thanks. I was also trying to use the websocket. I can connect ok.
>>>>
>>>> When subscribing with
>>>>
>>>> {'req': 'startConsuming', 'options': {}, 'path': ['change']}
>>>>
>>>> what does change look like? Could I get a working example? Then I could
>>>> also update the docs with it.
>>>>
>>>> Francesco
>>>>
>>>>
>>>>
>>>> On Tue, Mar 17, 2015 at 2:42 AM, Dustin J. Mitchell <dustin at v.igoro.us>
>>>> wrote:
>>>>
>>>>> That's not currently supported. However, I just learned about
>>>>> http://goessner.net/articles/JsonPath/ which may be a way to implement
>>>>> this.
>>>>>
>>>>> Dustin
>>>>>
>>>>> On Mon, Mar 16, 2015 at 12:49 PM, Francesco Di Mizio
>>>>> <francescodimizio at gmail.com> wrote:
>>>>> > As an example, consider the sourcestamps endpoint.
>>>>> >
>>>>> > When accessed, it returns sourcestamps that may optionally have a
>>>>> patch
>>>>> > filled with its own fields as well. Something like
>>>>> >
>>>>> > {
>>>>> > "branch": "main",
>>>>> > "codebase": "",
>>>>> > "created_at": 1426521061,
>>>>> > "patch": {
>>>>> > "author": "myself",
>>>>> > "body": "xxxxxxxxxxxHuge valuexxxxxxxxxx",
>>>>> > "comment": "patch for shelf 110179",
>>>>> > "level": 1,
>>>>> > "patchid": 29,
>>>>> > "subdir": ""
>>>>> > },
>>>>> >
>>>>> >
>>>>> > Can I get the sourcestamps that only match a criteria on any of the
>>>>> patche's
>>>>> > value?
>>>>> > Been checking the answer in the code without much luck.
>>>>> >
>>>>> > Cheers,
>>>>> > Francesco
>>>>> >
>>>>> >
>>>>> ------------------------------------------------------------------------------
>>>>> > Dive into the World of Parallel Programming The Go Parallel Website,
>>>>> > sponsored
>>>>> > by Intel and developed in partnership with Slashdot Media, is your
>>>>> hub for
>>>>> > all
>>>>> > things parallel software development, from weekly thought leadership
>>>>> blogs
>>>>> > to
>>>>> > news, videos, case studies, tutorials and more. Take a look and join
>>>>> the
>>>>> > conversation now. http://goparallel.sourceforge.net/
>>>>> > _______________________________________________
>>>>> > Buildbot-devel mailing list
>>>>> > Buildbot-devel at lists.sourceforge.net
>>>>> > https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>>>>> >
>>>>>
>>>>
>>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Dive into the World of Parallel Programming The Go Parallel Website,
>>> sponsored
>>> by Intel and developed in partnership with Slashdot Media, is your hub
>>> for all
>>> things parallel software development, from weekly thought leadership
>>> blogs to
>>> news, videos, case studies, tutorials and more. Take a look and join the
>>> conversation now. http://goparallel.sourceforge.net/
>>> _______________________________________________
>>> Buildbot-devel mailing list
>>> Buildbot-devel at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20150330/441e65df/attachment.html>
More information about the devel
mailing list