feiskyer / ChatGPT-Reviewer

Automated pull requests reviewing and issues triaging with ChatGPT.
Apache License 2.0
59 stars 20 forks source link

Fix the failures for large changes #2

Closed feiskyer closed 1 year ago

feiskyer commented 1 year ago

This PR fixes the ChatGPT failures via belowing two approaches when the diff is too large:

1) split the changes by changed files. 2) cut the lines from the ending if a file's change is still too large

github-actions[bot] commented 1 year ago

@feiskyer Thanks for your PR!

My in-depth review of this pull request is as follows:

This pull request looks to be addressing the issue of ChatGPT failures when the diff is too large. The two approaches taken are to split the changes by changed files and to cut the lines from the end if a file's change is still too large.

The changes look to be well thought out and the code is well written. However, there are a few areas that could be improved.

First, the code should be more robust when it comes to cutting the lines from the end of a file's change. It is not a good idea to cut the contents, so a better way should be figured out.

Second, the code should be more efficient when it comes to splitting the changes by changed files. It should be optimized to minimize the number of requests sent to the API.

Finally, the code should be more organized. It should be broken down into smaller functions and the comments should be more descriptive.

Overall, this pull request looks to be addressing the issue of ChatGPT failures when the diff is too large. However, there are a few areas that could be improved to make the code more robust, efficient, and organized.