Skip to content

fix: 웹 대학 기준 검색 키워드 보정 - #660

Merged
JanooGwan merged 2 commits into
developfrom
fix/web-university-search-keyword
Jun 1, 2026
Merged

JanooGwan merged 2 commits into
developfrom
fix/web-university-search-keyword

Conversation

@JanooGwan

@JanooGwan JanooGwan commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

🔍 개요

  • 대학 검색 키워드가 앱용 university가 아니라 웹 공개 목록 기준인 web_university와 연결되도록 보정합니다.
  • Public Website 홈 검색에서 web_university에 존재하는 대학 약칭이 정상 seed/조회되도록 맞췄습니다.

🚀 주요 변경 내용

  • UniversitySearchKeyword의 연관 엔티티를 University에서 WebUniversity로 변경했습니다.
  • V88__move_university_search_keywords_to_web_university.sql을 추가했습니다.
  • 기존 university_search_keyword FK를 university에서 web_university로 교체합니다.
  • 기존 키워드를 비우고 web_university 기준으로 다시 seed합니다.
  • 포항공과대학교가 web_university에 존재하면 포스텍, postech, 포공 키워드도 함께 seed됩니다.
  • 웹/대학 검색 테스트 fixture를 WebUniversity 기준으로 정리했습니다.
  • V88 마이그레이션 테스트를 추가해 web_university 기준으로 포스텍 키워드가 들어가는지 확인했습니다.

