-
Notifications
You must be signed in to change notification settings - Fork 8
feat: DELE 어학 시험 추가 #500
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: DELE 어학 시험 추가 #500
Conversation
- CEFR과 마찬가지로 A1 -> C2 순으로 높은 등급을 표현하므로 같은 비교자를 사용하도록
Walkthrough
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 2
🧹 Nitpick comments (3)
src/main/java/com/example/solidconnection/university/domain/LanguageTestType.java (2)
11-11: 1) DELE 점수 비교 전략을 명시해 주세요.
현재String::compareTo는 문자열 사전식 비교만 합니다. 점수 체계가 숫자, 합/불(APTO/NO APTO), 또는 CEFR 레벨 중 무엇인지 확인이 필요합니다.가능한 선택지:
- 값이 CEFR 레벨(A1~C2) 문자열이라면 유지하되, 주석으로 명시해 주세요.
- 값이 숫자라면
compareDoubleScores또는compareIntegerScores로 전환해 주세요.
- 값이 APTO/NO APTO 같은 합/불이면 전용 comparator를 두세요.
적용 예시(전용 comparator로 통합):
- DELE(String::compareTo), + DELE(LanguageTestType::compareDeleScores),클래스 내부에 아래 보조 메서드를 추가하면 대표 포맷을 광범위하게 커버할 수 있습니다.
// LanguageTestType 내부에 추가 private static int compareDeleScores(String s1, String s2) { if (s1 == null || s2 == null) return Boolean.compare(s1 != null, s2 != null); String a = s1.trim().toUpperCase(); String b = s2.trim().toUpperCase(); // 1) 숫자 점수 try { return Double.compare(Double.parseDouble(a), Double.parseDouble(b)); } catch (NumberFormatException ignore) {} // 2) 합/불 java.util.Map<String,Integer> passFail = java.util.Map.of("APTO", 1, "NO APTO", 0, "PASS", 1, "FAIL", 0); Integer ai = passFail.get(a), bi = passFail.get(b); if (ai != null && bi != null) return Integer.compare(ai, bi); // 3) CEFR 레벨 java.util.List<String> cefr = java.util.List.of("A1","A2","B1","B2","C1","C2"); int ia = cefr.indexOf(a), ib = cefr.indexOf(b); if (ia >= 0 && ib >= 0) return Integer.compare(ia, ib); // 4) 최후 수단: 사전식 return a.compareTo(b); }
37-39: 3) 비교 시 null 입력 처리 방어가 필요하면 보강을 검토해 주세요.
외부 입력으로 null이 들어올 가능성이 있다면 NPE 방지를 고려해 주세요.예시:
- public int compare(String s1, String s2) { - return comparator.compare(s1, s2); - } + public int compare(String s1, String s2) { + if (s1 == null || s2 == null) return Boolean.compare(s1 != null, s2 != null); + return comparator.compare(s1, s2); + }src/main/resources/db/migration/V31__add_DELE_Language_test.sql (1)
1-17: 2) ENUM 재정의는 테이블 리빌드·락 및 정렬 순서 변화를 유발할 수 있습니다.
값을 중간(‘DELF’ 뒤)에 삽입하면 INSTANT 적용이 어려울 수 있고,ORDER BY language_test_type결과가 달라질 수 있습니다. 배포 윈도우와 쿼리 영향 범위를 확인해 주세요.선택지:
- 운영 쿼리가 문자열 비교를 사용하도록 바꾸거나, 정렬 의존이 없다면 그대로 진행합니다.
- 락/리빌드 비용을 최소화하려면 끝에 추가하는 전략도 검토해 주세요(업무상 순서 의존이 없을 때).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
src/main/java/com/example/solidconnection/university/domain/LanguageTestType.java(1 hunks)src/main/resources/db/migration/V31__add_DELE_Language_test.sql(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (1)
src/main/java/com/example/solidconnection/university/domain/LanguageTestType.java (1)
7-13: 리뷰 코멘트 불필요 확인
- 분기 사용 위치 없음
• 코드베이스 전역에 LanguageTestType에 대한 switch/if 분기가 전혀 없으므로 DELE 분기 누락 우려 불필요- JPA 매핑 모두 STRING
• 모든 @Enumerated가 EnumType.STRING으로 설정되어 있어 ORDINAL 관련 문제 없음Likely an incorrect or invalid review comment.
| ALTER TABLE application | ||
| MODIFY COLUMN language_test_type ENUM( | ||
| 'CEFR', | ||
| 'DALF', | ||
| 'DELF', | ||
| 'DELE', | ||
| 'DUOLINGO', | ||
| 'IELTS', | ||
| 'JLPT', | ||
| 'NEW_HSK', | ||
| 'TCF', | ||
| 'TEF', | ||
| 'TOEFL_IBT', | ||
| 'TOEFL_ITP', | ||
| 'TOEIC', | ||
| 'ETC' | ||
| ); |
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.
🛠️ Refactor suggestion
3) CEFR → DELE 데이터 마이그레이션을 코드로 남겨 주세요.
운영 DB에서 수동 변경 대신, 후속 버전 마이그레이션으로 재현 가능하게 관리하는 것을 권장합니다.
예시(별도 파일 V31_1에 추가 권장, 조건은 실제 키로 교체):
-- V31_1__migrate_application_language_test_to_DELE.sql
START TRANSACTION;
-- 대상 행 확인(드라이런)
SELECT id, university_id, language_test_type FROM application
WHERE /* TODO: 대상 대학 조건 */ AND language_test_type = 'CEFR' FOR UPDATE;
-- 실제 업데이트
UPDATE application
SET language_test_type = 'DELE'
WHERE /* TODO: 대상 대학 조건 */ AND language_test_type = 'CEFR';
COMMIT;원하시면 조건 식별 및 스크립트 작성까지 도와드릴게요.
🤖 Prompt for AI Agents
In src/main/resources/db/migration/V31__add_DELE_Language_test.sql around lines
1 to 17: the review requests a follow-up migration to migrate existing rows with
language_test_type='CEFR' to 'DELE' instead of doing it manually; create a new
migration file (e.g., V31_1__migrate_application_language_test_to_DELE.sql) that
runs in a transaction, first SELECT ... FOR UPDATE to verify target rows (with
the actual university/condition replacing the TODO placeholder), then UPDATE
those rows setting language_test_type='DELE', and COMMIT; ensure the file
name/version sorts after V31 and replace all TODOs with the real selection
criteria/keys before applying to production.
💡 Verification agent
🧩 Analysis chain
1) MySQL ENUM 수정 시 NULL/DEFAULT/COMMENT 유실 위험을 방지해 주세요.
MODIFY COLUMN은 전체 정의를 재기술해야 하므로 기존의 NOT NULL/DEFAULT/COMMENT가 빠질 수 있습니다. 운영 스키마와 동일하게 명시해 주세요.
-
- 현재 컬럼의 Null 여부와 기본값을 확인해 동일하게 유지해 주세요.
-
- 가능하면 COMMENT로 코드 enum과의 동기화 주석을 남겨 주세요.
예시(필요 시 조정):
ALTER TABLE application
- MODIFY COLUMN language_test_type ENUM(
+ MODIFY COLUMN language_test_type ENUM(
'CEFR',
'DALF',
'DELF',
'DELE',
'DUOLINGO',
'IELTS',
'JLPT',
'NEW_HSK',
'TCF',
'TEF',
'TOEFL_IBT',
'TOEFL_ITP',
'TOEIC',
'ETC'
- );
+ ) NOT NULL
+ COMMENT '어학시험 타입. 코드의 LanguageTestType와 동기화';빠른 점검 스크립트(개발 DB에서 실행 권장):
🏁 Script executed:
#!/bin/bash
# language_test_type 현재 정의 확인
mysql -e "SHOW CREATE TABLE application\G" | sed -n '/language_test_type/p'Length of output: 171
🏁 Script executed:
#!/bin/bash
rg -n "language_test_type" -C3 src/main/resources/db/migrationLength of output: 3566
🏁 Script executed:
#!/bin/bash
# V1__init.sql 첫 번째 테이블 생성 부분 확인
sed -n '1,50p' src/main/resources/db/migration/V1__init.sql
# 두 번째 테이블(또는 이후) 생성 부분 확인
sed -n '50,100p' src/main/resources/db/migration/V1__init.sqlLength of output: 3516
ALTER TABLE에 NOT NULL과 COMMENT 명시
-
NULL 제약 유지
- 기존 application.language_test_type 컬럼이 NOT NULL으로 선언되어 있으므로, MODIFY COLUMN 절에
NOT NULL을 추가하세요.
- 기존 application.language_test_type 컬럼이 NOT NULL으로 선언되어 있으므로, MODIFY COLUMN 절에
-
COMMENT 추가
- 코드의 LanguageTestType enum과 동기화를 위해
COMMENT '어학시험 타입. 코드의 LanguageTestType와 동기화'를 달아 주세요.
- 코드의 LanguageTestType enum과 동기화를 위해
🤖 Prompt for AI Agents
In src/main/resources/db/migration/V31__add_DELE_Language_test.sql around lines
1 to 17, the ALTER TABLE MODIFY COLUMN statement omits the original NOT NULL
constraint and a descriptive COMMENT; update the MODIFY COLUMN to explicitly
include NOT NULL and add COMMENT '어학시험 타입. 코드의 LanguageTestType와 동기화' so the
column preserves its non-null constraint and documents synchronization with the
LanguageTestType enum.
관련 이슈
작업 내용
DELE 어학 시험 점수를 추가합니다.
머지되면 배포 서버에서 임시로 CEFR 어학 시험이라고 설정한 대학의 어학 시험을 DELE로 변경하겠습니다.
특이 사항
리뷰 요구사항 (선택)