nearform / reviewbot

A bot to assist with code reviews via AI
Apache License 2.0
26 stars 6 forks source link

bug: createSuggestions function #55

Open ilteoood opened 1 year ago

ilteoood commented 1 year ago

Looking at the code of the createSuggestions function, we are always overwriting the content of the suggestionsForFile variable, keeping only its last value.

Is this behaviour correct? If it's correct, we could avoid iterating the transformerResponse array and take only the last entry. Otherwise, the forEach function should became a map to keep all the possible results.

P.S. I also asked an opinion to ChatGPT 😄 image

richiemccoll commented 1 year ago

Thanks for raising @ilteoood. IIRC this was an intentional omission on my part. During the MVP, I created this TODO to track adding support for multiple suggestions on individual files. The snippet from GPT might work yes. Although it would need tested with the GitHub createReview API.

simoneb commented 1 year ago

I'd park this for the time being. The idea behind this project was mostly to serve as a showcase for something that can be built with Node.js and ChatGPT, but not serve as a real product.