Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Build System (http://www.linux-archive.org/fedora-build-system/)
-   -   Question about Koji hub (http://www.linux-archive.org/fedora-build-system/554793-question-about-koji-hub.html)

Kiu Leung 07-20-2011 08:14 PM

Question about Koji hub
 
Hi all,

My name is Ken Leung, one of the Eclipse team new interns from the Red Hat Toronto office working on a Mylyn Builds Koji connector project. So I will be relying heavily on Apache's Java XmlRpc API as well as the Koji hub web service.

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.

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.

I also tried to query Koji by task_id # 8 with the following code:

ArrayList<Object> params = new ArrayList<Object>();
params.add(new ArrayList<Integer>().add(null));
params.add(new ArrayList<Integer>().add(null));
params.add(8);
xmlrpcClient.execute("listBuilds", params);//the Xml Rpc client was referenced by xmlrpcClient

But unfortunately, the web service also returned nothing while there are more than 3000 tasks pushed onto the server.

So I would be most grateful for your advice on how to form the parameter list properly with Apache XmlRpc. Thank you very much!

Best regards,

Ken Leung
--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys

Mike McLean 07-28-2011 06:43 PM

Question about Koji hub
 
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.
--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys


All times are GMT. The time now is 03:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.