Bug 878013

Summary: [RFE]Allow Component.get return partial results
Product: [Community] Bugzilla Reporter: Tomas Hoger <thoger>
Component: WebServiceAssignee: Simon Green <sgreen>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.2CC: ebaak, jingwang, mtyson
Target Milestone: 4.2-8Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.2.5-8 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-14 22:13:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 822007    

Description Tomas Hoger 2012-11-19 12:59:20 UTC
Description of problem:
Component.get API is recommended as a replacement for Red Hat specific bugzilla.getCompInfo API.  The new API does not replace the old one for a use case when component ownership info is needed for several products (such as various RHEL versions).  getCompInfo can be called with a component name as an argument, and it returns one entry per product that includes the component.  Such response can be filtered to pick up information for products you are interested in.  E.g. response for openssl098e looks as:

{
  'initialowner' => 'tmraz',
  'name' => 'openssl098e',
  'product' => 'Red Hat Enterprise Linux 6',
  'description' => 'A compatibility version of a general cryptography and TLS library',
  'initialqacontact' => 'qe-baseos-security',
  'initialcclist' => []
},
{
  'initialowner' => 'qe-baseos-security',
  'name' => 'openssl098e',
  'product' => 'RHEL Tests',
  'description' => 'A compatibility version of a general cryptography and TLS library',
  'initialqacontact' => '',
  'initialcclist' => []
},
{
  'initialowner' => 'tmraz',
  'name' => 'openssl098e',
  'product' => 'Red Hat Enterprise Linux 7',
  'description' => 'A compatibility version of a general cryptography and TLS library',
  'initialqacontact' => 'qe-baseos-security',
  'initialcclist' => []
}

If I'm interested in current RHEL versions (3 to 7), I can use the above to know the info for 6 and 7, and know the component is not in 3 to 5.


Component.get requires product name with the component.  Hence one can do query as:

'names' => [
  {
    'component' => 'openssl098e',
    'product' => 'Red Hat Enterprise Linux 7'
  },
  {
    'component' => 'openssl098e',
    'product' => 'Red Hat Enterprise Linux 6'
  },
  {
    'component' => 'openssl098e',
    'product' => 'Red Hat Enterprise Linux 5'
  },
  {
    'component' => 'openssl098e',
    'product' => 'Red Hat Enterprise Linux 4'
  },
  {
    'component' => 'openssl098e',
    'product' => 'Red Hat Enterprise Linux 3'
  }
]

which fails with:

There is no component named 'openssl098e' in the 'Red Hat Enterprise Linux 5' product.

whenever the component does not exist in at least one of the specified products.  To avoid having to do a separate call for every product, it would be good to have another Component.get argument that would make it return information for products that include the component without hard failing the call.  I do not have a preference regarding the exact format of the reply - whether response array should skip products that do not include the component (and hence be shorter than request array), or include some explicit indicator that the component was not found in the product (empty or null hash).


Note that Product.get was discussed as a workaround.  It allows to get information (including component list) for multiple products in a single call.  The drawback of this approach is that even minimal response (include_fields: name, components) can be fairly large for certain products.


Another possible workaround is additional client code complexity using multicall.

Comment 1 Tomas Hoger 2012-11-19 14:31:29 UTC
Another option is to have a special product value that will simply return info for every product that has the component, such as:

  {
    'component' => 'openssl098e',
    'product' => '*'
  }

It does not need to be real wild card matching to allow things like 'Red Hat Enterprise Linux *', so other magic value can work.

Comment 23 Simon Green 2013-03-14 22:13:41 UTC
This change is now live.

  -- simon