-
Notifications
You must be signed in to change notification settings - Fork 38
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
base: main
Are you sure you want to change the base?
Conversation
A sample command exercising this a bit: kcidb-triage -b "$KCIDB_CACHE_BUCKET_NAME" -d "$KCIDB_OPERATIONAL_DATABASE" \
'>issue["maestro:8eccb2c3d8def056c6112c94af6a3189cc4f9ba8"]#' \
'>build[maestro:67e9b68767593f2aa0400472]#' |
There was a problem hiding this 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.
response = requests_session.get(log_url, | ||
timeout=30, | ||
allow_redirects=True) |
There was a problem hiding this comment.
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.
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 |
There was a problem hiding this comment.
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.
id=f"_:{issue_version.id}:{issue_version.version_num}:" | ||
f"build:{build.id}:error", |
There was a problem hiding this comment.
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
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :)
No description provided.