-
Notifications
You must be signed in to change notification settings - Fork 100
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
feat(apply): link the my application page with the example judgment api #660
Conversation
Co-authored-by: Jungmin Hwang <[email protected]>
Co-authored-by: Jungmin Hwang <[email protected]>
Co-authored-by: Jungmin Hwang <[email protected]>
Co-authored-by: Jungmin Hwang <[email protected]>
Co-authored-by: Jungmin Hwang <[email protected]>
Co-authored-by: Jungmin Hwang <[email protected]>
- SUCCESS -> SUCCESSED - FAIL -> FAILED - judgment->judgments - axios post config 위치 변경 Co-authored-by: Jungmin Hwang <[email protected]>
c9ce9ba
to
aadd98c
Compare
Co-authored-by: Jungmin Hwang <[email protected]>
Co-authored-by: Jungmin Hwang <[email protected]>
(judgment?.status === JUDGMENT_STATUS.STARTED && | ||
!isJudgmentTimedOut(judgment.startedDateTime)) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분이 조금 이해하기 어려운데요,
평가중이면서 5분이 지난 경우에는 예제테스트 실행 버튼을 보여주어야 하기 때문에 이렇게 구현하였습니다.
평가중이면서 5분이 안지나면 예제테스트 실행버튼을 비활성 하여야 합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
비녀, 자스민~ 고생 많으십니다!
잘 훑어봤고, 궁금한 점과 함께 소소하게 코멘트 남겼습니다.
확인 부탁드려요~
frontend/src/mock/dummy.ts
Outdated
@@ -147,7 +150,7 @@ export const missionsDummy = { | |||
judgment: { | |||
pullRequestUrl: "https://github.com/woowacourse/service-apply/pull/367", | |||
commitHash: "642951e1324eaf66914bd53df339d94cad5667e3", | |||
status: "SUCCESS" as TestStatus, | |||
status: "SUCCEEDED" as TestStatus, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r: 여기 타입 TestStatus
도 JudgmentStatus
로 바뀌는 걸까요? 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test result 만 일단 고려한것이긴 한데 통일하는게 좋아보이네요
|
||
type JudgmentResultType = { text: string; type: "default" | "fail" | "pass" | "pending" }; | ||
|
||
const formatJudgmentResult = (judgment: Mission["judgment"]): JudgmentResultType => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r: util 함수 파일인데 확장자가 tsx네요. ts로 변경할까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
처음에 hook으로 작성했다가 변경해서 바뀌었나보네요.
저희 컨벤션이 ts와 tsx를 구분하기로 했으므로 변경해야 할 것 같습니다!
case JUDGMENT_STATUS.FAILED: | ||
case JUDGMENT_STATUS.CANCELLED: | ||
return { text: "예기치 못한 오류로 인하여 실행에 실패하였습니다.", type: "fail" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a: 헷갈려서 질문합니다. Failed와 Canceled의 차이가 뭔가요?
judgment 데이터를 보니 message가 있던데, dummy에서는 빌드 실패, 성공 여부나 빈 문자열이더라고요. 이 아이는 빌드 관련 결과를 안내하는 메시지 인가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저희도 헷갈려서 백엔드분들께 여쭤봤더니, 자동채점에 대해서
- Failed = 빌드 실패 등 실행에 실패한 경우
- Canceled = 채점 사이트에서 실행 취소를 당한 경우
라고 합니다.
@@ -44,7 +44,7 @@ const MyApplicationFormItem = ({ recruitment, submitted }: MyApplicationFormItem | |||
const isButtonDisabled = isApplicationDisabled(submitted, recruitment.recruitable); | |||
const buttonLabel = applicationLabel(submitted, recruitment.recruitable); | |||
|
|||
const routeToApplicationForm = (recruitment: Recruitment) => () => { | |||
const routeToApplicationForm = (recruitment: Recruitment) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a: 👏👏👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코멘트 확인 부탁드립니다~!
로컬 테스트는 별도 브랜치에서 따로 진행해보신 걸까요?
const errorMessage = error.response?.data.message; | ||
alert(errorMessage); | ||
|
||
const response = await fetchMyMissionJudgment({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r: 여기에서 다시 에러가 발생하면 어떻게 되나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리팩토링 하다보니, handleJudgeError를 호출하는 경우 이미 response가 없기 때문에 굳이 fetchMyMissionJudgment해 올 필요가 없을 것 같습니다.
기존에 코드를 짤 때 canceled나 failed와 handleJudgeError를 혼용 된 것 같습니다.
만약 '실행하기' 가 실패한다면 이전 상태를 그대로 보여주고 '실행하기가 안됐다는 에러메세지만 보여주면 될 것 같습니다.
fetchMyMissionJudgment를 통째로 제거하는 게 맞는 것 같아요.
|
||
const response = await fetchMyMissionJudgment({ | ||
recruitmentId: Number(recruitmentId), | ||
missionId: Number(missionId), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c: missionId
는 핸들러 함수의 파라미터이고, recruitementId
는 컴포넌트의 props를 그대로 사용하고 있는데요. 혼동이 생길 수 있지 않을까요?
@@ -1,5 +1,6 @@ | |||
export const JUDGMENT_STATUS = { | |||
STARTED: "STARTED", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c: CSS 클래스는 started
대신 pending
이라는 용어를 사용하는데요. 동일하게 양쪽 다 started로 맞추면 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
용어통일이 되고 있지 않았네요! pending으로 된 용어들 모두 started로 변경해주었습니다.
frontend/src/mock/dummy.ts
Outdated
@@ -125,7 +128,7 @@ export const missionsDummy = { | |||
judgment: { | |||
pullRequestUrl: "https://github.com/woowacourse/service-apply/pull/367", | |||
commitHash: "642951e1324eaf66914bd53df339d94cad5667e3", | |||
status: "STARTED" as TestStatus, | |||
status: "STARTED" as JudgmentStatus, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r: 상수화 이미 해둔 게 있는데, "STARTED"
같은 문자열 대신JUDGMENT_STATUS
상수를 쓰는 게 어떨까요? 값을 변경하게 되면 하나하나 따로 수정해주어야 하는 불편함이 있을 것 같아요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JUDGMENT_STATUS에서 사용하도록 변경하였고,
MISSION_STATUS도 동일하게 적용하였습니다.
import { JUDGMENT_STATUS } from "../../constants/judgment"; | ||
import { isJudgmentTimedOut } from "../validation/judgmentTime"; | ||
|
||
type JudgmentResultType = { text: string; type: "default" | "fail" | "pass" | "pending" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r: 'pending' 은 서버에서 내려주는 값이랑 무관하게 따로 선언해서 사용하는 값이죠?-? 위의 css 코멘트와 같이 통일할 수 있으면 'started'로 맞추면 어떨까 해서요 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위의 코멘트 와 동일하게 pending 관련 용어를 모두 started로 도메인용어 통일하였습니다.
@@ -51,6 +61,7 @@ const RefreshButton = ({ recruitmentId, missionItem, setMission }: RefreshButton | |||
variant={BUTTON_VARIANT.CONTAINED} | |||
cancel={false} | |||
onClick={() => { | |||
alert("새로고침 되었습니다"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r: 아직 새로고침 전이지 않나요?-?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refresh data를 fetch 이후 alert('새로고침 되었습니다')
를 시행하도록 변경하였습니다.
return { text: `${passCount} / ${totalCount}`, type: isPass ? "pass" : "fail" }; | ||
case JUDGMENT_STATUS.FAILED: | ||
case JUDGMENT_STATUS.CANCELLED: | ||
return { text: "예기치 못한 오류로 인하여 실행에 실패하였습니다.", type: "fail" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r: 케이스가 다른데 'type'이 같아 혼란스러울 수 있을 것 같은데요. 텍스트 스타일은 같더라도 'error'로 타입을 따로 분류하면 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그럴 수 있겠네요.
FAILED, CANCELLED, TIMEOUTTED 경우에도 error로 처리하도록 했습니다!
case JUDGMENT_STATUS.STARTED: | ||
return { text: "테스트 중", type: "pending" }; | ||
case JUDGMENT_STATUS.SUCCEEDED: | ||
const isPass = passCount / totalCount === 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r:
- '전체 케이스 통과'라는 의미가 좀 더 드러나지 않아도 될까요?
- 결과가 같긴 하지만
passCount === totalCount
로 판단해도 될 것 같은데 어떠신가요? '통과한 개수가 전체 개수와 같다'는 것이니까요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const isPass = passCount / totalCount === 1; | |
const isPass = passCount === totalCount; |
으로 변경하였습니다.
전체 케이스 통과 라는 뜻이 드러나도록 isPass -> isPassAllCases로 변경하였습니다.
@@ -0,0 +1,7 @@ | |||
import { ISO8601DateString } from "../../../types/domains/common"; | |||
|
|||
export const isJudgmentTimedOut = (time: ISO8601DateString) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r: Judgment는 도메인을 다루는 내용이라, utils 하위에 있기는 어색하지 않을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
judgmentButon, refreshButton, judgmentResult 세군데서 사용하고 있습니다.
custom hook으로 빼기에는 hook을 사용하지도 않아서 안 맞는 것 같고
도메인 별 함수를 따로 정리하지 않고 있기 때문에 utils에 넣는게 맞다고 판단했습니다.
혹시 어디로 옮기면 좋을 것 같은지 의견 있으시면 알려주시면 감사하겠습니다!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
흠...그러네요 지금 디렉토리 구조에서는 애매하군요.
타입 외에 domains/
디렉토리가 필요할 수도 있겠네요 🤔
현재 상태에서는 이대로 두고 다시 고민해보시죠!
export const isJudgmentTimedOut = (time: ISO8601DateString) => { | ||
const startedDateTime = new Date(time); | ||
const now = new Date(); | ||
return now.getTime() - startedDateTime.getTime() > 300000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r: 5분이라는 게 더 명확하게 읽히게 상수화 하면 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return now.getTime() - startedDateTime.getTime() > 300000; | |
const timeoutMinute = 5; | |
const timeoutMillisecond = timeoutMinute * 60 * 1000; | |
return now.getTime() - startedDateTime.getTime() > timeoutMillisecond; |
로 변경하였습니다.
Co-authored-by: Jungmin Hwang <[email protected]>
Co-authored-by: Jungmin Hwang <[email protected]>
Co-authored-by: Jungmin Hwang <[email protected]>
Co-authored-by: Jungmin Hwang <[email protected]>
Co-authored-by: Jungmin Hwang <[email protected]>
- failed, canceled, timeout 인 경우 error로 변경
Co-authored-by: Jungmin Hwang <[email protected]>
Co-authored-by: Jungmin Hwang <[email protected]>
- 테스트 결과가 없으면서 5분이 지났을때는 시간초과 메세지를 띄워준다
✅ 추가 변경사항
|
Co-authored-by: Jungmin Hwang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추가 수정 사항까지 확인하였습니다~!
고생 많으셨어요! 👏👏👏👏👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
변경 확인했습니다. 고생하셨어요! 👍👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다. 👍
Resolves #662
현재상태 : 백엔드 로컬서버와 연동하여 작동테스트 마친 상태입니다.
😀 해결하려는 문제가 무엇인가요?
🤔 어떻게 해결했나요?
예기치 못한 오류로 실행 시간을 초과하였습니다.
라는 메세지를 붉은 글씨로 보여줍니다.새로고침
버튼을 보여주지 않습니다.👉 어떤 부분에 집중하여 리뷰해야 할까요?
예기치 못한 오류로 실행 시간을 초과하였습니다.
,예기치 못한 오류로 실행에 실패였습니다.
) 에 대한 아이디어가 있다면 알려주세요참고 자료
RCA 룰
r: 꼭 반영해 주세요. 적극적으로 고려해 주세요. (Request changes)
c: 웬만하면 반영해 주세요. (Comment)
a: 반영해도 좋고 넘어가도 좋습니다. 그냥 사소한 의견입니다. (Approve)