Bug 448512 - XMLRPC bugzilla.getCompInfo regression in initial{owner,cclist,qacontact}
Summary: XMLRPC bugzilla.getCompInfo regression in initial{owner,cclist,qacontact}
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: Query/Bug List
Version: 3.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Noura El hawary
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-05-27 12:04 UTC by Tomas Hoger
Modified: 2025-10-16 23:17 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-07-29 15:01:47 UTC
Embargoed:


Attachments (Terms of Use)
v1 patch to filter out closed products from getCompInfo (862 bytes, patch)
2008-07-09 10:46 UTC, Noura El hawary
dkl: review+
Details | Diff

Description Tomas Hoger 2008-05-27 12:04:55 UTC
Bugzilla 3.2 on partner-bugzilla.r.c returns user real names instead of mail
addresses in the reply to bugzilla.getCompInfo XMLRPC method in the
initialowner, initialcclist and initialqacontact fields

Production bugzilla 2.18 on bugzilla.r.c returns email addresses / bugzilla
login names.

Comment 1 Noura El hawary 2008-05-27 12:24:13 UTC
Hi Tomas,

For security purposes and to prevent possible spams, if the the user is not
logged in and they call getCompInfo then they only get realnames, however logged
in users will get email addresses returned fine.

Cheers,
Noura

Comment 2 Tomas Hoger 2008-07-08 09:58:44 UTC
(In reply to comment #1)
> however logged in users will get email addresses returned fine.

I came across following case then it breaks:

- calling bugzilla.getCompInfo for component bash without username+password
returns names without emails
- calling with username+password returns error:
  Sorry, entering a bug into the product Red Hat Public Beta has been disabled.

Same script works fine against old BZ.

Comment 3 David Lawrence 2008-07-08 14:06:04 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > however logged in users will get email addresses returned fine.
> 
> I came across following case then it breaks:
> 
> - calling bugzilla.getCompInfo for component bash without username+password
> returns names without emails

This is correct behaviour.

> - calling with username+password returns error:
>   Sorry, entering a bug into the product Red Hat Public Beta has been disabled.
> 

This is also correct behaviour currently as the product is closed. Of course we
could change it to return the component list even if the product is closed. But
that would be a RFE.



Comment 4 Tomas Hoger 2008-07-08 14:39:29 UTC
(In reply to comment #3)
> > - calling with username+password returns error:
> >   Sorry, entering a bug into the product Red Hat Public Beta has been
> >   disabled.
> 
> This is also correct behaviour currently as the product is closed. Of course
> we could change it to return the component list even if the product is
> closed. But that would be a RFE.

I'm *not* trying to file a bug, all I'm asking for is component information. 
When I call getCompInfo with component name, it is expected to return a hash
containing a component description for all products (though I believe not
getting info about closed/disabled product should not be an issue).

So if I'm using getCompInfo in an incorrect way, what is the correct way?  All I
expect from it is to get owner / initialcc email addresses for given component
across all products.  I can't do that when accessing BZ anonymously (because of
the spam concerns described above) and getCompInfo does not return any useful
information, if request is authenticated and is for the component, that ever
appeared in any product that is now disabled.

Comment 5 Tomas Hoger 2008-07-08 16:43:55 UTC
I'm trying to see if I can get comparable functionality using new API.  Do you
have any working examples of Component.get usage you can share?  Based on
example in Component.pm, this should work:

$rpc->call('Component.get', {
    names => [
        { 'product' => 'Fedora', 'component' => 'bash' }
    ]});

But all I get is:

Can't call method "login_exempt" on an undefined value at
/var/www/html/bugzilla/Bugzilla/WebService.pm line 50.

I wonder if I messed my authentication part...

Comment 6 Noura El hawary 2008-07-08 17:11:14 UTC
> Can't call method "login_exempt" on an undefined value at
> /var/www/html/bugzilla/Bugzilla/WebService.pm line 50.
> 
This is actually a bug, a fix has been committed to cvs to solve that should
work fine in the next beta release.

and here is an example of how to call that function :

use strict;
use warnings;

use XMLRPC::Lite;
use Data::Dumper;
use HTTP::Cookies;

my $username   = '';
my $password   = '';
my $xmlrpc_url = 'https://partner-bugzilla.redhat.com/xmlrpc.cgi';


my $cookie_jar = new HTTP::Cookies();

my $rpc = new XMLRPC::Lite;
$rpc->proxy($xmlrpc_url);
$rpc->transport->cookie_jar($cookie_jar);



my $call = $rpc->call( 'User.login',
    { login => $username, password => $password } );


$call = $rpc->call('Component.get', {names => [{ 'product' => 'fedora',
'component' => 'bash'}]});

my  $result = "";
if ( $call->faultstring ) {
    print $call->faultstring . "\n";
    exit;
}
else {
    $result = $call->result;
}

print "Data: " . Dumper($result) . "\n";



Comment 7 Tomas Hoger 2008-07-08 17:16:25 UTC
(In reply to comment #6)
> This is actually a bug, a fix has been committed to cvs to solve that should
> work fine in the next beta release.

Ah, thank you, Noura!

> and here is an example of how to call that function :

Right, very similar to what I was using.  Good to know the problem is not on my
side in this case ;).

Comment 8 Noura El hawary 2008-07-09 10:46:59 UTC
Created attachment 311362 [details]
v1 patch to filter out closed products from getCompInfo 

Thinking about the error thrown from bugzilla.getCompInfo when the product is
closed as in the example that Thomas mentioned, I think that throwing an error
for the closed products prevents returning info for similar components but for
other opened products, for example the component bash can be found in more than
one product but because one of them is closed we just get an error and no info
is returned for the component in the open products like fedora for example ..
IMO a better behavior would be to filter out those closed products from the
return and just get the info for components of open products, this can be done
by omitting the THROW_ERROR param which gets passed to can_enter_product and
also it is actually an optional param. patch is attached for that.
what do you think Dave?

Noura

Comment 9 Tomas Hoger 2008-07-09 11:19:48 UTC
Thanks Noura!  That's likely a root cause of the problem I tried to describe in
comment #4.

Comment 10 David Lawrence 2008-07-09 15:58:16 UTC
Comment on attachment 311362 [details]
v1 patch to filter out closed products from getCompInfo 

Noura, change looks good to me. It should address the issue thoger is having. I
also agree just dropping the closed products from the results is the right
thing as we do this in the enter_bug.cgi product list as well.
Feel free to check this in. 

thoger, do we need to do a patch for 2.18 as well or can this wait til after
Aug 2nd when we upgrade to 3.2? 

Dave

Comment 11 Tomas Hoger 2008-07-09 16:08:23 UTC
No need to patch 2.18, as there's no problem there, as far as I can tell.  I can
get required information over anonymous or authenticated session.  For
authenticated session, I get bit more info (some non-public products as well),
but it does not choke on closed products.  Migration to new BZ was my concern.

2.18 works well, let it die peacefully. ;)

Comment 12 Noura El hawary 2008-07-09 21:38:14 UTC
Thanks for reporting this issue Tomas and for testing :), The fix has been
committed to cvs should be there with the next partner-bugzilla package updates'
push.

Noura

Comment 13 Tomas Hoger 2008-07-29 09:34:48 UTC
bugzilla.getCompInfo now works with current partner-bugzilla (as of 2008-07-29)
and it does no longer choke on disabled products, so I presume "next
patner-bugzilla package updates" already happened.  Moving bug to verified, feel
free to close it.

Comment 14 David Lawrence 2008-07-29 15:47:14 UTC
Thanks for the verification.


Note You need to log in before you can comment on or make changes to this bug.