Description
openedon Jun 21, 2021
Describe the bug
On openstack, we noticed missing data during our transition from the xmlrpc to the restful API.
Indeed, few months ago, we started transitioning github.com/openstack/releases on the restful API.
Previously we relied on the package_role
method to retrieve roles. Role is either Maintainer or Owner. The original intent here was to check whether an existing package registration allowed the account used by our automation to upload releases.
Example:
>>> import xmlrpc.client
>>> client = xmlrpc.client.ServerProxy("https://pypi.org/pypi")
>>> client.package_roles('ansible-role-atos-hsm')
[['Owner', 'openstackci']]
Unfortunately the restful API doesn't seems to return similar information. A maintainer
field is returned but this one is empty
>>> import requests
>>> data = requests.get('https://pypi.org/pypi/ansible-role-atos-hsm/json')
>>> print(data.json()['info']['maintainer'])
>>> # Empty result
So, we don't know how to finalize our transition without these data.
Expected behavior
Does the fact that the data.json()['info']['maintainer']
is empty is normal?
Do we should expect an empty result here?
Is it possible to bind something else (another JSON key) to retrieve this information?
To Reproduce
By using xmlrpc:
>>> import xmlrpc.client
>>> client = xmlrpc.client.ServerProxy("https://pypi.org/pypi")
>>> client.package_roles('ansible-role-atos-hsm')
[['Owner', 'openstackci']]
By using restful
>>> import requests
>>> data = requests.get('https://pypi.org/pypi/ansible-role-atos-hsm/json')
>>> print(data.json()['info']['maintainer'])
>>> # Empty result
My Platform
Additional context
To see the full context of our transition and the full context of the experienced problem, then, please have a look to https://review.opendev.org/c/openstack/releases/+/785008
Thanks for your help.