#951 kojisession.listTasks() contains raw XML data in request and result properties
Closed: Invalid 5 years ago Opened 5 years ago by till.

Example:

p.kojisession.listTasks({"method":"buildSRPMFromSCM", "createdAfter":"2018-05-27 18:00", "owner": 188, 'state': [koji.TASK_STATES['FAILED']]})
[...]
 {'arch': 'noarch',
  'awaited': False,
  'channel_id': 1,
  'completion_time': '2018-05-27 18:54:16.022784',
  'completion_ts': 1527447256.02278,
  'create_time': '2018-05-27 18:53:20.819250',
  'create_ts': 1527447200.81925,
  'host_id': 67,
  'id': 27236733,
  'label': 'srpm',
  'method': 'buildSRPMFromSCM',
  'owner': 188,
  'owner_name': 'till',
  'owner_type': 0,
  'parent': 27236732,
  'priority': 24,
  'request': "<?xml version='1.0'?>\n<methodCall>\n<methodName>buildSRPMFromSCM</methodName>\n<params>\n<param>\n<value><string>git+https://src.fedoraproject.org/rpms/mingw-openjpeg2.git?#5879dcc10271e5319f90b9902d43570331c8c28c</string></value>\n</param>\n<param>\n<value><int>3428</int></value>\n</param>\n<param>\n<value><struct>\n<member>\n<name>scratch</name>\n<value><nil/></value></member>\n<member>\n<name>repo_id</name>\n<value><int>917675</int></value>\n</member>\n</struct></value>\n</param>\n</params>\n</methodCall>\n",
  'result': "<?xml version='1.0'?>\n<methodResponse>\n<fault>\n<value><struct>\n<member>\n<name>faultCode</name>\n<value><int>1005</int></value>\n</member>\n<member>\n<name>faultString</name>\n<value><string>error building srpm, mock exited with status 1; see build.log for more information</string></value>\n</member>\n</struct></value>\n</fault>\n</methodResponse>\n",
  'start_time': '2018-05-27 18:53:21.141306',
  'start_ts': 1527447201.14131,
  'state': 5,
  'waiting': None,
  'weight': 1.0}

Sorry for the noise, I noticed I need "decode": True as well

Metadata Update from @till:
- Issue close_status updated to: Invalid

5 years ago

I think there's still a usability issue here. It would make Koji easier to use and develop client tooling if it always decoded task parameters and did not expose the raw XML to clients.

Login to comment on this ticket.

Metadata