Bug 1259251 - [RFE] Provide a way how to obtain the *full* URLs of build results
[RFE] Provide a way how to obtain the *full* URLs of build results
Product: Copr
Classification: Community
Component: frontend (Show other bugs)
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Valentin Gologuzov
Depends On:
  Show dependency treegraph
Reported: 2015-09-02 05:44 EDT by Radek Holy
Modified: 2015-12-01 01:04 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-09-22 05:47:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Radek Holy 2015-09-02 05:44:27 EDT
(I miss a "Python API" component, the "frontend" component is described as "bugs related to web interface")

Currently, to get the URL of the build results, I need to do this:

    for build in result.builds_list:
        for chroot in build.handle.get_build_details().data['chroots']:
            print('{}/{}/{:08}-{}'.format(build.handle.get_build_details().results, chroot, build.build_id, project))

I believe it is unnecessarily complicated. Especially the part '{id:08}-{project}' feels bad.

Could you please provide an attribute/function that can return the full URLs for each chroot? Or a function that is able to reliably construct the URL?

Let me set a higher severity since I believe that this is a really important piece. Especially in our case: an automated continuous integration process.

BTW, I believe that this would be useful also in the REST API. Should I file a separate RFE?
Comment 1 Valentin Gologuzov 2015-09-03 08:15:55 EDT
Fixed in cadcedfae65d2692e84a9e9432dd82fb6eff2a3c
Now old API method /api/coprs/build/106882 contains field `results_by_chroot` with absolute url to the result dir.

Example with python-copr:
In [11]: from copr import CoprClient

In [12]: cc = CoprClient(copr_url="http://copr-fe-dev.cloud.fedoraproject.org")

In [13]: result = cc.get_build_details(25257)

In [14]: result.data["results_by_chroot"]
Out[14]: {u'epel-7-x86_64': u'http://copr-be-dev.cloud.fedoraproject.org/results/vgologuz/test-scl-nginx/epel-7-x86_64/nginx14-nginx-1.4.4-10.el7'}

In [15]: result2 = cc.get_build_details(106882)

In [16]: result2.data["results_by_chroot"]
{u'fedora-21-i386': u'http://copr-be-dev.cloud.fedoraproject.org/results/vgologuz/aeghqawgt/fedora-21-i386/00106882-python-marshmallow',
 u'fedora-22-i386': u'http://copr-be-dev.cloud.fedoraproject.org/results/vgologuz/aeghqawgt/fedora-22-i386/00106882-python-marshmallow',
 u'fedora-23-i386': u'http://copr-be-dev.cloud.fedoraproject.org/results/vgologuz/aeghqawgt/fedora-23-i386/00106882-python-marshmallow',
 u'fedora-rawhide-i386': u'http://copr-be-dev.cloud.fedoraproject.org/results/vgologuz/aeghqawgt/fedora-rawhide-i386/00106882-python-marshmallow',
 u'fedora-rawhide-x86_64': u'http://copr-be-dev.cloud.fedoraproject.org/results/vgologuz/aeghqawgt/fedora-rawhide-x86_64/00106882-python-marshmallow'}

API_2 would provide this url as part of BuildChroot resource
Comment 2 Valentin Gologuzov 2015-09-22 05:47:46 EDT
Deployed in production. 
copr-frontend 1.68 copr-backend 1.75
Comment 3 Radek Holy 2015-09-29 18:15:19 EDT
Works for me. Thank you.

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