Repository navigation
fix: 웹 대학 기준 검색 키워드 보정 - #660
Conversation
|
Warning Review limit reached
More reviews will be available in 45 minutes and 40 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUniversitySearchKeyword 엔티티가 대학 참조를 University에서 WebUniversity로 변경됩니다. DB 마이그레이션이 스키마와 데이터를 전환하고, 테스트 픽스처 및 통합·단위 테스트가 이를 반영하도록 업데이트됩니다. ChangesUniversitySearchKeyword의 WebUniversity 마이그레이션
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
🧪 JaCoCo Coverage Report (Changed Files)
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/resources/db/migration/V88__move_university_search_keywords_to_web_university.sql`:
- Around line 4-76: The migration currently runs DELETE FROM
university_search_keyword before inserting, risking data loss if the subsequent
INSERT (the SELECT ... FROM expected_keyword JOIN web_university) fails;
instead, create and populate a temporary staging table (same schema as
university_search_keyword) with the SELECT/ON DUPLICATE logic, validate the
staging data (non-null university_id, expected row counts) and only after
successful validation run a transactional swap/replace into
university_search_keyword (e.g., TRUNCATE + INSERT FROM staging or RENAME
staging to production), and move or add the ALTER TABLE
fk_university_search_keyword_web_university after population/validation so the
foreign key constraint does not block staging inserts; reference
university_search_keyword, web_university, expected_keyword and the
fk_university_search_keyword_web_university constraint when making these
changes.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 7d51e6a5-dde8-4e5a-b3c6-55611103cbdd
📒 Files selected for processing (6)
src/main/java/gg/agit/konect/domain/university/model/UniversitySearchKeyword.javasrc/main/resources/db/migration/V88__move_university_search_keywords_to_web_university.sqlsrc/test/java/gg/agit/konect/integration/domain/university/UniversityApiTest.javasrc/test/java/gg/agit/konect/integration/domain/website/WebsiteApiTest.javasrc/test/java/gg/agit/konect/support/fixture/UniversitySearchKeywordFixture.javasrc/test/java/gg/agit/konect/unit/domain/university/UniversitySearchKeywordMigrationTest.java
📜 Review details
⏰ 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). (3)
- GitHub Check: coverage
- GitHub Check: Analyze (java-kotlin)
- GitHub Check: Code Style Check
🧰 Additional context used
📓 Path-based instructions (6)
**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.java: Java 코드에서 import로 해결할 수 있는 경우 FQCN(Full Qualified Class Name)을 사용하지 않도록 지적한다
JPA/QueryDSL 조회 변경 시 N+1, 잘못된 fetch join, count 쿼리 왜곡, pagination 깨짐, distinct 누락을 확인한다
권한 로직은 관리자 우회, 요청자와 대상자 관계, 클럽/채팅방/공지/일정의 소속 검증이 빠지지 않았는지 확인한다
soft delete, 탈퇴 사용자, 차단/제외 조건, 중복 제거가 필요한 조회에서는 응답에 노출되면 안 되는 데이터가 포함되는지 확인한다
DTO 응답 변경은 기존 클라이언트가 기대하는 필드명, nullability, enum/string 값, 정렬 순서를 깨지 않는지 확인한다
조건이 2개 이상 결합된 비즈니스 규칙, 권한 조건, soft delete 제외, 중복 제거, fallback 우선순위, 대표값 선택, DTO 변환, count 쿼리 분리, fetch join 선택 이유처럼 코드만으로 의도가 숨겨지는 지점에는 주석을 권장한다
단순 생성자 호출, 필드 매핑, 컬렉션 반환, 이름만으로 명확한 분기에는 주석을 요구하지 않는다
Files:
src/test/java/gg/agit/konect/integration/domain/website/WebsiteApiTest.javasrc/test/java/gg/agit/konect/support/fixture/UniversitySearchKeywordFixture.javasrc/test/java/gg/agit/konect/integration/domain/university/UniversityApiTest.javasrc/main/java/gg/agit/konect/domain/university/model/UniversitySearchKeyword.javasrc/test/java/gg/agit/konect/unit/domain/university/UniversitySearchKeywordMigrationTest.java
**/*.{sql,java}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
데이터베이스 변경에서는 마이그레이션 순서, 기존 데이터 호환성, nullable/default 처리, 롤백 난이도, 인덱스 필요성을 확인한다
Files:
src/test/java/gg/agit/konect/integration/domain/website/WebsiteApiTest.javasrc/test/java/gg/agit/konect/support/fixture/UniversitySearchKeywordFixture.javasrc/main/resources/db/migration/V88__move_university_search_keywords_to_web_university.sqlsrc/test/java/gg/agit/konect/integration/domain/university/UniversityApiTest.javasrc/main/java/gg/agit/konect/domain/university/model/UniversitySearchKeyword.javasrc/test/java/gg/agit/konect/unit/domain/university/UniversitySearchKeywordMigrationTest.java
**/*
⚙️ CodeRabbit configuration file
**/*: 공통 리뷰 톤 가이드:
- 모든 코멘트는 첫 줄에
[LEVEL: ...]태그를 포함한다.- 과장된 표현 없이 사실 기반으로 작성한다.
- 한 코멘트에는 하나의 이슈만 다룬다.
- 코드 예시가 필요하면 최소 수정 예시를 제시한다.
- 가독성/단순화/확장성 이슈를 발견하면 우선순위를 높여 코멘트한다.
Files:
src/test/java/gg/agit/konect/integration/domain/website/WebsiteApiTest.javasrc/test/java/gg/agit/konect/support/fixture/UniversitySearchKeywordFixture.javasrc/main/resources/db/migration/V88__move_university_search_keywords_to_web_university.sqlsrc/test/java/gg/agit/konect/integration/domain/university/UniversityApiTest.javasrc/main/java/gg/agit/konect/domain/university/model/UniversitySearchKeyword.javasrc/test/java/gg/agit/konect/unit/domain/university/UniversitySearchKeywordMigrationTest.java
**/db/migration/*.sql
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Flyway 마이그레이션 파일은 파일명 버전 순서, 기존 운영 데이터 backfill, NOT NULL 추가 순서, 기본값 처리를 확인한다
Files:
src/main/resources/db/migration/V88__move_university_search_keywords_to_web_university.sql
src/main/resources/db/migration/**/*.sql
⚙️ CodeRabbit configuration file
src/main/resources/db/migration/**/*.sql: Flyway 마이그레이션 리뷰 규칙:
- 버전 파일명 규칙(V{number}__{description}.sql) 위반 여부를 우선 확인한다.
- 이미 배포된 마이그레이션 수정/재번호 부여 위험이 있으면 반드시 차단 코멘트를 남긴다.
- 파괴적 변경(drop, rename 등)은 롤백 가능성과 운영 영향 관점에서 검토한다.
Files:
src/main/resources/db/migration/V88__move_university_search_keywords_to_web_university.sql
src/main/java/**/*.java
⚙️ CodeRabbit configuration file
src/main/java/**/*.java: 아래 원칙으로 리뷰 코멘트를 작성한다.
- 코멘트는 반드시 한국어로 작성한다.
- 반드시 수정이 필요한 항목만 코멘트로 남기고, 단순 취향 차이는 지적하지 않는다.
- 각 코멘트 첫 줄에 심각도를
[LEVEL: high|medium|low]형식으로 반드시 표기한다.- 심각도 기준: high=운영 장애 가능, medium=품질 저하, low=개선 권고.
- 각 코멘트는 "문제 -> 영향 -> 제안" 순서로 3문장 이내로 간결하게 작성한다.
- 가능하면 재현 조건 및 실패 시나리오도 포함한다.
- 제안은 현재 코드베이스(Spring Boot + JPA + Flyway) 패턴과 일치해야 한다.
- 보안, 트랜잭션 경계, 예외 처리, N+1, 성능 회귀 가능성을 우선 점검한다.
- 가독성: 변수/메서드 이름이 의도를 바로 드러내는지, 중첩과 메서드 길이가 과도하지 않은지 점검한다.
- 단순화: 불필요한 추상화, 중복 로직, 과한 방어 코드가 있으면 더 단순한 대안을 제시한다.
- 확장성: 새 요구사항 추가 시 변경 범위가 최소화되는 구조인지(하드코딩 분기/값 여부 포함) 점검한다.
Files:
src/main/java/gg/agit/konect/domain/university/model/UniversitySearchKeyword.java
There was a problem hiding this comment.
Pull request overview
웹 공개 대학 목록(web_university) 기준으로 대학 검색 키워드가 연결/시드되도록 university_search_keyword의 FK 및 도메인 연관을 보정하는 PR입니다. 웹 홈 검색에서 약칭(예: 포스텍/postech/포공)이 환경별 web_university 데이터 존재 여부에 맞춰 정상 동작하도록 정합성을 맞춥니다.
Changes:
UniversitySearchKeyword의 연관 엔티티를University→WebUniversity로 변경- Flyway
V88__move_university_search_keywords_to_web_university.sql추가: FK 교체 및web_university기준 키워드 재시드 - 웹/대학 검색 관련 테스트 및 fixture를
WebUniversity기준으로 정리하고 V88 마이그레이션 테스트 추가
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/gg/agit/konect/domain/university/model/UniversitySearchKeyword.java | university_search_keyword.university_id의 JPA 연관을 WebUniversity로 전환 |
| src/main/resources/db/migration/V88__move_university_search_keywords_to_web_university.sql | FK를 web_university로 교체하고 web_university 기준으로 키워드 재시드 |
| src/test/java/gg/agit/konect/unit/domain/university/UniversitySearchKeywordMigrationTest.java | V88 마이그레이션 적용 후 포스텍 키워드 시드 여부 검증 테스트 추가 |
| src/test/java/gg/agit/konect/support/fixture/UniversitySearchKeywordFixture.java | 키워드 fixture가 WebUniversity를 받도록 수정 |
| src/test/java/gg/agit/konect/integration/domain/website/WebsiteApiTest.java | 웹 홈 대학 검색 시나리오를 WebUniversity + 키워드 기준으로 정리 |
| src/test/java/gg/agit/konect/integration/domain/university/UniversityApiTest.java | 약칭 검색 테스트에서 WebUniversity 기반 키워드 fixture를 사용하도록 보정 |
| ON DUPLICATE KEY UPDATE | ||
| keyword = VALUES(keyword), | ||
| keyword_type = VALUES(keyword_type); |
🔍 개요
university가 아니라 웹 공개 목록 기준인web_university와 연결되도록 보정합니다.web_university에 존재하는 대학 약칭이 정상 seed/조회되도록 맞췄습니다.🚀 주요 변경 내용
UniversitySearchKeyword의 연관 엔티티를University에서WebUniversity로 변경했습니다.V88__move_university_search_keywords_to_web_university.sql을 추가했습니다.university_search_keywordFK를university에서web_university로 교체합니다.web_university기준으로 다시 seed합니다.포항공과대학교가web_university에 존재하면포스텍,postech,포공키워드도 함께 seed됩니다.WebUniversity기준으로 정리했습니다.web_university기준으로 포스텍 키워드가 들어가는지 확인했습니다.💬 참고 사항
web_university기준으로 재구성됩니다../gradlew.bat test --tests "gg.agit.konect.unit.domain.university.UniversitySearchKeywordMigrationTest" --rerun-tasks./gradlew.bat test --tests "gg.agit.konect.integration.domain.website.WebsiteApiTest" --tests "gg.agit.konect.integration.domain.university.UniversityApiTest"./gradlew.bat checkstyleMain✅ Checklist (완료 조건)