[TIP] RPC URLs in config for CI system

Olemis Lang olemis at gmail.com
Mon Oct 5 05:31:40 PDT 2009


On Sun, Oct 4, 2009 at 5:29 AM, Robert Collins
<robertc at robertcollins.net> wrote:
> On Mon, 2009-09-14 at 09:48 -0500, Olemis Lang wrote:
>> Hello guys!
>>
>> Imagine a world where a CI client (slave) reports build results to a
>> CI server (master) via RPC . Under such circumstances, what would be
>> the (right | best | std | ...) way to configure the URLs in the client
>> so that it be able to connect to the server. Is there a way (URL
>> schema or something ;o) to specify this ?
>>
>> Features that should be considered :
>>
>> 1 - RPC Transport (e.g. http, smtp, xmpp, ...)
>> 2 - RPC flavour (e.g. JSON, XML, AMF ...)
>> 3 - Server, port, path, ...
>> 4 - RPC namespace
>>
>> My idea so far is to use a regular HTTP(s) URL and include the RPC
>> namespace in fragments,
>> i.e. something like `http://myserver.com/path/to/xmlrpc#ci.server.xxx`
>> . In this case `ci.server.xxx` would be the RPC namespace .
>>
>> It should solve 3 and 4, probably 1, but definitely not 2
>
>  #... is client side interpreted. So put your client specific stuff
> there. I think that would work tolerably.
>

Hmmm ... does this mean that URL fragments are not sent to the server
? If this is the case, AFAICS there's no problem because probably what
I want to do needs to be done in the client-side (please read below
;o)

> What do you mean 'RPC namespace'?
>

Well, the best way to explain this is with an example. Consider a Trac
instance that hosts a single environment available at
http://www.xxx.com . In order to retrieve all the components defined
in that environment from remote via RPC, a code like the following is
needed in the client-side:

{{{
#!python

# In order to use JSON-RPC the URL should be 'http://www.xxx.com/jsonrpc'
# and namespaces are just the same
p = ServerProxy('http://www.xxx.com/xmlrpc')
p.ticket.component.getAll()

}}}

In this case `ticket.component` is the XML-RPC namespace whereas
`getAll` is a method . There are a lot of namespaces owned by Trac RPC
handlers and they all can be found at the same URL. If I'd like to
embed such a CI server inside Trac then it has to be accessible at
that URL too but under an specific namespace . However, users need to
be able to configure the location of the server (aka master) in the
client (aka slave) so that it be able to send the build results via
RPC, and in this case the namespace really matters. AYCS this
processing is performed in the client-side ;o)

> You could consider directory parameters to pass info across, but
> strictly speaking they should be interpreted by the server not the
> client, so it would be a little icky.
>

It is also possible to host multiple environments or use Apache
tricks, so IMO the URL path is not the right place to specify such
information. Besides there's another dilemma `how could you know
exactly where to split the URL path in order to extract the XML-RPC
namespace ?` ...

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Sobrepasa las 300 descargas el módulo dutest  -
http://feedproxy.google.com/~r/simelo-es/~3/U5rff5iTQPI/sobrepasa-las-300-descargas-el-modulo.html



More information about the testing-in-python mailing list