Bug 1813227

Summary: There is no way to know status of a build+chroot via API
Product: [Community] Copr Reporter: Tomas Tomecek <ttomecek>
Component: frontendAssignee: Miroslav Suchý <msuchy>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: jkadlcik, praiskup
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-17 14:58:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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