Bug 1128205 - Backward-incompatible changes in the XMLRPC API
Summary: Backward-incompatible changes in the XMLRPC API
Keywords:
Status: VERIFIED
Alias: None
Product: TCMS
Classification: Other
Component: XMLRPC
Version: Devel
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: ---
Assignee: Yang Ren
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-08 14:56 UTC by Petr Šplíchal
Modified: 2018-07-04 21:43 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1155110 None None None Never

Internal Links: 1155110

Description Petr Šplíchal 2014-08-08 14:56:45 UTC
Description of problem:

With the latest update there seem to be multiple backward
incompatible changes in the XMLRPC interface. These cause
python-nitrate module to fail to create new test plans and
several other problems. The test suite revealed 12 issues:

24 classes tested
87 tests passed
1 test failed
11 errors found
Failures in: ChildPlans, CaseRunBugs, TestRun, TestCase, CaseBugs and TestPlan

I believe the changes to the API should preserve backward
compatibility. So for example when the TestPlan.create() method
now accepts "product_version" instead of "default_product_version"
it should still support the old way as well.

Similarly when a bool value is expected, 0/1 should be accepted as
well and internally converted to bool. Otherwise it seems that
many tools could be broken by these changes.

Version-Release number of selected component (if applicable):
Nitrate 3.8.9

> [INFO] Creating a new test plan
> [DATA] {'default_product_version': 1504,
>   'is_active': '1',
>   'name': 'some-component / rhel-5.10.z / ER#12345',
>   'parent': 2226,
>   'product': 61,
>   'text': ' ',
>   'type': 27}
> Traceback (most recent call last):
>    File "/usr/bin/tcms-plan", line 426, in <module>
>      errata, general_plan)
>    File "/usr/bin/tcms-plan", line 265, in create_update_plan
>      type="Release")
>    File "/usr/lib/python2.7/site-packages/nitrate/mutable.py", line 175, in __init__
>      type=type, **kwargs)
>    File "/usr/lib/python2.7/site-packages/nitrate/mutable.py", line 250, in _create
>      inject = self._server.TestPlan.create(hash)
>    File "/usr/lib64/python2.7/xmlrpclib.py", line 1224, in __call__
>      return self.__send(self.__name, args)
>    File "/usr/lib64/python2.7/xmlrpclib.py", line 1578, in __request
>      verbose=self.__verbose
>    File "/usr/lib64/python2.7/xmlrpclib.py", line 1264, in request
>      return self.single_request(host, handler, request_body, verbose)
>    File "/usr/lib/python2.7/site-packages/nitrate/xmlrpc.py", line 170, in single_request_with_cookies
>      return self.parse_response(response)
>    File "/usr/lib64/python2.7/xmlrpclib.py", line 1473, in parse_response
>      return u.close()
>    File "/usr/lib64/python2.7/xmlrpclib.py", line 793, in close
>      raise Fault(**self._stack[0])
> xmlrpclib.Fault: <Fault 400: ["[('product_version', u'This field is required.')]"]>

Comment 1 Petr Šplíchal 2014-08-08 18:12:45 UTC
Also the estimated time format has been changed:

> [ INFO ] Updating test case TC#0046490
> [ DATA ] {'arguments': 'VAR1=VAL1 VAR2="VAL2" VAR3="VALUE 3"',
>  'case_status': 2,
>  'category': 239,
>  'default_tester': 'psplicha',
>  'estimated_time': '00:00:00',
> ...
> 
> xmlrpclib.Fault: <Fault 400: ["[('estimated_time', u'Enter a valid estimated time. e.g. 12h45m')]"]>

Although the documentation suggests "HH:MM:SS". Why is now
"12h45m" format required?

Comment 2 Petr Šplíchal 2014-08-08 18:37:27 UTC
Furthermore, even the suggested format "12h45m" now does not work:

[ INFO ] Updating test case TC#0046490
[ DATA ] {'arguments': 'VAR1=VAL1 VAR2="VAL2" VAR3="VALUE 3"',
 'case_status': 2,
 'category': 239,
 'default_tester': 'psplicha',
 'estimated_time': '12h45m',
...

xmlrpclib.Fault: <Fault 500: ["'int' object has no attribute 'seconds'"]>

Comment 3 cqi 2014-08-10 08:06:55 UTC
(In reply to Petr Šplíchal from comment #1)
> Also the estimated time format has been changed:
> 
> > [ INFO ] Updating test case TC#0046490
> > [ DATA ] {'arguments': 'VAR1=VAL1 VAR2="VAL2" VAR3="VALUE 3"',
> >  'case_status': 2,
> >  'category': 239,
> >  'default_tester': 'psplicha',
> >  'estimated_time': '00:00:00',
> > ...
> > 
> > xmlrpclib.Fault: <Fault 400: ["[('estimated_time', u'Enter a valid estimated time. e.g. 12h45m')]"]>
> 
> Although the documentation suggests "HH:MM:SS". Why is now
> "12h45m" format required?

Thanks for pointing out this. pls, from which server this error comes? This change is being done in next coming release 3.8.10. but, it's only available in devel server by far.

Comment 4 Tingting Zhao 2014-10-23 07:19:47 UTC
fix this in release 3.8.10,which was announced in product server on Sept 2,2014.
And version 3.8.10 support:
1)the default_product_version and product_version both can work well.
2)estimated_time format can be one of the HH:MM:SS or 12d34h56m


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