Skip to content

Commit

Permalink
client: Re-fetch build/extended to see check jobs status
Browse files Browse the repository at this point in the history
  • Loading branch information
barthalion committed Oct 20, 2023
1 parent 79bf439 commit d9d7972
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion flat-manager-client
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,6 @@ async def wait_for_checks(session, build_url, token):
async with resp:
if resp.status == 404:
return

if resp.status >= 500:
raise ServerApiError(resp, await resp.text())
elif resp.status != 200:
Expand All @@ -479,6 +478,21 @@ async def wait_for_checks(session, build_url, token):
job_url = build_url + "/check/" + check["check_name"] + "/job"
await wait_for_job(session, job_url, token)

resp = await session.get(build_url + "/extended", headers={'Authorization': 'Bearer ' + token})
async with resp:
if resp.status == 404:
return
if resp.status >= 500:
raise ServerApiError(resp, await resp.text())
elif resp.status != 200:
raise ApiError(resp, await resp.text())

build = await resp.json()
for check in build["checks"]:
if check["status"] == 2:
print("\ Check {} has failed".format(check["check_name"]))
raise FailedJobError(check)

@retry(
stop=TENACITY_STOP_AFTER,
wait=TENACITY_WAIT_BETWEEN,
Expand Down

0 comments on commit d9d7972

Please sign in to comment.