Skip to content
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

Error Handling Improvements #1053

Open
MarkRx opened this issue Jul 23, 2024 · 0 comments
Open

Error Handling Improvements #1053

MarkRx opened this issue Jul 23, 2024 · 0 comments

Comments

@MarkRx
Copy link
Contributor

MarkRx commented Jul 23, 2024

The current state of error handling has a mixture of swallowed exceptions and exceptions that are not propagated up through the execution. While simply using logging is sufficient when running using CLI as a github action, it is problematic when running as a service at scale. It is difficult to answer and monitor "did my PR review execution work" as there is no single point of control for error management.

Error handling needs to be revamped and made consistent. When running using the CLI the application should terminate with a non-zero exit code if a fatal error occurred. When running as a server it can return a failed response (if run synchronously) or log a single clear message at the end of execution that it failed (if run asynchronously).

Errors would fall into 3 categories: Ignore, Warning, and Fatal. Examples:

  • .pr_agent is missing. This is a "nominal workflow" error that can be logged as debug and ignored
  • A file is too large to review. This could be a warning but processing can continue
  • AI parsing error. This is a deal breaker and should always get raised up to the root control logic.

Here is an incomplete list of things that should result in an overall failure:
AI prediction Failures -
https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/tools/pr_description.py#L95
https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/algo/utils.py#L435
https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/algo/utils.py#L564
PR suggestion - https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py#L399
Update comment - https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/tools/pr_code_suggestions.py#L264
File encoding - https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/algo/git_patch_processing.py#L29

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

No branches or pull requests

1 participant