Bug 878013 - [RFE]Allow Component.get return partial results
[RFE]Allow Component.get return partial results
Status: CLOSED CURRENTRELEASE
Product: Bugzilla
Classification: Community
Component: WebService (Show other bugs)
4.2
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: ---
Assigned To: Simon Green
tools-bugs
: FutureFeature
Depends On:
Blocks: 822007
  Show dependency treegraph
 
Reported: 2012-11-19 07:59 EST by Tomas Hoger
Modified: 2014-10-12 18:49 EDT (History)
3 users (show)

See Also:
Fixed In Version: 4.2.5-8
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-03-14 18:13:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tomas Hoger 2012-11-19 07:59:20 EST
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@redhat.com',
  'name' => 'openssl098e',
  'product' => 'Red Hat Enterprise Linux 6',
  'description' => 'A compatibility version of a general cryptography and TLS library',
  'initialqacontact' => 'qe-baseos-security@redhat.com',
  'initialcclist' => []
},
{
  'initialowner' => 'qe-baseos-security@redhat.com',
  'name' => 'openssl098e',
  'product' => 'RHEL Tests',
  'description' => 'A compatibility version of a general cryptography and TLS library',
  'initialqacontact' => '',
  'initialcclist' => []
},
{
  'initialowner' => 'tmraz@redhat.com',
  'name' => 'openssl098e',
  'product' => 'Red Hat Enterprise Linux 7',
  'description' => 'A compatibility version of a general cryptography and TLS library',
  'initialqacontact' => 'qe-baseos-security@redhat.com',
  '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 09:31:29 EST
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 18:13:41 EDT
This change is now live.

  -- simon

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