-
Notifications
You must be signed in to change notification settings - Fork 6
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
Arihan/mar 8 ability to comment by line of code in pr #55
Arihan/mar 8 ability to comment by line of code in pr #55
Conversation
arihanv
commented
Dec 6, 2023
- This PR introduces the ability for Maige to add comments inline on changed files. This is done through parsing the git diff file and using the codeComment function.
- The reviewer agent automatically reviews PRs when they are opened and when new commits are pushed to them.
- Also, the reviewer agent can both answer questions about a PR (ex: What is page.tsx about?) and review the changes in files.
* Specify Weaviate schema in code
…han/mar-6-code-review-bot
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…han/mar-8-ability-to-comment-by-line-of-code-in-pr
maige test |
@@ -289,6 +253,60 @@ export const POST = async (req: Request) => { | |||
|
|||
await incrementUsage(prisma, owner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The incrementUsage
function is defined and used in the app/api/webhook/github/route.ts
file. It is utilized to track and increment the usage count for a customer when processing webhook events.
By Maige. How's my driving?
@@ -167,60 +167,24 @@ export const POST = async (req: Request) => { | |||
if (comment && !comment.body.toLowerCase().includes('maige')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new changes in the webhook route do not include a check for the 'maige' keyword in the comment body, which was present in the original code. This could potentially allow irrelevant comments to trigger the webhook actions.
By Maige. How's my driving?
const diff = await res.text() | ||
|
||
await reviewer({ | ||
customerId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The customerId
parameter is missing in the reviewer
function call within the POST
method. This could lead to runtime errors when the reviewer
function tries to access the customerId
which would be undefined
.
By Maige. How's my driving?
if (!res.ok) return new Response('Could not fetch diff', {status: 503}) | ||
const diff = await res.text() | ||
|
||
await reviewer({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The customerId
is not being passed to the reviewer
function call for the case when issue?.pull_request
is true. This is inconsistent with the other reviewer
function calls and might cause issues if customerId
is expected within the reviewer
function.
By Maige. How's my driving?
if (!res.ok) return new Response('Could not fetch diff', {status: 503}) | ||
const diff = await res.text() | ||
|
||
await reviewer({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The customerId
parameter is not being passed to the reviewer
function call within the POST
method when handling the issue?.pull_request
case. This could lead to runtime errors when the reviewer
function tries to access the customerId
which would be undefined
.
By Maige. How's my driving?
@@ -289,6 +253,60 @@ export const POST = async (req: Request) => { | |||
|
|||
await incrementUsage(prisma, owner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The incrementUsage
function is being called without checking if the usage
has exceeded the usageLimit
. This could lead to overcounting usage and potentially allowing customers to exceed their usage limits without proper checks. Consider adding a check before incrementing usage to ensure that the limit has not been surpassed.
By Maige. How's my driving?
@@ -12,36 +15,110 @@ const model = new ChatOpenAI({ | |||
}) | |||
|
|||
export async function reviewer({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prComment
tool's schema in lib/agents/reviewer.tsx
is outdated. The severity
parameter is no longer used in the prComment
function, as seen in lib/tools/prComment.ts
. Update the schema and function call to match the current implementation of prComment
which only requires a comment
parameter.
By Maige. How's my driving?