Skip to content

Commit

Permalink
Save scan id and report it in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
majamassarini committed Oct 14, 2024
1 parent 8793f41 commit e55dede
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packit_service/worker/handlers/copr.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,12 +571,19 @@ def handle_scan(self):

logger.debug(f"Parsed dict from output: {response_dict} ")

if id := response_dict.get("id"):
self.build.add_scan(task_id=id)
else:
logger.debug(
"It was not possible to get the Open Scan Hub task_id from the response."
)

if not (url := response_dict.get("url")):
logger.debug("It was not possible to get the URL from the response.")
return

self.copr_build_helper._report(
state=BaseCommitStatus.success,
state=BaseCommitStatus.progress,
description=(
"Scan in OpenScanHub submitted successfully. Check the URL for more details."
),
Expand Down

0 comments on commit e55dede

Please sign in to comment.