{
+ failedPosthogTracking({
+ url: request.url,
+ error: error.message,
+ email: req.email,
+ });
+ return console.error("posting comment error", error);
});
- await addActionLog({
- randomWords,
- github,
- jira,
- slack,
- notion,
- linear,
- asana,
- textToWrite,
- businessLogicSummary,
- owner,
- repo,
- number,
- payload: req,
- count,
- watermelon_user,
- });
// Fetch all comments on the PR
const comments = await octokit.request(
"GET /repos/{owner}/{repo}/issues/{issue_number}/comments?sort=created&direction=desc",
@@ -469,7 +485,9 @@ export async function POST(request: Request) {
);
// Find our bot's comment
let botComment = comments.data.find((comment) => {
- return comment?.user?.login.includes("watermelon-context");
+ return comment?.user?.login.includes(
+ "watermelon-copilot-for-code-review"
+ );
});
if (botComment?.id) {
// Update the existing comment
@@ -502,7 +520,7 @@ export async function POST(request: Request) {
repo,
owner,
number,
- action: req.action,
+ action: actionName,
textToWrite,
},
});
@@ -535,7 +553,7 @@ export async function POST(request: Request) {
// Find our bot's comment
let botComment = comments.data.find((comment) => {
- return comment?.user?.login.includes("watermelon-context");
+ return comment?.user?.login.includes("watermelon-copilot-for-code-review");
});
// Update the existing comment
@@ -557,7 +575,7 @@ export async function POST(request: Request) {
repo,
owner,
number,
- action: req.action,
+ action: actionName,
textToWrite,
},
});
@@ -565,7 +583,7 @@ export async function POST(request: Request) {
message: "success",
textToWrite,
});
- } else if (req.action === "created" || req.action === "edited") {
+ } else if (actionName === "created" || actionName === "edited") {
console.log("comment keys", Object.keys(req));
const { missingParams } = validateParams(req, [
"installation",
@@ -585,7 +603,7 @@ export async function POST(request: Request) {
const userLogin = comment.user.login;
let botComment = comment.body;
if (
- userLogin === "watermelon-context[bot]" &&
+ userLogin === "watermelon-copilot-for-code-review[bot]" &&
botComment.includes("WatermelonAI Summary")
) {
// extract the business logic summary, it's always the first paragraph under the title
@@ -623,11 +641,13 @@ export async function POST(request: Request) {
repo,
owner,
number,
- action: req.action,
+ action: actionName,
businessLogicSummary,
},
});
}
+ } else if (actionName === "deleted") {
+ sendUninstall({ emails: [req.sender.email] });
}
return NextResponse.json({
message: "wat",
diff --git a/app/github-app/page.ts b/app/github-app/page.ts
index c049a6e0a..2cab541ff 100644
--- a/app/github-app/page.ts
+++ b/app/github-app/page.ts
@@ -1,4 +1,4 @@
import { redirect } from 'next/navigation';
export default async function GHApp({ params }) {
- redirect('https://github.com/marketplace/watermelon-context');
+ redirect('https://github.com/marketplace/watermelon-copilot-for-code-review');
}
diff --git a/components/Header.tsx b/components/Header.tsx
index be71c61cb..c3fad1d37 100644
--- a/components/Header.tsx
+++ b/components/Header.tsx
@@ -26,21 +26,11 @@ export default function Header({ userEmail, userToken }) {
GitHub App
-
-
- VSCode Extension
-
-
-