Handle generic exceptions raised in preparation to execute run-condition#3034
Conversation
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 44s |
There was a problem hiding this comment.
Code Review
This pull request aims to handle exceptions during the preparation for executing a run-condition by wrapping the logic in a try-except block. However, it introduces a bug where an UnboundLocalError can occur if an exception happens before the actions_handler variable is initialized, causing the worker task to crash. This is contrary to the goal of proceeding with execution and can also lead to a NameError if other variables are not initialized. To address this, ensure actions_handler is initialized before the try block, or consider returning True from the except block to safely bypass the run-condition check.
|
/gemini review |
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 45s |
There was a problem hiding this comment.
Code Review
This pull request aims to handle generic exceptions during the preparation for executing a run-condition to prevent crashes and report them to Sentry. However, it introduces a potential UnboundLocalError because the extra_env variable is initialized inside the try block that might be skipped if an exception occurs. This would lead to a worker crash when the variable is later accessed, failing the primary goal of the PR to proceed with execution after an error. Please see the critical comment for a code suggestion to fix this issue.
|
/gemini review |
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 50s |
There was a problem hiding this comment.
Code Review
This pull request introduces a try...except block to handle generic exceptions during the preparation phase for executing a run-condition, aiming to prevent crashes and allow execution to proceed with error logging. However, a critical vulnerability related to unsafe specfile parsing has been identified, which could lead to Remote Code Execution (RCE) on the worker pod. This pre-existing vulnerability is now encapsulated within the new try...except block, potentially masking the issue while maintaining its exploitability. Additionally, the current error logging needs improvement to include more context for effective debugging.
Report the error to Sentry but proceed with execution. Signed-off-by: Nikola Forró <nforro@redhat.com>
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 49s |
|
Build succeeded. ✔️ pre-commit SUCCESS in 1m 49s |
|
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 1m 52s |
Report the error to Sentry but proceed with execution.
Fixes https://red-hat-it.sentry.io/issues/7302404510.