From 891f4a58fa5fe721665c5cf0ee3a3c1e5eed1f61 Mon Sep 17 00:00:00 2001 From: Chris Estreich Date: Mon, 7 Jul 2025 12:22:45 -0800 Subject: [PATCH] Change roomote username (#224) --- .../github/handlers/__tests__/utils.test.ts | 20 +++++++++---------- .../app/api/webhooks/github/handlers/utils.ts | 4 ++-- .../src/lib/jobs/processIssueComment.ts | 4 ++-- .../src/lib/jobs/processPullRequestComment.ts | 2 +- .../src/lib/jobs/processSlackMention.ts | 2 +- .../src/app/(authenticated)/roomote/Jobs.tsx | 7 +++++-- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/apps/roomote/src/app/api/webhooks/github/handlers/__tests__/utils.test.ts b/apps/roomote/src/app/api/webhooks/github/handlers/__tests__/utils.test.ts index e94acb5f71..082d46dd31 100644 --- a/apps/roomote/src/app/api/webhooks/github/handlers/__tests__/utils.test.ts +++ b/apps/roomote/src/app/api/webhooks/github/handlers/__tests__/utils.test.ts @@ -342,7 +342,7 @@ describe('GitHub Webhook Utils', () => { it('should return true for valid roomote mention from regular user', () => { const comment = createMockComment( - 'Hey @roomote, can you help with this?', + 'Hey @roomote-bot, can you help with this?', 'testuser', ); expect(isRoomoteMention(comment)).toBe(true); @@ -358,15 +358,15 @@ describe('GitHub Webhook Utils', () => { it('should return false when comment is from roomote user', () => { const comment = createMockComment( - 'Thanks for mentioning @roomote!', - 'roomote', + 'Thanks for mentioning @roomote-bot!', + 'roomote-bot', ); expect(isRoomoteMention(comment)).toBe(false); }); it('should return false when comment is from vercel[bot]', () => { const comment = createMockComment( - 'Deployment successful! @roomote', + 'Deployment successful! @roomote-bot', 'vercel[bot]', ); expect(isRoomoteMention(comment)).toBe(false); @@ -374,7 +374,7 @@ describe('GitHub Webhook Utils', () => { it('should return true when comment is from vercel (not vercel[bot])', () => { const comment = createMockComment( - 'Hey @roomote, check this out', + 'Hey @roomote-bot, check this out', 'vercel', ); expect(isRoomoteMention(comment)).toBe(true); @@ -382,7 +382,7 @@ describe('GitHub Webhook Utils', () => { it('should handle roomote mention in middle of text', () => { const comment = createMockComment( - 'I think @roomote should look at this issue', + 'I think @roomote-bot should look at this issue', 'developer', ); expect(isRoomoteMention(comment)).toBe(true); @@ -390,7 +390,7 @@ describe('GitHub Webhook Utils', () => { it('should handle multiple mentions including roomote', () => { const comment = createMockComment( - '@user1 @roomote @user2 please review', + '@user1 @roomote-bot @user2 please review', 'reviewer', ); expect(isRoomoteMention(comment)).toBe(true); @@ -414,7 +414,7 @@ describe('GitHub Webhook Utils', () => { it('should return true for other bot users (only roomote and vercel[bot] are ignored)', () => { const comment = createMockComment( - 'Hey @roomote, check this', + 'Hey @roomote-bot, check this', 'github-actions[bot]', ); expect(isRoomoteMention(comment)).toBe(true); @@ -425,8 +425,8 @@ describe('GitHub Webhook Utils', () => { expect(isRoomoteMention(comment)).toBe(false); }); - it('should handle comment with only @roomote', () => { - const comment = createMockComment('@roomote', 'testuser'); + it('should handle comment with only @roomote-bot', () => { + const comment = createMockComment('@roomote-bot', 'testuser'); expect(isRoomoteMention(comment)).toBe(true); }); }); diff --git a/apps/roomote/src/app/api/webhooks/github/handlers/utils.ts b/apps/roomote/src/app/api/webhooks/github/handlers/utils.ts index 4700fee3bc..d1527fb03a 100644 --- a/apps/roomote/src/app/api/webhooks/github/handlers/utils.ts +++ b/apps/roomote/src/app/api/webhooks/github/handlers/utils.ts @@ -100,5 +100,5 @@ export async function fetchGitHubAPI(url: string, options: RequestInit = {}) { } export const isRoomoteMention = (comment: GithubComment) => - comment.body.includes('@roomote') && - !['roomote', 'vercel[bot]'].includes(comment.user.login); + comment.body.includes('@roomote-bot') && + !['roomote-bot', 'vercel[bot]'].includes(comment.user.login); diff --git a/apps/roomote/src/lib/jobs/processIssueComment.ts b/apps/roomote/src/lib/jobs/processIssueComment.ts index dc1fa8e6f0..66efaa1d13 100644 --- a/apps/roomote/src/lib/jobs/processIssueComment.ts +++ b/apps/roomote/src/lib/jobs/processIssueComment.ts @@ -26,7 +26,7 @@ ${jobPayload.commentBody} Comment URL: ${jobPayload.commentUrl} -Please analyze the comment and provide a helpful response. The comment mentions @roomote, which means the user wants you to engage with their question or request. +Please analyze the comment and provide a helpful response. The comment mentions @roomote-bot, which means the user wants you to engage with their question or request. ${CRITICAL_COMMAND_RESTRICTIONS} @@ -40,7 +40,7 @@ Instructions: 5. If the comment is unclear, ask for clarification 6. Use the GitHub CLI or API to respond to the comment with your message -Your goal is to be helpful and engage meaningfully with the community member who mentioned @roomote. +Your goal is to be helpful and engage meaningfully with the community member who mentioned @roomote-bot. Use the "gh" command line tool to respond to the comment: gh api repos/${jobPayload.repo}/issues/comments/${jobPayload.commentId} --method PATCH --field body="Your response here" diff --git a/apps/roomote/src/lib/jobs/processPullRequestComment.ts b/apps/roomote/src/lib/jobs/processPullRequestComment.ts index 4483b90929..eebe0b1e1b 100644 --- a/apps/roomote/src/lib/jobs/processPullRequestComment.ts +++ b/apps/roomote/src/lib/jobs/processPullRequestComment.ts @@ -45,7 +45,7 @@ Instructions: 6. Push the changes to the same PR branch: git push origin ${jobPayload.prBranch} 7. After completing the changes, update your response or add a follow-up comment with the results -The comment mentions @roomote, which means the user wants you to process this request. Make sure to: +The comment mentions @roomote-bot, which means the user wants you to process this request. Make sure to: - Respond to the comment first to acknowledge the request - Understand the context of the PR and the specific request in the comment - Implement the requested changes thoughtfully diff --git a/apps/roomote/src/lib/jobs/processSlackMention.ts b/apps/roomote/src/lib/jobs/processSlackMention.ts index 2526b0e21d..57942a2601 100644 --- a/apps/roomote/src/lib/jobs/processSlackMention.ts +++ b/apps/roomote/src/lib/jobs/processSlackMention.ts @@ -23,7 +23,7 @@ User: @${user} Original Request: ${originalPrompt} -Please analyze the request and implement the necessary changes. The user mentioned @roomote, which means they want you to engage with their request. +Please analyze the request and implement the necessary changes. The user mentioned @roomote-bot, which means they want you to engage with their request. ${CRITICAL_COMMAND_RESTRICTIONS} diff --git a/apps/web/src/app/(authenticated)/roomote/Jobs.tsx b/apps/web/src/app/(authenticated)/roomote/Jobs.tsx index b8f9a912ed..88d28ff6c1 100644 --- a/apps/web/src/app/(authenticated)/roomote/Jobs.tsx +++ b/apps/web/src/app/(authenticated)/roomote/Jobs.tsx @@ -115,8 +115,11 @@ export function Jobs({ userId }: JobsProps) { {jobs.length === 0 ? ( -
- No jobs found. Create your first job using the form above. +
+ No tasks found. +
) : (