refactor: 지원 대학 테이블 컬럼 스키마 변경 - #822
Conversation
Walkthrough
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/java/com/example/solidconnection/admin/university/service/AdminUnivApplyInfoRowSaver.java`:
- Around line 129-131: Add shared length validation for semesterRequirement,
detailsForLanguage, and gpaRequirement in the AdminUnivApplyInfoCreateRequest
and AdminUnivApplyInfoUpdateRequest flows before entity creation or update(...).
Enforce maximum lengths of 2000, 4000, and 2000 respectively, matching the
entity column constraints and the existing applyWithLength handling.
In
`@src/test/java/com/example/solidconnection/admin/university/service/AdminUnivApplyInfoServiceTest.java`:
- Line 385: Update the relevant tests in AdminUnivApplyInfoServiceTest to cover
maximum-length boundary values and over-limit values for semesterRequirement and
gpaRequirement at 2000/2001 characters, and detailsForLanguage at 4000/4001
characters. Change the existing tooLong value currently using 101 characters to
2001 so it still exercises the length-validation error.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8dd1ec8e-d46e-4a2e-a0b1-ebf9bbabbc14
📒 Files selected for processing (4)
src/main/java/com/example/solidconnection/admin/university/service/AdminUnivApplyInfoRowSaver.javasrc/main/java/com/example/solidconnection/university/domain/UnivApplyInfo.javasrc/main/resources/db/migration/V58__extend_univ_apply_info_requirement_columns.sqlsrc/test/java/com/example/solidconnection/admin/university/service/AdminUnivApplyInfoServiceTest.java
| case "semesterRequirement" -> applyWithLength(value, 2000, s -> data.semesterRequirement = s); | ||
| case "detailsForLanguage" -> applyWithLength(value, 4000, s -> data.detailsForLanguage = s); | ||
| case "gpaRequirement" -> applyWithLength(value, 2000, s -> data.gpaRequirement = s); |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -C 4 \
'`@Size`|semesterRequirement|detailsForLanguage|gpaRequirement|AdminUnivApplyInfo(Create|Update)Request' \
src/main/javaRepository: solid-connection/solid-connect-server
Length of output: 50393
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== candidate DTO and service files =="
fd 'AdminUnivApplyInfo(Create|Update)Request\.java|AdminUnivApplyInfoService\.java|AdminUnivApplyInfoRowSaver\.java|UnivApplyInfoImportRequest\.java' src/main/java -X sh -c 'echo "--- $1"; wc -l "$1"; sed -n "1,180p" "$1"' sh {}
echo
echo "== service call sites =="
rg -n -C 3 'createUnivApplyInfo|updateUnivApplyInfo|semesterRequirement|detailsForLanguage|gpaRequirement' src/main/java/com/example/solidconnection/admin/university/service/AdminUnivApplyInfoService.javaRepository: solid-connection/solid-connect-server
Length of output: 10593
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== AdminUnivApplyInfoCreateRequest.java =="
sed -n '1,120p' src/main/java/com/example/solidconnection/admin/university/dto/AdminUnivApplyInfoCreateRequest.java
echo
echo "== AdminUnivApplyInfoUpdateRequest.java =="
sed -n '1,140p' src/main/java/com/example/solidconnection/admin/university/dto/AdminUnivApplyInfoUpdateRequest.java
echo
echo "== UnivApplyInfo entity =="
sed -n '1,140p' src/main/java/com/example/solidconnection/university/domain/UnivApplyInfo.javaRepository: solid-connection/solid-connect-server
Length of output: 5965
1. 직접 생성·수정 경로의 문자열 길이 검증을 추가해 주세요.
AdminUnivApplyInfoCreateRequest와AdminUnivApplyInfoUpdateRequest는semesterRequirement,detailsForLanguage,gpaRequirement에@Size가 없습니다.- 엔티티는 해당 컬럼을
length=2000,4000,2000으로 제한해 둡니다. - 엔티티를 생성하거나
update(...)호출 때 같은 검증을 공통 로직으로 추가해 주세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/main/java/com/example/solidconnection/admin/university/service/AdminUnivApplyInfoRowSaver.java`
around lines 129 - 131, Add shared length validation for semesterRequirement,
detailsForLanguage, and gpaRequirement in the AdminUnivApplyInfoCreateRequest
and AdminUnivApplyInfoUpdateRequest flows before entity creation or update(...).
Enforce maximum lengths of 2000, 4000, and 2000 respectively, matching the
entity column constraints and the existing applyWithLength handling.
| void 길이_제한을_초과하는_값이_들어오면_전체가_실패한다() { | ||
| // given | ||
| String tooLongValue = "a".repeat(101); | ||
| String tooLongValue = "a".repeat(2001); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
1. 세 필드의 경계값과 초과값을 모두 검증해 주세요.
현재 테스트는 semesterRequirement의 2001자 초과만 검증합니다. detailsForLanguage의 4001자 초과, gpaRequirement의 2001자 초과, 각 필드의 최대 허용 길이 저장도 추가해 주세요.
또한 Line [405]의 String tooLong = "a".repeat(101)은 새 제한에서 더 이상 초과값이 아닙니다. 해당 테스트가 길이 오류도 검증하려면 2001자로 변경해야 합니다.
제안
- String tooLong = "a".repeat(101);
+ String tooLong = "a".repeat(2001);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@src/test/java/com/example/solidconnection/admin/university/service/AdminUnivApplyInfoServiceTest.java`
at line 385, Update the relevant tests in AdminUnivApplyInfoServiceTest to cover
maximum-length boundary values and over-limit values for semesterRequirement and
gpaRequirement at 2000/2001 characters, and detailsForLanguage at 4000/4001
characters. Change the existing tooLong value currently using 101 characters to
2001 so it still exercises the length-validation error.
관련 이슈
작업 내용
지원 대학 테이블 컬럼 스키마 수정했습니다.
length가 너무 작아 잘립니다.
특이 사항
리뷰 요구사항 (선택)