Bug 1813227 - There is no way to know status of a build+chroot via API
Summary: There is no way to know status of a build+chroot via API
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Copr
Classification: Community
Component: frontend
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-13 10:44 UTC by Tomas Tomecek
Modified: 2020-03-17 14:58 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-03-17 14:58:08 UTC
Embargoed:


Attachments (Terms of Use)

Description Tomas Tomecek 2020-03-13 10:44:18 UTC
In [1]: bc = copr_client.build_chroot_proxy.get(1304523, "fedora-rawhide-x86_64")    

In [2]: bc.__dict__                       
Out[2]: 
{'ended_on': 1584095559,
 'name': 'fedora-rawhide-x86_64',
 'result_url': 'https://download.copr.fedorainfracloud.org/results/packit/packit-service-packit-754/fedora-rawhide-x86_64/01304523-packit/',
 'started_on': 1584095470,
 '__response__': <Response [200]>,
 '__proxy__': <copr.v3.proxies.build_chroot.BuildChrootProxy at 0x7f612d64ff50>}


Adding status to the dict would be lovely.

Comment 1 Jakub Kadlčík 2020-03-13 11:55:45 UTC
> Adding status to the dict would be lovely.

That would be lovely indeed. It should be there, we probably just forgot it.
I will fix it today.

Comment 2 Jakub Kadlčík 2020-03-15 21:21:12 UTC
Modified in PR#1312

The change is only on the frontend side and will not require the python3-copr library update.
You just need to wait until we make a frontend release, then it will be available like this:


In [17]: bc = copr_client.build_chroot_proxy.get(1, "fedora-30-x86_64")                                                

In [18]: bc.state                                          
Out[18]: 'waiting'


Just for the record, I am naming the field state instead of status because

1. We already return state (not status) for builds
2. In our codebase status is a numeric value, state is its text representation

Comment 3 Pavel Raiskup 2020-03-17 14:58:08 UTC
Thanks for the report and patch, hot-fixed in production for
https://pagure.io/copr/copr/pull-request/1291


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