sturdy-dev / codereview.gpt

Reviews your Pull/Merge Requests using ChatGPT
MIT License
529 stars 63 forks source link

Add support for GitLab and add extra context for both GitHub & GitLab #13

Closed nickveenhof closed 1 year ago

nickveenhof commented 1 year ago

First of all, what an amazing extension! I love seeing innovations like this.

This change adds 2 things - if you prefer I can pull them apart in 2 changes.

  1. It adds support for additional context such as the title & the description of the Pull Request / Merge Request from the author by pulling in the DOM with an external fetch. We could have used extra permissions in the chrome extension but to make this as safe as possibly can, it currently will not work on Merge Requests or Pull Requests that are private
  2. it adds full support for GitLab.com, while keeping every other functionality intact. I noticed there was already a PR closed that added support for GitLab, however that change also touched a lot of the code styles and added irrelevant optimizations imho.
  3. It adds a weird try catch for response messages of ChatGPT. I noticed that it sometimes returned a timestamp which was not valid JSON. I did not dive in deeper, but it helps to project the complete response of ChatGPT into the Chrome Extension html box.

Let me know how you would like to proceed here. Thanks

krlvi commented 1 year ago

thanks for this contribution!