hirokisakabe / tascal-old

Simple todo list app
https://tascal.vercel.app
MIT License
0 stars 0 forks source link

Revert "Merge pull request #121 from hirokisakabe/llm-code-review" #124

Closed hirokisakabe closed 1 year ago

hirokisakabe commented 1 year ago

This reverts commit 1b25cfa114e797aa3e03c77e439def47b7ea33b0, reversing changes made to 0c70975e141913406e5f9d3dd3aa30a93fc3dc77.

121 でcode-review-gptを導入したが、うまく動作していないので一旦revertする

https://github.com/hirokisakabe/tascal/actions/runs/6170707310/job/16747483490?pr=123

エラーログ(一部抜粋) ``` 2023-09-13T09:39:41.4928938Z ##[group]Run npx code-review-gpt review --ci=github 2023-09-13T09:39:41.4929398Z npx code-review-gpt review --ci=github 2023-09-13T09:39:41.4993923Z shell: /usr/bin/bash -e {0} 2023-09-13T09:39:41.4994285Z env: 2023-09-13T09:39:41.4995299Z GITHUB_TOKEN: *** 2023-09-13T09:39:41.4995644Z BASE_SHA: 9841d91fe1c744a65edccc32a9c7b1a8c8eb3e2e 2023-09-13T09:39:41.4996056Z GITHUB_SHA: 33af2de3c83e7a9aa87607ed7352934f9b48f0b2 2023-09-13T09:39:41.4996576Z OPENAI_API_KEY: *** 2023-09-13T09:39:41.4996850Z ##[endgroup] 2023-09-13T09:39:42.6527848Z ERROR Error in callModelJSON 2023-09-13T09:39:42.6528482Z 2023-09-13T09:39:42.6529848Z  Error  Request failed with status code 404, [object Object], [object Object], [object Object], true, function toJSON() { 2023-09-13T09:39:42.6538559Z return { 2023-09-13T09:39:42.6539671Z // Standard 2023-09-13T09:39:42.6540188Z message: this.message, 2023-09-13T09:39:42.6541005Z name: this.name, 2023-09-13T09:39:42.6541470Z // Microsoft 2023-09-13T09:39:42.6542219Z description: this.description, 2023-09-13T09:39:42.6542732Z number: this.number, 2023-09-13T09:39:42.6543450Z // Mozilla 2023-09-13T09:39:42.6546697Z fileName: this.fileName, 2023-09-13T09:39:42.6552086Z lineNumber: this.lineNumber, 2023-09-13T09:39:42.6552638Z columnNumber: this.columnNumber, 2023-09-13T09:39:42.6553255Z stack: this.stack, 2023-09-13T09:39:42.6554541Z // Axios 2023-09-13T09:39:42.6555065Z config: this.config, 2023-09-13T09:39:42.6555545Z code: this.code, 2023-09-13T09:39:42.6556536Z status: this.response && this.response.status ? this.response.status : null 2023-09-13T09:39:42.6557086Z }; 2023-09-13T09:39:42.6558132Z }, 1, 6 2023-09-13T09:39:42.6558618Z error stack: 2023-09-13T09:39:42.6559738Z • createError.js createError 2023-09-13T09:39:42.6560448Z /node_modules/axios/lib/core/createError.js:16 2023-09-13T09:39:42.6561052Z • settle.js settle 2023-09-13T09:39:42.6561652Z /node_modules/axios/lib/core/settle.js:17 2023-09-13T09:39:42.6562342Z • http.js IncomingMessage.handleStreamEnd 2023-09-13T09:39:42.6563031Z /node_modules/axios/lib/adapters/http.js:322 2023-09-13T09:39:42.6563648Z • events IncomingMessage.emit 2023-09-13T09:39:42.6564498Z events:526 2023-09-13T09:39:42.6564956Z • readable endReadableNT 2023-09-13T09:39:42.6565471Z internal/streams/readable:1359 2023-09-13T09:39:42.6566110Z • task_queues process.processTicksAndRejections 2023-09-13T09:39:42.6566809Z internal/process/task_queues:82 2023-09-13T09:39:42.7023532Z ERROR Error in callModelJSON 2023-09-13T09:39:42.7024095Z 2023-09-13T09:39:42.7025847Z  Error  Request failed with status code 404, [object Object], [object Object], [object Object], true, function toJSON() { 2023-09-13T09:39:42.7026553Z return { 2023-09-13T09:39:42.7027498Z // Standard 2023-09-13T09:39:42.7027814Z message: this.message, 2023-09-13T09:39:42.7028331Z name: this.name, 2023-09-13T09:39:42.7029584Z // Microsoft 2023-09-13T09:39:42.7030136Z description: this.description, 2023-09-13T09:39:42.7030568Z number: this.number, 2023-09-13T09:39:42.7031227Z // Mozilla 2023-09-13T09:39:42.7032132Z fileName: this.fileName, 2023-09-13T09:39:42.7032774Z lineNumber: this.lineNumber, 2023-09-13T09:39:42.7033373Z columnNumber: this.columnNumber, 2023-09-13T09:39:42.7033918Z stack: this.stack, 2023-09-13T09:39:42.7034688Z // Axios 2023-09-13T09:39:42.7035466Z config: this.config, 2023-09-13T09:39:42.7036176Z code: this.code, 2023-09-13T09:39:42.7037612Z status: this.response && this.response.status ? this.response.status : null 2023-09-13T09:39:42.7038560Z }; 2023-09-13T09:39:42.7039078Z }, 1, 6 2023-09-13T09:39:42.7039779Z error stack: 2023-09-13T09:39:42.7040654Z • createError.js createError 2023-09-13T09:39:42.7041340Z /node_modules/axios/lib/core/createError.js:16 2023-09-13T09:39:42.7041969Z • settle.js settle 2023-09-13T09:39:42.7042591Z /node_modules/axios/lib/core/settle.js:17 2023-09-13T09:39:42.7043301Z • http.js IncomingMessage.handleStreamEnd 2023-09-13T09:39:42.7044030Z /node_modules/axios/lib/adapters/http.js:322 2023-09-13T09:39:42.7044643Z • events IncomingMessage.emit 2023-09-13T09:39:42.7045147Z events:526 2023-09-13T09:39:42.7045869Z • readable endReadableNT 2023-09-13T09:39:42.7046473Z internal/streams/readable:1359 2023-09-13T09:39:42.7047194Z • task_queues process.processTicksAndRejections 2023-09-13T09:39:42.7047887Z internal/process/task_queues:82 2023-09-13T09:39:42.9751443Z ERROR Error in callModelJSON 2023-09-13T09:39:42.9759897Z 2023-09-13T09:39:42.9761201Z  Error  Request failed with status code 404, [object Object], [object Object], [object Object], true, function toJSON() { 2023-09-13T09:39:42.9761696Z return { 2023-09-13T09:39:42.9762073Z // Standard 2023-09-13T09:39:42.9763008Z message: this.message, 2023-09-13T09:39:42.9763691Z name: this.name, 2023-09-13T09:39:42.9764900Z // Microsoft 2023-09-13T09:39:42.9765424Z description: this.description, 2023-09-13T09:39:42.9765862Z number: this.number, 2023-09-13T09:39:42.9766669Z // Mozilla 2023-09-13T09:39:42.9767437Z fileName: this.fileName, 2023-09-13T09:39:42.9768140Z lineNumber: this.lineNumber, 2023-09-13T09:39:42.9768602Z columnNumber: this.columnNumber, 2023-09-13T09:39:42.9769206Z stack: this.stack, 2023-09-13T09:39:42.9769581Z // Axios 2023-09-13T09:39:42.9769883Z config: this.config, 2023-09-13T09:39:42.9770211Z code: this.code, 2023-09-13T09:39:42.9770817Z status: this.response && this.response.status ? this.response.status : null 2023-09-13T09:39:42.9771292Z }; 2023-09-13T09:39:42.9771655Z }, 1, 6 2023-09-13T09:39:42.9772038Z error stack: 2023-09-13T09:39:42.9772686Z • createError.js createError 2023-09-13T09:39:42.9773328Z /node_modules/axios/lib/core/createError.js:16 2023-09-13T09:39:42.9776078Z • settle.js settle 2023-09-13T09:39:42.9776620Z /node_modules/axios/lib/core/settle.js:17 2023-09-13T09:39:42.9777281Z • http.js IncomingMessage.handleStreamEnd 2023-09-13T09:39:42.9778050Z /node_modules/axios/lib/adapters/http.js:322 2023-09-13T09:39:42.9778587Z • events IncomingMessage.emit 2023-09-13T09:39:42.9779007Z events:526 2023-09-13T09:39:42.9779472Z • readable endReadableNT 2023-09-13T09:39:42.9779972Z internal/streams/readable:1359 2023-09-13T09:39:42.9780888Z • task_queues process.processTicksAndRejections 2023-09-13T09:39:42.9786386Z internal/process/task_queues:82 2023-09-13T09:39:43.0352409Z ERROR Error in callModelJSON 2023-09-13T09:39:43.0353559Z 2023-09-13T09:39:43.0355889Z  Error  Request failed with status code 404, [object Object], [object Object], [object Object], true, function toJSON() { 2023-09-13T09:39:43.0356545Z return { 2023-09-13T09:39:43.0357929Z // Standard 2023-09-13T09:39:43.0358393Z message: this.message, 2023-09-13T09:39:43.0359556Z name: this.name, 2023-09-13T09:39:43.0359983Z // Microsoft 2023-09-13T09:39:43.0361084Z description: this.description, 2023-09-13T09:39:43.0361527Z number: this.number, 2023-09-13T09:39:43.0362424Z // Mozilla 2023-09-13T09:39:43.0363300Z fileName: this.fileName, 2023-09-13T09:39:43.0363767Z lineNumber: this.lineNumber, 2023-09-13T09:39:43.0364545Z columnNumber: this.columnNumber, 2023-09-13T09:39:43.0364967Z stack: this.stack, 2023-09-13T09:39:43.0365709Z // Axios 2023-09-13T09:39:43.0366946Z config: this.config, 2023-09-13T09:39:43.0368335Z code: this.code, 2023-09-13T09:39:43.0369021Z status: this.response && this.response.status ? this.response.status : null 2023-09-13T09:39:43.0373173Z }; 2023-09-13T09:39:43.0373621Z }, 1, 6 2023-09-13T09:39:43.0373940Z error stack: 2023-09-13T09:39:43.0374495Z • createError.js createError 2023-09-13T09:39:43.0375226Z /node_modules/axios/lib/core/createError.js:16 2023-09-13T09:39:43.0375745Z • settle.js settle 2023-09-13T09:39:43.0376254Z /node_modules/axios/lib/core/settle.js:17 2023-09-13T09:39:43.0376868Z • http.js IncomingMessage.handleStreamEnd 2023-09-13T09:39:43.0377887Z /node_modules/axios/lib/adapters/http.js:322 2023-09-13T09:39:43.0378445Z • events IncomingMessage.emit 2023-09-13T09:39:43.0378843Z events:526 2023-09-13T09:39:43.0379751Z • readable endReadableNT 2023-09-13T09:39:43.0380671Z internal/streams/readable:1359 2023-09-13T09:39:43.0382676Z • task_queues process.processTicksAndRejections 2023-09-13T09:39:43.0383657Z internal/process/task_queues:82 2023-09-13T09:39:43.3167326Z ERROR Error in processing prompt 2023-09-13T09:39:43.3167885Z 2023-09-13T09:39:43.3168988Z  Error  Couldn't call model after 3 tries with prompt: You are an expert TypeScript developer, your task is to review a set of pull requests. 2023-09-13T09:39:43.3170003Z You are given a list of filenames and their partial contents, but note that you might not have the full context of the code. 2023-09-13T09:39:43.3171172Z 2023-09-13T09:39:43.3173456Z Only review lines of code which have been changed (added or removed) in the pull request. The code looks similar to the output of a git diff command. Lines which have been removed are prefixed with a minus (-) and lines which have been added are prefixed with a plus (+). Other lines are added to provide context but should be ignored in the review. 2023-09-13T09:39:43.3174267Z 2023-09-13T09:39:43.3175447Z Begin your review by evaluating the changed code using a risk score similar to a LOGAF score but measured from 1 to 5, where 1 is the lowest risk to the code base if the code is merged and 5 is the highest risk which would likely break something or be unsafe. 2023-09-13T09:39:43.3176624Z 2023-09-13T09:39:43.3177948Z In your feedback, focus on highlighting potential bugs, improving readability if it is a problem, making code cleaner, and maximising the performance of the programming language. Flag any API keys or secrets present in the code in plain text immediately as highest risk. Rate the changes based on SOLID principles if applicable. 2023-09-13T09:39:43.3178724Z 2023-09-13T09:39:43.3179789Z Do not comment on breaking functions down into smaller, more manageable functions unless it is a huge problem. Also be aware that there will be libraries and techniques used which you are not familiar with, so do not comment on those unless you are confident that there is a problem. 2023-09-13T09:39:43.3180902Z 2023-09-13T09:39:43.3181751Z Use markdown formatting for the feedback details. Also do not include the filename or risk level in the feedback details. 2023-09-13T09:39:43.3182131Z 2023-09-13T09:39:43.3183276Z Ensure the feedback details are brief, concise, accurate. If there are multiple similar issues, only comment on the most critical. 2023-09-13T09:39:43.3183892Z 2023-09-13T09:39:43.3185489Z Include brief example code snippets in the feedback details for your suggested changes when you're confident your suggestions are improvements. Use the same programming language as the file under review. 2023-09-13T09:39:43.3186763Z If there are multiple improvements you suggest in the feedback details, use an ordered list to indicate the priority of the changes. 2023-09-13T09:39:43.3187271Z 2023-09-13T09:39:43.3209933Z Format the response in a valid JSON format as a list of feedbacks, where the value is an object containing the filename ("fileName"), risk score ("riskScore") and the feedback ("details"). The schema of the JSON feedback object must be: 2023-09-13T09:39:43.3211232Z { 2023-09-13T09:39:43.3212770Z "fileName": { 2023-09-13T09:39:43.3213229Z "type": "string" 2023-09-13T09:39:43.3213844Z }, 2023-09-13T09:39:43.3214099Z "riskScore": { 2023-09-13T09:39:43.3214361Z "type": "number" 2023-09-13T09:39:43.3214618Z }, 2023-09-13T09:39:43.3214864Z "details": { 2023-09-13T09:39:43.3215130Z "type": "string" 2023-09-13T09:39:43.3215462Z } 2023-09-13T09:39:43.3215746Z } 2023-09-13T09:39:43.3216110Z 2023-09-13T09:39:43.3216799Z The filenames and file contents to review are provided below as a list of JSON objects: 2023-09-13T09:39:43.3217128Z 2023-09-13T09:39:43.3278081Z [{"fileName":"/home/runner/work/tascal/tascal/src/components/task-calender-tab/task-calender.tsx","promptContent":"import { useState } from \"react\";\nimport { format } from \"date-fns\";\n+import { Grid, Flex } from \"@tremor/react\";\nimport { ChevronRightIcon, ChevronLeftIcon } from \"@heroicons/react/24/solid\";\n+import { Typography } from \"../parts\";\nimport { CreateTaskButton } from \"./create-task-button\";\nimport { TaskBoxContainer } from \"./task-box-container\";\nimport { Task, YearMonthDay, convertYearMonthDayToStr } from \"@/model\";\n\ntype Props = {\n title: string;\n calenderData: {\n ymd: {\n year: number;\n month: number;\n day: number;\n };\n tasks: Task[];\n }[];\n moveToBefore: () => unknown;\n moveToAfter: () => unknown;\n firstDayOfNumber: 0 | 2 | 1 | 3 | 4 | 5 | 6;\n lastDayOfNumber: 0 | 2 | 1 | 3 | 4 | 5 | 6;\n};\n\nexport function TaskCalender(props: Props) {\n const {\n title,\n calenderData,\n moveToBefore,\n moveToAfter,\n firstDayOfNumber,\n lastDayOfNumber,\n } = props;\n\n+ return (\n
\n \n
\n \n+
\n
\n+ {title}\n+
\n
\n \n
\n
\n
\n \n
\n
\n+ );\n}\n\nfunction Calender({\n data,\n firstDayOfNumber,\n lastDayOfNumber,\n}: {\n data: { ymd: YearMonthDay; tasks: Task[] }[];\n firstDayOfNumber: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n lastDayOfNumber: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n}) {\n return (\n \n {[...Array(7)]\n .map((_, i) => i)\n .map((i) => (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n \n ))}\n {[...Array(firstDayOfNumber)]\n .map((_, i) => i)\n .map((i) => (\n \n ))}\n {data.map(({ ymd, tasks }) => (\n \n ))}\n {[...Array(6 - lastDayOfNumber)]\n .map((_, i) => i)\n .map((i) => (\n \n ))}\n \n );\n}\n\nfunction CalenderBeforeMonthDayCell() {\n return
;\n}\n\nfunction CalenderDayCell({ ymd, tasks }: { ymd: YearMonthDay; tasks: Task[] }) {\n const [showAll, setShowAll] = useState(false);\n\n const DEFAULT_NUMBER_OF_TASKS_TO_SHOW = 3;\n const needShowMore = tasks.length > DEFAULT_NUMBER_OF_TASKS_TO_SHOW;\n\n const tasksToShow = (() => {\n if (showAll) {\n return tasks;\n }\n return needShowMore\n ? tasks.slice(0, DEFAULT_NUMBER_OF_TASKS_TO_SHOW)\n : tasks;\n })();\n const numberOfDummyTasks = needShowMore\n ? 0\n : DEFAULT_NUMBER_OF_TASKS_TO_SHOW - tasks.length;\n\n const isToday =\n convertYearMonthDayToStr(ymd) === format(new Date(), \"yyyy-MM-dd\");\n\n return (\n
\n
\n
\n
\n {isToday ? (\n
\n {ymd.day} 日\n
\n ) : (\n
{ymd.day} 日
\n )}\n
\n
\n
\n \n
\n
\n
\n
\n {tasksToShow.map((task) => (\n
\n \n
\n ))}\n
\n {[...Array(numberOfDummyTasks)]\n .map((_, i) => i)\n .map((i) => (\n+
\n+ ____\n
\n ))}\n {(() => {\n if (!needShowMore) {\n return (\n+
\n+ ____\n
\n );\n }\n\n return showAll ? (\n
\n \n
\n ) : (\n
\n \n
\n );\n })()}\n
\n
\n );\n}\n\nfunction CalenderDayNameCell({\n dayNumber,\n}: {\n dayNumber: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n}) {\n return (\n
\n
\n {convertDateToDayName(dayNumber)}\n
\n
\n );\n}\n\nfunction convertDateToDayName(dayNumber: 0 | 1 | 2 | 3 | 4 | 5 | 6) {\n const dayName = (() => {\n switch (dayNumber) {\n case 0:\n return \"日\";\n case 1:\n return \"月\";\n case 2:\n return \"火\";\n case 3:\n return \"水\";\n case 4:\n return \"木\";\n case 5:\n return \"金\";\n case 6:\n return \"土\";\n }\n })();\n\n return dayName;\n}"},{"fileName":"/home/runner/work/tascal/tascal/src/components/task-list-tab/task-card.tsx","promptContent":"import { CheckCircleIcon } from \"@heroicons/react/24/solid\";\n+import { Typography } from \"../parts\";\nimport { Task } from \"@/model\";\n\ntype Props = { task: Task; completeTask: ({ id }: { id: string }) => unknown };\n\nexport function TaskCard(props: Props) {\n const { task, completeTask } = props;\n\n return (\n \n
\n+
\n+ {task.title}\n+
\n
\n
\n
\n {task.isCompleted ? (\n \n ) : (\n \n )}\n
\n
\n
\n );\n}"}] 2023-09-13T09:39:43.3312585Z error stack: 2023-09-13T09:39:43.3314679Z • index.js Object.onMaxRetryFunc 2023-09-13T09:39:43.3315557Z /node_modules/code-review-gpt/dist/index.js:55 2023-09-13T09:39:43.3316173Z • retry.js  2023-09-13T09:39:43.3316794Z /node_modules/ts-retry/lib/cjs/retry/retry.js:55 2023-09-13T09:39:43.3319155Z •   2023-09-13T09:39:43.3321564Z  2023-09-13T09:39:43.3322176Z • retry.js rejected 2023-09-13T09:39:43.3322808Z /node_modules/ts-retry/lib/cjs/retry/retry.js:6 2023-09-13T09:39:43.3323549Z • task_queues process.processTicksAndRejections 2023-09-13T09:39:43.3324226Z internal/process/task_queues:95 2023-09-13T09:39:43.3605552Z ERROR Error in processing prompt 2023-09-13T09:39:43.3605891Z 2023-09-13T09:39:43.3606804Z  Error  Couldn't call model after 3 tries with prompt: You are an expert TypeScript developer, your task is to review a set of pull requests. 2023-09-13T09:39:43.3607810Z You are given a list of filenames and their partial contents, but note that you might not have the full context of the code. 2023-09-13T09:39:43.3608203Z 2023-09-13T09:39:43.3609834Z Only review lines of code which have been changed (added or removed) in the pull request. The code looks similar to the output of a git diff command. Lines which have been removed are prefixed with a minus (-) and lines which have been added are prefixed with a plus (+). Other lines are added to provide context but should be ignored in the review. 2023-09-13T09:39:43.3610627Z 2023-09-13T09:39:43.3611605Z Begin your review by evaluating the changed code using a risk score similar to a LOGAF score but measured from 1 to 5, where 1 is the lowest risk to the code base if the code is merged and 5 is the highest risk which would likely break something or be unsafe. 2023-09-13T09:39:43.3612225Z 2023-09-13T09:39:43.3613469Z In your feedback, focus on highlighting potential bugs, improving readability if it is a problem, making code cleaner, and maximising the performance of the programming language. Flag any API keys or secrets present in the code in plain text immediately as highest risk. Rate the changes based on SOLID principles if applicable. 2023-09-13T09:39:43.3614636Z 2023-09-13T09:39:43.3615724Z Do not comment on breaking functions down into smaller, more manageable functions unless it is a huge problem. Also be aware that there will be libraries and techniques used which you are not familiar with, so do not comment on those unless you are confident that there is a problem. 2023-09-13T09:39:43.3616385Z 2023-09-13T09:39:43.3616905Z Use markdown formatting for the feedback details. Also do not include the filename or risk level in the feedback details. 2023-09-13T09:39:43.3617709Z 2023-09-13T09:39:43.3618266Z Ensure the feedback details are brief, concise, accurate. If there are multiple similar issues, only comment on the most critical. 2023-09-13T09:39:43.3618661Z 2023-09-13T09:39:43.3619905Z Include brief example code snippets in the feedback details for your suggested changes when you're confident your suggestions are improvements. Use the same programming language as the file under review. 2023-09-13T09:39:43.3621010Z If there are multiple improvements you suggest in the feedback details, use an ordered list to indicate the priority of the changes. 2023-09-13T09:39:43.3621410Z 2023-09-13T09:39:43.3622319Z Format the response in a valid JSON format as a list of feedbacks, where the value is an object containing the filename ("fileName"), risk score ("riskScore") and the feedback ("details"). The schema of the JSON feedback object must be: 2023-09-13T09:39:43.3622957Z { 2023-09-13T09:39:43.3623214Z "fileName": { 2023-09-13T09:39:43.3623498Z "type": "string" 2023-09-13T09:39:43.3623753Z }, 2023-09-13T09:39:43.3623985Z "riskScore": { 2023-09-13T09:39:43.3624257Z "type": "number" 2023-09-13T09:39:43.3624507Z }, 2023-09-13T09:39:43.3624745Z "details": { 2023-09-13T09:39:43.3624999Z "type": "string" 2023-09-13T09:39:43.3625243Z } 2023-09-13T09:39:43.3625691Z } 2023-09-13T09:39:43.3625855Z 2023-09-13T09:39:43.3626280Z The filenames and file contents to review are provided below as a list of JSON objects: 2023-09-13T09:39:43.3626605Z 2023-09-13T09:39:43.3715901Z [{"fileName":"/home/runner/work/tascal/tascal/src/components/dialog/common-confirm-dialog.tsx","promptContent":"+import { Button, Flex } from \"@tremor/react\";\nimport { useCallback } from \"react\";\n+import { Typography } from \"../parts\";\nimport { CommonDialog } from \"./common-dialog\";\n\nexport function CommonConfirmDialog({\n isOpen,\n handleClose,\n onSubmit,\n title,\n message,\n}: {\n isOpen: boolean;\n handleClose: () => unknown;\n onSubmit: () => unknown;\n title: string;\n message: string;\n}) {\n const onClickOK = useCallback(() => {\n onSubmit();\n handleClose();\n }, [onSubmit, handleClose]);\n\n return (\n \n
\n
\n+ {message}\n
\n
\n \n \n \n \n \n \n
\n );\n}"},{"fileName":"/home/runner/work/tascal/tascal/src/components/dialog/common-dialog.tsx","promptContent":"import { Dialog, Transition } from \"@headlessui/react\";\nimport { Fragment, ReactNode } from \"react\";\n+import { Typography } from \"../parts\";\n\nexport function CommonDialog({\n isOpen,\n handleClose,\n title,\n children,\n}: {\n isOpen: boolean;\n handleClose: () => void;\n title: string;\n children: ReactNode;\n}) {\n return (\n \n \n \n
\n \n\n
\n
\n \n \n \n+ {title}\n \n {children}\n \n \n
\n
\n
\n
\n );\n}"},{"fileName":"/home/runner/work/tascal/tascal/src/components/dialog/create-category-dialog.tsx","promptContent":"+import { Button, Flex, TextInput } from \"@tremor/react\";\nimport { useCallback } from \"react\";\nimport { useForm } from \"react-hook-form\";\n+import { Typography } from \"../parts\";\nimport { CommonDialog } from \"./common-dialog\";\nimport { createCategory } from \"@/lib\";\n\nexport function CreateCategoryDialog({\n isOpen,\n handleClose,\n}: {\n isOpen: boolean;\n handleClose: () => unknown;\n}) {\n const { register, handleSubmit, reset } = useForm();\n\n const onSubmit = useCallback(\n async (data: { [x: string]: unknown }) => {\n const name = data[\"input-category-name\"];\n const color = data[\"input-category-color\"];\n\n if (!(typeof name === \"string\")) {\n console.error(`name is invalid: ${name}`);\n return;\n }\n\n if (!(typeof color === \"string\")) {\n console.error(`color is invalid: ${color}`);\n return;\n }\n\n await createCategory({\n name,\n color,\n });\n reset();\n handleClose();\n },\n [reset, handleClose],\n );\n\n return (\n \n
\n
\n
\n+ カテゴリ名\n
\n \n
\n
\n
\n+ \n
\n \n
\n \n \n \n \n \n \n
\n \n );\n}"},{"fileName":"/home/runner/work/tascal/tascal/src/components/dialog/create-task-dialog.tsx","promptContent":"+import { Button, Flex, TextInput } from \"@tremor/react\";\nimport { useCallback, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\n+import { Typography } from \"../parts\";\nimport { CommonDialog } from \"./common-dialog\";\nimport { CommonSelect } from \"./common-select\";\nimport { createTask, useCategories } from \"@/lib\";\nimport { YearMonthDay, convertYearMonthDayToStr } from \"@/model\";\n\nexport function CreateTaskDialog({\n isOpen,\n handleClose,\n initialYmd,\n}: {\n isOpen: boolean;\n handleClose: () => unknown;\n initialYmd?: YearMonthDay;\n}) {\n const { register, handleSubmit, reset } = useForm({\n defaultValues: {\n \"input-task-title\": undefined,\n \"input-task-target-date\":\n initialYmd && convertYearMonthDayToStr(initialYmd),\n },\n });\n\n const categories = useCategories();\n const [selectedCategory, setSelectedCategory] = useState<\n | {\n id: string;\n name: string;\n }\n | undefined\n >(undefined);\n\n const onSubmit = useCallback(\n async (data: { [x: string]: unknown }) => {\n const title = data[\"input-task-title\"];\n const targetDate = data[\"input-task-target-date\"];\n\n if (!(typeof title === \"string\")) {\n console.error(`title is invalid: ${title}`);\n return;\n }\n\n if (\n !(typeof targetDate === \"string\" || typeof targetDate === \"undefined\")\n ) {\n console.error(`targetDate is invalid: ${targetDate}`);\n return;\n }\n\n await createTask({\n title,\n targetDate,\n });\n reset();\n handleClose();\n },\n [reset, handleClose],\n );\n\n return (\n \n
\n
\n
\n+ タイトル\n
\n \n
\n
\n
\n+ 実施日\n
\n \n
\n
\n
\n+ カテゴリ\n
\n {categories && (\n \n )}\n
\n \n \n \n \n \n \n
\n \n );\n}"},{"fileName":"/home/runner/work/tascal/tascal/src/components/dialog/edit-task-dialog.tsx","promptContent":"+import { Button, Flex, TextInput } from \"@tremor/react\";\nimport { useCallback, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\n+import { Typography } from \"../parts\";\nimport { CommonDialog } from \"./common-dialog\";\nimport { CommonConfirmDialog } from \"./common-confirm-dialog\";\nimport { CommonSelect } from \"./common-select\";\nimport { deleteTask, updateTask, useCategories } from \"@/lib\";\nimport { Task } from \"@/model\";\n\nexport function EditTaskDialog({\n isOpen,\n handleClose,\n task,\n}: {\n isOpen: boolean;\n handleClose: () => unknown;\n task: Task;\n}) {\n const { register, handleSubmit, reset } = useForm({\n defaultValues: {\n \"input-task-title\": task.title,\n \"input-task-target-date\": task.targetDate,\n },\n });\n\n const categories = useCategories();\n const [selectedCategory, setSelectedCategory] = useState<\n | {\n id: string;\n name: string;\n }\n | undefined\n >(\n task.category\n ? { id: task.category.id, name: task.category.name }\n : undefined,\n );\n\n const onSubmit = useCallback(\n async (data: { [x: string]: unknown }) => {\n const title = data[\"input-task-title\"];\n const targetDate = data[\"input-task-target-date\"];\n\n if (!(typeof title === \"string\")) {\n console.error(`title is invalid: ${title}`);\n return;\n }\n\n if (\n !(typeof targetDate === \"string\" || typeof targetDate === \"undefined\")\n ) {\n console.error(`targetDate is invalid: ${targetDate}`);\n return;\n }\n\n await updateTask({\n id: task.id,\n title,\n targetDate,\n categoryId: selectedCategory ? selectedCategory.id : null,\n });\n reset();\n handleClose();\n },\n [task.id, selectedCategory, reset, handleClose],\n );\n\n const [isOpenDialog, setIsOpenDialog] = useState(false);\n const openDialog = useCallback(() => setIsOpenDialog(true), []);\n const closeDialog = useCallback(() => setIsOpenDialog(false), []);\n\n const onSubmitDelete = useCallback(async () => {\n await deleteTask({ id: task.id });\n handleClose();\n }, [task.id, handleClose]);\n\n return (\n <>\n \n
\n
\n
\n+ タイトル\n
\n \n
\n
\n
\n+ 実施日\n
\n \n
\n
\n
\n+ カテゴリ\n
\n {categories && (\n \n )}\n
\n \n \n \n \n \n \n \n
\n \n \n \n );\n}"},{"fileName":"/home/runner/work/tascal/tascal/src/components/header/header.tsx","promptContent":"+import { Typography } from \"../parts\";\nimport { HeaderMenu } from \"./header-menu\";\n\nexport function Header() {\n return (\n
\n
\n+ Tascal\n
\n
\n \n
\n
\n );\n}"},{"fileName":"/home/runner/work/tascal/tascal/src/components/pages/dashboard-page.tsx","promptContent":"\"use client\";\n\nimport { redirect } from \"next/navigation\";\nimport { Tab } from \"@headlessui/react\";\nimport { Header } from \"../header\";\nimport { TaskCalenderTab } from \"../task-calender-tab\";\nimport { TaskListTab } from \"../task-list-tab\";\n+import { Typography } from \"../parts\";\nimport { useAuth } from \"@/lib\";\n\nexport function DashboardPage() {\n const auth = useAuth();\n\n if (auth.status === \"loading\") {\n return (\n
\n
Loading...
\n
\n );\n }\n if (auth.status === \"not_authenticated\") {\n redirect(\"/\");\n }\n\n return (\n
\n
\n
\n
\n
\n \n \n \n classNames(\n \"px-2 py-2.5 text-sm font-medium leading-5\",\n selected\n ? \"text-blue-700 underline decoration-sky-500 underline-offset-8\"\n : \"text-black\",\n )\n }\n >\n+ タスク一覧\n \n \n classNames(\n \"px-2 py-2.5 text-sm font-medium leading-5\",\n selected\n ? \"text-blue-700 underline decoration-sky-500 underline-offset-8\"\n : \"text-black\",\n )\n }\n >\n+ カレンダー\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n );\n}\n\nfunction classNames(...classes: string[]) {\n return classes.filter(Boolean).join(\" \");\n}"},{"fileName":"/home/runner/work/tascal/tascal/src/components/parts/index.ts","promptContent":"+export * from \"./typography\";"},{"fileName":"/home/runner/work/tascal/tascal/src/components/parts/typography.tsx","promptContent":"+type Props = { children: string; size?: \"text-xl\" | \"text-2xl\" };\n+\n+export function Typography({ children, size }: Props) {\n+ return
{children}
;\n+}"},{"fileName":"/home/runner/work/tascal/tascal/src/components/task-calender-tab/task-box.tsx","promptContent":"import { useCallback, useState } from \"react\";\nimport { CheckCircleIcon } from \"@heroicons/react/24/solid\";\n+import { Typography } from \"../parts\";\nimport { EditTaskDialog } from \"@/components/dialog\";\nimport { Task } from \"@/model\";\n\ntype Props = { task: Task; completeTask: ({ id }: { id: string }) => unknown };\n\nexport function TaskBox({ task, completeTask }: Props) {\n const [isOpenDialog, setIsOpenDialog] = useState(false);\n const openDialog = useCallback(() => setIsOpenDialog(true), []);\n const closeDialog = useCallback(() => setIsOpenDialog(false), []);\n\n return (\n <>\n \n
\n \n+
\n+ {task.title}\n+
\n \n
\n
\n
\n {task.isCompleted ? (\n \n ) : (\n \n )}\n
\n
\n
\n \n \n );\n}"}] 2023-09-13T09:39:43.3754777Z error stack: 2023-09-13T09:39:43.3755554Z • index.js Object.onMaxRetryFunc 2023-09-13T09:39:43.3756163Z /node_modules/code-review-gpt/dist/index.js:55 2023-09-13T09:39:43.3756644Z • retry.js  2023-09-13T09:39:43.3757178Z /node_modules/ts-retry/lib/cjs/retry/retry.js:55 2023-09-13T09:39:43.3757606Z •   2023-09-13T09:39:43.3757929Z  2023-09-13T09:39:43.3758731Z • retry.js rejected 2023-09-13T09:39:43.3759267Z /node_modules/ts-retry/lib/cjs/retry/retry.js:6 2023-09-13T09:39:43.3759906Z • task_queues process.processTicksAndRejections 2023-09-13T09:39:43.3760505Z internal/process/task_queues:95 2023-09-13T09:39:43.4463313Z ERROR Error: {"message":"Request failed with status code 404","name":"Error","stack":"Error: Request failed with status code 404\n at createError (/home/runner/work/tascal/tascal/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/home/runner/work/tascal/tascal/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/home/runner/work/tascal/tascal/node_modules/axios/lib/adapters/http.js:322:11)\n at IncomingMessage.emit (node:events:526:35)\n at endReadableNT (node:internal/streams/readable:1359:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"OpenAI/NodeJS/3.3.0","Authorization":"***","Content-Length":291},"method":"post","data":"{\"model\":\"gpt-4\",\"temperature\":0,\"top_p\":1,\"frequency_penalty\":0,\"presence_penalty\":0,\"n\":1,\"stream\":false,\"messages\":[{\"role\":\"user\",\"content\":\"\\nYou are a senior developer and have just reviewed a pull request. This was your feedback:\\n[]\\nPlease summarise the review using 3 emojis.\\n\"}]}","url":"https://api.openai.com/v1/chat/completions"},"status":404} 2023-09-13T09:39:43.4729778Z ##[error]Process completed with exit code 1. ```
vercel[bot] commented 1 year ago

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

Name Status Preview Updated (UTC)
tascal ✅ Ready (Inspect) Visit Preview Sep 13, 2023 9:42am