💬 참고 사항

  • 현재 stage에서 V87까지 성공한 상태라면, 이번 배포 후 V88이 실행되면서 키워드 FK와 seed 데이터가 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 (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

@coderabbitai

coderabbitai Bot commented Jun 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@JanooGwan, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 61078dfc-606a-4eba-a78f-0e745691958b

📥 Commits

Reviewing files that changed from the base of the PR and between 786c88f and 19ffa8d.

📒 Files selected for processing (1)
  • src/main/resources/db/migration/V88__move_university_search_keywords_to_web_university.sql
📝 Walkthrough

Walkthrough

UniversitySearchKeyword 엔티티가 대학 참조를 University에서 WebUniversity로 변경됩니다. DB 마이그레이션이 스키마와 데이터를 전환하고, 테스트 픽스처 및 통합·단위 테스트가 이를 반영하도록 업데이트됩니다.

Changes

UniversitySearchKeyword의 WebUniversity 마이그레이션

Layer / File(s) Summary
엔티티 모델 계약 변경
src/main/java/gg/agit/konect/domain/university/model/UniversitySearchKeyword.java
UniversitySearchKeyword의 university 필드 타입이 University에서 WebUniversity로 변경되고, import와 @ManyToOne 필드, 빌더 파라미터가 함께 업데이트됩니다.
DB 마이그레이션 및 데이터 전환
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/support/fixture/UniversitySearchKeywordFixture.java
createAlias 메서드의 파라미터 타입을 University에서 WebUniversity로 변경하고 import를 수정합니다.
통합 테스트 데이터 준비 및 검증
src/test/java/gg/agit/konect/integration/domain/university/UniversityApiTest.java, src/test/java/gg/agit/konect/integration/domain/website/WebsiteApiTest.java
테스트 데이터를 WebUniversityFixture로 구성하고, createAlias에 WebUniversity 인스턴스를 전달하도록 수정하여 일관된 테스트 흐름을 구성합니다.
마이그레이션 시나리오 테스트
src/test/java/gg/agit/konect/unit/domain/university/UniversitySearchKeywordMigrationTest.java
V88 마이그레이션 동작을 검증하는 새로운 테스트 케이스와 web_university 테이블 생성·데이터 삽입 헬퍼 메서드가 추가됩니다.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • BCSDLab/KONECT_BACK_END#657: 메인 PR은 #657이 도입한 UniversitySearchKeyword 테이블 및 키워드 조회 흐름을 후속으로 WebUniversity 기반으로 변경합니다.
  • BCSDLab/KONECT_BACK_END#650: 두 PR 모두 웹사이트 대학 초성/약칭 검색 시나리오를 WebsiteApiTest에서 다룹니다.
  • BCSDLab/KONECT_BACK_END#658: 두 PR 모두 UniversitySearchKeywordMigrationTest에 V88 계열 마이그레이션 시나리오를 추가합니다.

Suggested labels

버그

Poem

🐰 대학의 검색 길을 다시 그으며,
WebUniversity로 통일한 길목에서
초성과 약칭 키워드가 춤을 춘다네.
마이그레이션이 데이터를 안전히 옮기고,
테스트가 그 변화를 손잡으니—
모두 함께하는 조화로운 변경이라!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목 '웹 대학 기준 검색 키워드 보정'은 변경 사항의 핵심을 명확하게 설명하고 있습니다. UniversitySearchKeyword의 연관 엔티티를 University에서 WebUniversity로 변경하는 주요 목적을 간결하게 표현했습니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed 풀 리퀘스트 설명이 변경 사항과 명확히 관련되어 있습니다. 대학 검색 키워드를 University에서 WebUniversity로 변경하는 내용을 구체적으로 설명하고 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/web-university-search-keyword

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@JanooGwan JanooGwan added the 버그 정상적으로 동작하지 않는 문제 상황 관련 이슈입니다. label Jun 1, 2026
@JanooGwan JanooGwan self-assigned this Jun 1, 2026
@JanooGwan
JanooGwan requested a review from Copilot June 1, 2026 04:59
@github-actions

github-actions Bot commented Jun 1, 2026 •

Copy link
Copy Markdown

🧪 JaCoCo Coverage Report (Changed Files)

변경된 main Java 소스 파일에 대한 JaCoCo 데이터가 없습니다.

📊 View Workflow Run

coderabbitai[bot]
coderabbitai Bot previously requested changes Jun 1, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6be8eb1 and 786c88f.

📒 Files selected for processing (6)
  • src/main/java/gg/agit/konect/domain/university/model/UniversitySearchKeyword.java
  • src/main/resources/db/migration/V88__move_university_search_keywords_to_web_university.sql
  • src/test/java/gg/agit/konect/integration/domain/university/UniversityApiTest.java
  • src/test/java/gg/agit/konect/integration/domain/website/WebsiteApiTest.java
  • src/test/java/gg/agit/konect/support/fixture/UniversitySearchKeywordFixture.java
  • src/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.java
  • src/test/java/gg/agit/konect/support/fixture/UniversitySearchKeywordFixture.java
  • src/test/java/gg/agit/konect/integration/domain/university/UniversityApiTest.java
  • src/main/java/gg/agit/konect/domain/university/model/UniversitySearchKeyword.java
  • src/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.java
  • src/test/java/gg/agit/konect/support/fixture/UniversitySearchKeywordFixture.java
  • src/main/resources/db/migration/V88__move_university_search_keywords_to_web_university.sql
  • src/test/java/gg/agit/konect/integration/domain/university/UniversityApiTest.java
  • src/main/java/gg/agit/konect/domain/university/model/UniversitySearchKeyword.java
  • src/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.java
  • src/test/java/gg/agit/konect/support/fixture/UniversitySearchKeywordFixture.java
  • src/main/resources/db/migration/V88__move_university_search_keywords_to_web_university.sql
  • src/test/java/gg/agit/konect/integration/domain/university/UniversityApiTest.java
  • src/main/java/gg/agit/konect/domain/university/model/UniversitySearchKeyword.java
  • src/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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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를 사용하도록 보정

Comment on lines +74 to +76
ON DUPLICATE KEY UPDATE
keyword = VALUES(keyword),
keyword_type = VALUES(keyword_type);
@JanooGwan
JanooGwan merged commit a17a54e into develop Jun 1, 2026
5 checks passed
@JanooGwan
JanooGwan deleted the fix/web-university-search-keyword branch June 1, 2026 05:19
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.

2 participants