Update: Since the release of this post, I built the exact tool that I'm describing in this post. If you wish to try it out, you can do so by creating account on the official site. And now, back to the original post.
I have a confession to make.
I'm not a big fan of doing code review. Especially not those big ones.
But lately, I've had a great idea. The idea was to ask GPT model for help.
And I can proudly say, the help I received.
My Problem With Code Reviews
What I really hate about code reviews is looking at a completely new file with undocumented code.
I have no idea what is going on there.
And this is exactly where GPT model comes into play.
I built a simple Github bot that do the following:
- Analyze new pull requests
- Process newly added files
- Write brief description of the code
- Add description as a comment to pull request
I tested this whole flow on one of my projects, and I was very satisfied with the result.
Here's a brief description that the model wrote.
This code is a React functional component that renders an affiliate ad using a combination of React hooks and DOM manipulation.
The component uses the useAffiliateAssets
hook to fetch assets for the ad, useMediaQuery to determine the device type, then it renders the ad using ReactDOM.createPortal
and inserting the ad before the heading variable in the HTML document.
If any of the required assets, heading, mediumBox or mediumLandscape are not available the component returns null
My (Possible) Next Steps
I just built the prototype together to prove that the concept is working.
But I can't help to wonder.
- Is this something that could help the others?
- Should I build this into a fully-featured product?
I know this would be a really fun project to work on, but I'm not sure if the idea is valid.
If you think it is, please let me know in the comments. If you think it's not, let me know as well.
Top comments (8)
Potential disputes with such a bot look like a dead end venture... And the point of review is the collaboration process. In opposite case it's easier to just delegate coding to chatGPT. And I may sound boomer but who'll trust it... right?
The purpose is not to do the review. But to help reviewers give them overview of the changes
You do sound boomer.
I hear this lies each day man…
Amazing work! This would be go viral man!!
Let's hope so
There is a limit, yes!
At least I'm encouraging not to write big files :)
Checkout langchain
Some comments may only be visible to logged-in visitors. Sign in to view all comments.