From 99d50b3a622e561bcf3744e4b56f778a98e00edb Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 6 Oct 2024 20:06:56 +0900 Subject: [PATCH] remove unused vars --- src/app/(guest)/test/page.tsx | 41 ------------------- src/app/(user)/_components/UserNav.tsx | 2 - .../PullRequestsDistributionChart.tsx | 15 ------- src/app/layout.tsx | 3 +- src/lib/ai/chat/get-answer.ts | 1 + src/lib/ai/chat/tools/get-write-code-tool.ts | 1 + src/lib/ai/get-write-code-command.ts | 6 --- src/lib/github/get-github-access-token.ts | 1 - src/lib/github/write-code-for-github.ts | 1 - src/lib/github/write-code-for-gitlab.ts | 1 - .../find-org-with-slack-team-id.ts | 6 +++ src/lib/ui/PieChart.tsx | 1 - src/queue/jobs/send-daily-reports.ts | 1 - 13 files changed, 9 insertions(+), 71 deletions(-) delete mode 100644 src/app/(guest)/test/page.tsx diff --git a/src/app/(guest)/test/page.tsx b/src/app/(guest)/test/page.tsx deleted file mode 100644 index e7c4f83b..00000000 --- a/src/app/(guest)/test/page.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { dbClient } from '@/database/client' -import { writeCode } from '@/queue/jobs/write-code' -import crypto from 'node:crypto' - -export default async function TestPage() { - const organization = await dbClient - .selectFrom('homie.organization') - .innerJoin( - 'github.organization', - 'github.organization.organization_id', - 'homie.organization.id', - ) - .innerJoin( - 'slack.workspace', - 'slack.workspace.organization_id', - 'homie.organization.id', - ) - .select([ - 'homie.organization.id', - 'ext_gh_install_id', - 'slack_access_token', - 'ext_slack_webhook_channel_id', - ]) - .executeTakeFirstOrThrow() - - await writeCode.dispatch( - { - organization, - instructions: `{ - update navbar color to blue - }`, - github_repo_id: 1, - slack_target_message_ts: '', - slack_channel_id: organization.ext_slack_webhook_channel_id, - }, - { - attempts: 1, - }, - ) - return
hello
-} diff --git a/src/app/(user)/_components/UserNav.tsx b/src/app/(user)/_components/UserNav.tsx index 8884b725..f6054f59 100644 --- a/src/app/(user)/_components/UserNav.tsx +++ b/src/app/(user)/_components/UserNav.tsx @@ -1,8 +1,6 @@ 'use client' -import { Avatar } from '@/lib/ui/Avatar' import { Button } from '@/lib/ui/Button' -import { PersonIcon } from '@radix-ui/react-icons' import { DropdownMenu, DropdownMenuContent, diff --git a/src/app/(user)/pull_requests/_components/PullRequestsDistributionChart.tsx b/src/app/(user)/pull_requests/_components/PullRequestsDistributionChart.tsx index 4c2c2c1b..b28e8824 100644 --- a/src/app/(user)/pull_requests/_components/PullRequestsDistributionChart.tsx +++ b/src/app/(user)/pull_requests/_components/PullRequestsDistributionChart.tsx @@ -4,21 +4,6 @@ import { PullRequest } from '@/app/(user)/pull_requests/_utils/get-pull-requests import PieChart from '@/lib/ui/PieChart' import ChartCard from '@/app/(user)/pull_requests/_components/ChartCard' -const chartConfig = { - repo1: { - label: 'Repo 1', - }, - repo2: { - label: 'Repo 2', - }, - repo3: { - label: 'Repo 2', - }, - repo4: { - label: 'Repo 4', - }, -} - export const prPerRepoData = [ { label: 'Repo 1', diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f9241e5a..4e857cee 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,9 +1,8 @@ import type { Metadata } from 'next' -import { Inter, Onest } from 'next/font/google' +import { Onest } from 'next/font/google' import { ClerkProvider } from '@clerk/nextjs' import localFont from 'next/font/local' import './globals.scss' -import { cn } from '@/lib/utils' import { TooltipProvider } from '@/lib/ui/Tooltip' import Script from 'next/script' import { Toaster } from '@/lib/ui/Toast/Toaster' diff --git a/src/lib/ai/chat/get-answer.ts b/src/lib/ai/chat/get-answer.ts index 96ddc5f1..e9c1d48c 100644 --- a/src/lib/ai/chat/get-answer.ts +++ b/src/lib/ai/chat/get-answer.ts @@ -49,6 +49,7 @@ interface GetAnswerParams { persona_emoji_level: number slack_access_token: string ext_gh_install_id: number | null + gitlab_access_token: string | null trello_access_token: string | null asana_access_token: string | null ext_trello_new_task_list_id: string | null diff --git a/src/lib/ai/chat/tools/get-write-code-tool.ts b/src/lib/ai/chat/tools/get-write-code-tool.ts index 601a68fa..170401fd 100644 --- a/src/lib/ai/chat/tools/get-write-code-tool.ts +++ b/src/lib/ai/chat/tools/get-write-code-tool.ts @@ -8,6 +8,7 @@ interface GetWriteCodeToolParams { organization: { id: number ext_gh_install_id: number | null + gitlab_access_token: string | null slack_access_token: string } answerId: string diff --git a/src/lib/ai/get-write-code-command.ts b/src/lib/ai/get-write-code-command.ts index 3216e779..584df65b 100644 --- a/src/lib/ai/get-write-code-command.ts +++ b/src/lib/ai/get-write-code-command.ts @@ -11,12 +11,6 @@ export function getWriteCodeCommand(params: GetWriteCodeCommandParams) { let command = instructions - console.log('INSTRUCTIONS: ') - console.log(instructions) - - console.log('CONTEXT: ') - console.log(context) - if (context) { command += `\nUse the following context to help write the code by following code style, conventions, and references.` } diff --git a/src/lib/github/get-github-access-token.ts b/src/lib/github/get-github-access-token.ts index bd32423e..b126619d 100644 --- a/src/lib/github/get-github-access-token.ts +++ b/src/lib/github/get-github-access-token.ts @@ -1,5 +1,4 @@ import { - createGithubClient, GithubClient, } from '@/lib/github/create-github-client' diff --git a/src/lib/github/write-code-for-github.ts b/src/lib/github/write-code-for-github.ts index 896b9658..7c373d02 100644 --- a/src/lib/github/write-code-for-github.ts +++ b/src/lib/github/write-code-for-github.ts @@ -140,7 +140,6 @@ export async function writeCodeForGithub( html_url: res.data.html_url, } } catch (error) { - console.error('ERROR: ', error) deleteRepository({ path: directory }) throw error } diff --git a/src/lib/github/write-code-for-gitlab.ts b/src/lib/github/write-code-for-gitlab.ts index 682fc906..ccdd7988 100644 --- a/src/lib/github/write-code-for-gitlab.ts +++ b/src/lib/github/write-code-for-gitlab.ts @@ -134,7 +134,6 @@ export async function writeCodeForGitlab( html_url: res.web_url, } } catch (error) { - console.error('ERROR: ', error) deleteRepository({ path: directory }) throw error } diff --git a/src/lib/organization/find-org-with-slack-team-id.ts b/src/lib/organization/find-org-with-slack-team-id.ts index e37388ef..20b29ad7 100644 --- a/src/lib/organization/find-org-with-slack-team-id.ts +++ b/src/lib/organization/find-org-with-slack-team-id.ts @@ -13,6 +13,11 @@ export const findOrgWithSlackTeamId = async (teamId: string) => { 'github.organization.organization_id', 'homie.organization.id', ) + .leftJoin( + 'gitlab.app_user', + 'gitlab.app_user.organization_id', + 'homie.organization.id', + ) .leftJoin( 'trello.workspace', 'trello.workspace.organization_id', @@ -26,6 +31,7 @@ export const findOrgWithSlackTeamId = async (teamId: string) => { .select([ 'homie.organization.id', 'ext_gh_install_id', + 'gitlab.app_user.gitlab_access_token', 'trello_access_token', 'ext_trello_done_task_list_id', 'ext_trello_new_task_list_id', diff --git a/src/lib/ui/PieChart.tsx b/src/lib/ui/PieChart.tsx index 99a37d15..29b04e5c 100644 --- a/src/lib/ui/PieChart.tsx +++ b/src/lib/ui/PieChart.tsx @@ -2,7 +2,6 @@ import React from 'react' import { Pie, PieChart as RechartsPieChart } from 'recharts' import clsx from 'clsx' import { - ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, diff --git a/src/queue/jobs/send-daily-reports.ts b/src/queue/jobs/send-daily-reports.ts index a9933881..40e7e226 100644 --- a/src/queue/jobs/send-daily-reports.ts +++ b/src/queue/jobs/send-daily-reports.ts @@ -1,7 +1,6 @@ import { createJob } from '@/queue/create-job' import { dbClient } from '@/database/client' import { formatInTimeZone } from 'date-fns-tz' -import { dispatch } from '@/queue/dispatch' import { sendOrganizationDailyReport } from '@/queue/jobs/send-organization-daily-report' export const sendDailyReports = createJob({