Skip to content

Trigger Log Detective for failed downstream Koji builds#2971

Merged
centosinfra-prod-github-app[bot] merged 1 commit intopackit:mainfrom
Jany26:log-detective-trigger-handler
Feb 5, 2026
Merged

Trigger Log Detective for failed downstream Koji builds#2971
centosinfra-prod-github-app[bot] merged 1 commit intopackit:mainfrom
Jany26:log-detective-trigger-handler

Conversation

@Jany26
Copy link
Contributor

@Jany26 Jany26 commented Jan 28, 2026

This is a complementary handler to the one from #2905 by @jpodivin

This handler is supposed to detect changes in (downstream) Koji tasks and if they signal that the build has failed, it creates a json payload, then sends it to a middle-man server (implementation here: https://github.com/fedora-copr/logdetective-packit, the URL itself has not yet been determined) which triggers Log Detective. Additionally, some DB entries for the Log Detective run are also created. Analysis results themselves are then handled in another class.

RELEASE NOTES BEGIN

Packit can now trigger Log Detective when it detects a failed downstream Koji task.

RELEASE NOTES END

@Jany26 Jany26 changed the title Add a handler for triggering Log Detective [WIP] [WIP] Add a handler for triggering Log Detective Jan 28, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new handler to trigger Log Detective for failed Koji and Copr builds. The overall approach is sound, but I've identified a few critical issues that would cause runtime failures, including syntax errors and incorrect use of return in an __init__ method. I've provided suggestions to fix these. Additionally, I've proposed a refactoring of the database interaction logic to improve its clarity and maintainability. Addressing these points will strengthen the implementation.

@centosinfra-prod-github-app
Copy link
Contributor

Copy link
Member

@lbarcziova lbarcziova left a comment

Choose a reason for hiding this comment

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

thanks for the PR! Generally the logic looks good, but let's start with handling Koji builds only for now, see the previous comments

@Jany26
Copy link
Contributor Author

Jany26 commented Jan 29, 2026

Is this more in line with your suggestions? This seems much cleaner and should be easier to test.

@centosinfra-prod-github-app
Copy link
Contributor

@Jany26 Jany26 changed the title [WIP] Add a handler for triggering Log Detective [WIP] Trigger Log Detective for failed builds Jan 29, 2026
@Jany26 Jany26 force-pushed the log-detective-trigger-handler branch from 04e1c15 to 7794416 Compare January 30, 2026 13:41
@centosinfra-prod-github-app
Copy link
Contributor

@centosinfra-prod-github-app
Copy link
Contributor

@Jany26 Jany26 force-pushed the log-detective-trigger-handler branch from d105c5d to 9969900 Compare February 2, 2026 08:09
@centosinfra-prod-github-app
Copy link
Contributor

@centosinfra-prod-github-app
Copy link
Contributor

@Jany26
Copy link
Contributor Author

Jany26 commented Feb 2, 2026

This PR will focus on downstream Koji handling, I will create a separate PR for triggering LD from Copr later.

@Jany26 Jany26 marked this pull request as ready for review February 2, 2026 10:09
@Jany26 Jany26 requested a review from a team as a code owner February 2, 2026 10:09
@Jany26 Jany26 requested review from nforro and removed request for a team February 2, 2026 10:09
@Jany26 Jany26 changed the title [WIP] Trigger Log Detective for failed builds Trigger Log Detective for failed Koji builds Feb 2, 2026
@Jany26
Copy link
Contributor Author

Jany26 commented Feb 2, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new handler to trigger Log Detective for failed downstream Koji builds. The implementation is well-structured, with a new helper class LogDetectiveKojiTriggerHelper to encapsulate the logic for interacting with the Log Detective service. The changes are correctly integrated into the existing Koji task reporting flow. The error handling in the new helper is robust, and the PR includes both unit and integration tests for the new functionality. I have a few minor suggestions to improve code clarity and clean up the tests.

@centosinfra-prod-github-app
Copy link
Contributor

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.
Warning:
Error merging github.com/packit/packit-service for 2971,ab57dc25c63a72f6614b49dbf1ecc0920befdecf

@centosinfra-prod-github-app
Copy link
Contributor

Copy link
Contributor

@jpodivin jpodivin left a comment

Choose a reason for hiding this comment

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

I have minor suggestions for improving maintainability of the code in the long run. Other than that I think this is good to go. The tests especially are a nice touch, they cover 100% of the new helper.

@centosinfra-prod-github-app
Copy link
Contributor

@Jany26 Jany26 force-pushed the log-detective-trigger-handler branch from 7c9de82 to 08ca132 Compare February 3, 2026 09:27
@Jany26 Jany26 changed the title Trigger Log Detective for failed Koji builds Trigger Log Detective for failed downstream Koji builds Feb 3, 2026
@centosinfra-prod-github-app
Copy link
Contributor

Copy link
Member

@lbarcziova lbarcziova left a comment

Choose a reason for hiding this comment

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

this looks solid, thank you! Last few notes

@centosinfra-prod-github-app
Copy link
Contributor

@Jany26 Jany26 force-pushed the log-detective-trigger-handler branch from 8b412c6 to b8e00ad Compare February 3, 2026 16:07
@centosinfra-prod-github-app
Copy link
Contributor

@Jany26 Jany26 force-pushed the log-detective-trigger-handler branch from b8e00ad to 9ddf704 Compare February 4, 2026 13:24
@centosinfra-prod-github-app
Copy link
Contributor

@Jany26 Jany26 force-pushed the log-detective-trigger-handler branch from 9ddf704 to fc0b76c Compare February 4, 2026 13:57
@Jany26
Copy link
Contributor Author

Jany26 commented Feb 4, 2026

I included the requests and squashed the commits, since there was some back-and-forth in the commit history. Now I think it is ready for merging, in case no other issues are found.

Copy link
Member

@lbarcziova lbarcziova left a comment

Choose a reason for hiding this comment

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

LGTM, thanks a lot! I will wait a bit in case other team members want to have a look and merge later today

@centosinfra-prod-github-app
Copy link
Contributor

@lbarcziova
Copy link
Member

@Jany26 can you rebase please?

Signed-off-by: Jan Matufka <jmatufka@redhat.com>
@Jany26 Jany26 force-pushed the log-detective-trigger-handler branch from fc0b76c to 116d5d3 Compare February 5, 2026 08:06
@Jany26
Copy link
Contributor Author

Jany26 commented Feb 5, 2026

@lbarcziova done

@centosinfra-prod-github-app
Copy link
Contributor

@lbarcziova lbarcziova added the mergeit Merge via Zuul label Feb 5, 2026
@lbarcziova
Copy link
Member

regate

@centosinfra-prod-github-app
Copy link
Contributor

@centosinfra-prod-github-app centosinfra-prod-github-app bot merged commit 22a13d1 into packit:main Feb 5, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Packit pull requests Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mergeit Merge via Zuul

Projects

Development

Successfully merging this pull request may close these issues.

4 participants