Skip to content

Add a minimal PoC of kcidb-triage #638

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Add a minimal PoC of kcidb-triage #638

wants to merge 2 commits into from

Conversation

spbnick
Copy link
Collaborator

@spbnick spbnick commented Apr 2, 2025

No description provided.

@spbnick
Copy link
Collaborator Author

spbnick commented Apr 2, 2025

A sample command exercising this a bit:

kcidb-triage -b "$KCIDB_CACHE_BUCKET_NAME" -d "$KCIDB_OPERATIONAL_DATABASE" \
    '>issue["maestro:8eccb2c3d8def056c6112c94af6a3189cc4f9ba8"]#' \
    '>build[maestro:67e9b68767593f2aa0400472]#'

Copy link

@tales-aparecida tales-aparecida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the near future, we might want to track long-running patterns and setup a timeout.

Comment on lines +456 to +458
response = requests_session.get(log_url,
timeout=30,
allow_redirects=True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly recommend limiting the download size from the start.
It can avoid unexpected memory usage problems, e.g. CKI has recently submitted a build with a log of 320MB that has caused some problems.

Suggested change
response = requests_session.get(log_url,
timeout=30,
allow_redirects=True)
response = requests_session.get(log_url,
timeout=30,
stream=True,
allow_redirects=True)
content_iterator = response.iter_content(DOWNLOAD_MAX_SIZE)
if not (raw_data := next(content_iterator, None)):
return None

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course. We have that implemented in the artifact archive. I could just copy it from there. This is just a PoC.

Comment on lines +483 to +484
id=f"_:{issue_version.id}:{issue_version.version_num}:"
f"build:{build.id}:error",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use parentheses when using implicit concatenation in a parameter list or tuple

Suggested change
id=f"_:{issue_version.id}:{issue_version.version_num}:"
f"build:{build.id}:error",
id=(f"_:{issue_version.id}:{issue_version.version_num}:"
f"build:{build.id}:error"),

There are more instances of this in the changes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uuuh, OK. I didn't really have that convention so far, but could do.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, this convention avoids skipping commas accidentally, and TBH I find it personally easier to read

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I got the idea. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants