Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with storing and submitting of scans #2688

Open
lbarcziova opened this issue Jan 8, 2025 · 0 comments
Open

Issues with storing and submitting of scans #2688

lbarcziova opened this issue Jan 8, 2025 · 0 comments
Labels
area/openscanhub complexity/single-task Regular task, should be done within days. gain/low This doesn't bring that much value to users. impact/low This issue impacts only a few users. kind/bug Something isn't working.

Comments

@lbarcziova
Copy link
Member

From time to time, some of the scans end up with no info in the DB (e.g., https://dashboard.packit.dev/jobs/openscanhub/4480) while the scan is being submitted correctly: https://openscanhub.fedoraproject.org/task/30559/, resulting also in no reporting to the user.

We have previously introduced a mechanism when processing the scans that prevents multiple scans from being stored in our DB for the same Copr build, which is probably related to this issue. Relevant code:

try:
err_msg = "Scan in OpenScanHub was not submitted successfully."
with self.build.add_scan_transaction() as scan:
output = self.copr_build_helper.api.run_osh_build(
srpm_path=paths[1],
base_srpm=paths[0],
comment=f"Submitted via Packit Service for {build_dashboard_url}",
)
if not output:
raise OSHNoFeedback("Something went wrong, skipping the reporting.")
logger.info("Scan submitted successfully.")
response_dict = self.parse_dict_from_output(output)
logger.debug(f"Parsed dict from output: {response_dict} ")
if id := response_dict.get("id"):
scan.task_id = id
scan.status = OSHScanStatus.pending
else:
raise OSHNoFeedback(
"It was not possible to get the Open Scan Hub task_id "
"from the response.",
)
if not (url := response_dict.get("url")):
err_msg = "It was not possible to get the task URL from the OSH response."
raise OSHNoFeedback(err_msg)
scan.url = url
self.report(
state=BaseCommitStatus.running,
description=(
"Scan in OpenScanHub submitted successfully. "
"Check the URL for more details."
),
url=get_openscanhub_info_url(scan.id),
links_to_external_services={"OpenScanHub task": url},
)
except IntegrityError as ex:
logger.info(f"OpenScanHub already submitted: {ex}")

@lbarcziova lbarcziova added area/openscanhub kind/bug Something isn't working. labels Jan 8, 2025
@lbarcziova lbarcziova added complexity/single-task Regular task, should be done within days. impact/low This issue impacts only a few users. gain/low This doesn't bring that much value to users. labels Jan 9, 2025
@lbarcziova lbarcziova moved this from new to backlog in Packit Kanban Board Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/openscanhub complexity/single-task Regular task, should be done within days. gain/low This doesn't bring that much value to users. impact/low This issue impacts only a few users. kind/bug Something isn't working.
Projects
Status: backlog
Development

No branches or pull requests

1 participant