Skip to content

Conversation

@whqtker
Copy link
Member

@whqtker whqtker commented Aug 29, 2025

관련 이슈

작업 내용

DELE 어학 시험 점수를 추가합니다.

머지되면 배포 서버에서 임시로 CEFR 어학 시험이라고 설정한 대학의 어학 시험을 DELE로 변경하겠습니다.

특이 사항

리뷰 요구사항 (선택)

- CEFR과 마찬가지로 A1 -> C2 순으로 높은 등급을 표현하므로 같은 비교자를 사용하도록
@coderabbitai
Copy link

coderabbitai bot commented Aug 29, 2025

Walkthrough

    1. 도메인 열거형 업데이트.
    • src/main/java/com/example/solidconnection/university/domain/LanguageTestType.java에서 LanguageTestType에 DELE 상수를 String::compareTo 인자로 추가했습니다.
    1. DB 마이그레이션 추가.
    • src/main/resources/db/migration/V31__add_DELE_Language_test.sql에서 application 테이블의 language_test_type 컬럼을 ENUM('CEFR','DALF','DELF','DELE','DUOLINGO','IELTS','JLPT','NEW_HSK','TCF','TEF','TOEFL_IBT','TOEFL_ITP','TOEIC','ETC')으로 수정했습니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • 소규모 파일 변경과 상수 추가, 단일 컬럼 ENUM 확장으로 변경 패턴이 단순합니다.
  • 코드와 스키마 간 값 일치 여부 확인 정도의 검토가 필요합니다.

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 Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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 레벨 중 무엇인지 확인이 필요합니다.

가능한 선택지:

    1. 값이 CEFR 레벨(A1~C2) 문자열이라면 유지하되, 주석으로 명시해 주세요.
    1. 값이 숫자라면 compareDoubleScores 또는 compareIntegerScores로 전환해 주세요.
    1. 값이 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 결과가 달라질 수 있습니다. 배포 윈도우와 쿼리 영향 범위를 확인해 주세요.

선택지:

    1. 운영 쿼리가 문자열 비교를 사용하도록 바꾸거나, 정렬 의존이 없다면 그대로 진행합니다.
    1. 락/리빌드 비용을 최소화하려면 끝에 추가하는 전략도 검토해 주세요(업무상 순서 의존이 없을 때).
📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 1e5f2a4 and 55f8070.

📒 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: 리뷰 코멘트 불필요 확인

  1. 분기 사용 위치 없음
     • 코드베이스 전역에 LanguageTestType에 대한 switch/if 분기가 전혀 없으므로 DELE 분기 누락 우려 불필요
  2. JPA 매핑 모두 STRING
     • 모든 @Enumerated가 EnumType.STRING으로 설정되어 있어 ORDINAL 관련 문제 없음

Likely an incorrect or invalid review comment.

Comment on lines +1 to +17
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'
);
Copy link

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가 빠질 수 있습니다. 운영 스키마와 동일하게 명시해 주세요.

    1. 현재 컬럼의 Null 여부와 기본값을 확인해 동일하게 유지해 주세요.
    1. 가능하면 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/migration

Length 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.sql

Length of output: 3516


ALTER TABLE에 NOT NULL과 COMMENT 명시

  1. NULL 제약 유지

    • 기존 application.language_test_type 컬럼이 NOT NULL으로 선언되어 있으므로, MODIFY COLUMN 절에 NOT NULL을 추가하세요.
  2. COMMENT 추가

    • 코드의 LanguageTestType enum과 동기화를 위해 COMMENT '어학시험 타입. 코드의 LanguageTestType와 동기화'를 달아 주세요.
🤖 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.

@whqtker whqtker merged commit c758624 into solid-connection:develop Sep 1, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: DELE 어학 시험에 대한 정보를 추가한다.

3 participants