Question about Koji hub

Mike McLean mikem at redhat.com
Thu Jul 28 18:43:37 UTC 2011


On 07/20/2011 04:14 PM, Kiu Leung wrote:
> Right now, I am running into a problem with how to query Koji builds
> by a user_id or task_id.  According to the signature of the web
> method:
>
> listBuilds(packageID=None, userID=None, taskID=None, prefix=None,
> state=None, createdBefore=None, createdAfter=None,
> completeBefore=None, completeAfter=None, type=None, typeInfo=None,
> queryOpts=None)
>
> The web method takes multiple parameter lists and can have default
> parameter values - which are not native to the Java language.

Koji encodes named parameters by appending an extra dictionary arg 
containing a key/value pair of "__starstar"/True. Koji's ClientSession 
class handles this for you, but it should be pretty easy to implement in 
other languages.

Of course, you can always pass args by order as you have here. I don't 
use Java much, so I'm not sure why it isn't working for you. However, I 
do wonder about your use of: new ArrayList<Integer>().add(null). I would 
have expected simply null.

Python's xmlrpclib supports a verbose option that outputs the raw xmlrpc 
data for each call. If the Java lib has a similar feature, it might be 
helpful to look at that.

Short of that, if you have access to the hub, you could crank up 
debugging[1] and see what args the hub is actually receiving.

[1] e.g. in hub.conf: LogLevel = xmlrpc:DEBUG

> I tried the following to query builds of user ID 2, who has about 360
> builds pushed to the target :
>
> ArrayList<Object>  params = new ArrayList<Object>(); params.add(new
> ArrayList<Integer>().add(null)); params.add(2);
> xmlrpcClient.execute("listBuilds", params);//the Xml Rpc client was
> referenced by xmlrpcClient
>
> While I expected a list of 360 hash maps (360 builds), I only
> received 1 hash map with a package_id of 1.  I also tried to pass
> other user_ids which are known to have builds pushed to the target
> Koji instance, but the web service returned nothing.


More information about the buildsys mailing list