Skip to content
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

Merged

Conversation

arihanv
Copy link
Contributor

@arihanv 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.

Copy link

vercel bot commented Dec 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
maige ✅ Ready (Inspect) Visit Preview Dec 8, 2023 7:14pm

@arihanv arihanv changed the base branch from main to staging December 6, 2023 02:58
@arihanv arihanv requested a review from tedspare December 6, 2023 02:58
@tedspare
Copy link
Collaborator

tedspare commented Dec 8, 2023

maige test

@@ -289,6 +253,60 @@ export const POST = async (req: Request) => {

await incrementUsage(prisma, owner)
Copy link

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'))
Copy link

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,
Copy link

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({
Copy link

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({
Copy link

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)
Copy link

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({
Copy link

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?

@tedspare tedspare merged commit f331f8d into staging Dec 8, 2023
@tedspare tedspare deleted the arihan/mar-8-ability-to-comment-by-line-of-code-in-pr branch January 30, 2024 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants