Log detective results handler#2905
Log detective results handler#2905centosinfra-prod-github-app[bot] merged 17 commits intopackit:mainfrom
Conversation
Summary of ChangesHello @jpodivin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a dedicated handler for Log Detective analysis results, streamlining the reporting and tracking of these events within the system. It establishes clear rules for translating Log Detective outcomes into commit statuses, integrates new metrics for better operational visibility, and refines existing code for improved readability and maintainability. The changes ensure robust processing of analysis results and provide valuable insights into the performance of Log Detective runs. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new handler for Log Detective results, which is a significant feature addition. The changes include the new DownstreamLogDetectiveResultsHandler, corresponding updates to event and model definitions, and new metrics for monitoring. The code is well-structured, and the inclusion of comprehensive tests is commendable. I've found a few areas for improvement: there's a potential for an unhandled exception in the event parser, and the new handler contains some unused variables and unreachable code that could be cleaned up for better maintainability. Overall, this is a solid contribution.
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 49s |
ca376b9 to
9592131
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 46s |
9592131 to
b28f85c
Compare
|
Build succeeded. ❌ non-voting-noop ERROR No playbook specified in 1s (non-voting) |
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 46s |
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 51s |
7cb4f5f to
c729ad7
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 44s |
c729ad7 to
5d351fa
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 49s |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a handler for Log Detective results, along with necessary database schema changes and model updates. The changes are well-structured and include comprehensive tests. I've provided a few suggestions to improve data consistency in the database migration, optimize database access, and enhance code clarity and correctness. Overall, this is a solid contribution.
5d351fa to
f82924e
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 47s |
f82924e to
b90147b
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 45s |
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 56s |
235debf to
6e0ba2a
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 53s |
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 47s |
majamassarini
left a comment
There was a problem hiding this comment.
Thanks a lot for creating this!
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Parser has been updated with commit_sha, pr_id and project_url handling. Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
* separate analysis_id column for Log Detective analysis identification * switching to timezone agnostic timestamp * checkers for handler removed Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
62392be to
d2366f0
Compare
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 48s |
|
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 1m 44s |
Trigger Log Detective for failed downstream Koji builds 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 Reviewed-by: gemini-code-assist[bot] Reviewed-by: Maja Massarini Reviewed-by: Laura Barcziová Reviewed-by: Ján Maťufka Reviewed-by: Jiří Podivín
This PR implements results handler for Log Detective events. It also makes slight modifications to event handler logic, expands comments and renames a variable in
LogDetectiveRunModel.set_statusmethod, to improve clarity of the code.The
log_detective_analysis_starttimestamp is using ISO 8601 format with an offset. For sake of simplicity and consistency, the timezone is set to UTC.The
Pushgatewayclass has three more metrics. Two counters for started and finished Log Detective runs and one elapsed time tracker.The test file had a typo. While adding new test cases I have fixed it, this makes the diff somewhat larger than it would otherwise be.
I have tried to cover as much of the behavior as possible with tests. The coverage of
packit_service.worker.handlers.logdetectiveis now about 97% as measured by pytest.RELEASE NOTES BEGIN
Handle for Log Detective results reporting has been implemented in
packit_service.worker.handlers.logdetective.RELEASE NOTES END