[FEAT] 프로젝트 목록에 keyword 검색과 sort=name 정렬 추가 - #452
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough프로젝트 목록 조회에 Changes프로젝트 목록 검색 및 정렬
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: ⚪ Minimal · up to This change adds project-name keyword filtering and name sorting while preserving existing list behavior; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant ProjectController
participant GetProjectListUseCase
participant ProjectService
participant ProjectPersistenceAdapter
ProjectController->>GetProjectListUseCase: keyword와 목록 조건 전달
GetProjectListUseCase->>ProjectService: 목록 조회 실행
ProjectService->>ProjectPersistenceAdapter: keyword 포함 목록 및 건수 조회
ProjectPersistenceAdapter-->>ProjectService: 검색 결과와 전체 건수 반환
ProjectService-->>ProjectController: 프로젝트 목록 응답 반환
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/test/java/com/module06/backend/project/infrastructure/persistence/ProjectPersistenceAdapterListFilterTest.java (1)
72-83: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win검색 결과의 프로젝트명을 검증하세요.
현재 검증은 결과 수와 count만 확인합니다. 잘못된 조건이 임의의 두 프로젝트를 반환해도 이 테스트는 통과할 수 있습니다. 두
Zebra프로젝트가 반환되고Other Project가 제외되는지 검증하세요.검증 강화 예시
assertThat(result).hasSize(2); + assertThat(result) + .extracting(Project::getName) + .containsExactlyInAnyOrder( + "프로젝트 Zebra Groupware", + "프로젝트 zebra internal tools"); assertThat(projectRepository.countByCompanyId(COMPANY, "ZEBRA", null)).isEqualTo(2L);🤖 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/module06/backend/project/infrastructure/persistence/ProjectPersistenceAdapterListFilterTest.java` around lines 72 - 83, Strengthen filtersByKeywordCaseInsensitive by asserting the returned projects’ names, verifying both “Zebra Groupware” and “zebra internal tools” are present and “Other Project” is excluded, while retaining the existing size and count assertions.src/test/java/com/module06/backend/project/application/service/ProjectServiceTest.java (1)
164-172: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
keyword전달을 비어 있지 않은 값으로 검증하세요.현재 목록 테스트는 모두
keyword = null만 사용합니다. 따라서ProjectService.list가 비어 있지 않은keyword를 목록 조회와 count 조회에 동일하게 전달하는지 검증하지 못합니다.검증 테스트 예시
+@Test +void listPassesKeywordToContentAndCountQueries() { + // 기존 목록 조회 의존성 스텁 설정 + + projectService.list(COMPANY, "zebra", null, null, "desc", 0, 20); + + verify(projectRepository).findAllByCompanyId( + COMPANY, "zebra", null, null, "desc", 0, 20); + verify(projectRepository).countByCompanyId(COMPANY, "zebra", null); +}PR 목표는 서비스 계층의
keyword전달 검증을 요구합니다.Also applies to: 186-193
🤖 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/module06/backend/project/application/service/ProjectServiceTest.java` around lines 164 - 172, Update the project list tests around ProjectServiceTest to use a non-empty keyword when calling ProjectService.list, and stub/verify that the same keyword is passed to both projectRepository.findAllByCompanyId and projectRepository.countByCompanyId. Apply this to the related test at the additional location as well, preserving the existing assertions and other filters.
🤖 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/module06/backend/project/infrastructure/persistence/ProjectPersistenceAdapter.java`:
- Around line 122-123: Update the keyword normalization in the predicate
construction to use Locale.ROOT with keyword.toLowerCase, and add a regression
test covering Turkish JVM locale behavior to verify matching remains consistent
with cb.lower(root.get("name")).
---
Nitpick comments:
In
`@src/test/java/com/module06/backend/project/application/service/ProjectServiceTest.java`:
- Around line 164-172: Update the project list tests around ProjectServiceTest
to use a non-empty keyword when calling ProjectService.list, and stub/verify
that the same keyword is passed to both projectRepository.findAllByCompanyId and
projectRepository.countByCompanyId. Apply this to the related test at the
additional location as well, preserving the existing assertions and other
filters.
In
`@src/test/java/com/module06/backend/project/infrastructure/persistence/ProjectPersistenceAdapterListFilterTest.java`:
- Around line 72-83: Strengthen filtersByKeywordCaseInsensitive by asserting the
returned projects’ names, verifying both “Zebra Groupware” and “zebra internal
tools” are present and “Other Project” is excluded, while retaining the existing
size and count assertions.
🪄 Autofix
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: 4d1cb8ca-616c-465a-8007-2dedcc9e02f3
📒 Files selected for processing (8)
src/main/java/com/module06/backend/project/application/service/ProjectService.javasrc/main/java/com/module06/backend/project/application/usecase/GetProjectListUseCase.javasrc/main/java/com/module06/backend/project/domain/repository/ProjectRepository.javasrc/main/java/com/module06/backend/project/infrastructure/persistence/ProjectPersistenceAdapter.javasrc/main/java/com/module06/backend/project/presentation/api/ProjectController.javasrc/test/java/com/module06/backend/project/application/service/ProjectServiceTest.javasrc/test/java/com/module06/backend/project/infrastructure/persistence/ProjectPersistenceAdapterListFilterTest.javasrc/test/java/com/module06/backend/project/presentation/api/ProjectControllerTest.java
- toLowerCase()에 Locale.ROOT 명시(터키어 등 로케일 의존 대소문자 변환 방지) - 키워드 검색 테스트가 결과 개수뿐 아니라 실제 프로젝트명까지 검증하도록 강화 - 서비스 계층이 비어있지 않은 keyword를 목록·count 조회에 동일하게 전달하는지 검증하는 테스트 추가 PR #452
📌 연관 이슈
📝 작업 내용
GET /api/projects)에keyword파라미터 추가 — 프로젝트명 대소문자 무시 부분일치 검색sort화이트리스트에name추가 (기존 dueDate·createdAt과 동일하게 지원)ProjectRepository)부터 영속성 어댑터까지 5개 계층 전부 반영, 페이지네이션은 기존 count 쿼리 재사용 구조라 별도 변경 없음🖥️ 프론트엔드 연동 가이드 (API 명세)
1. 주요 엔드포인트
GET/api/projects: 프로젝트 목록 조회 (기존 엔드포인트, 파라미터만 확장)2. 요청 파라미터 (Request)
dueDate|createdAt|name. 그 외 값은 기본값(createdAt)으로 조용히 대체(400 아님)asc|desc, 기본desc3. 정상 응답 예시 (200 OK)
응답 JSON 보기 (클릭)
{ "data": { "content": [ { "id": 1, "tag": "ZBRA", "color": "#059669", "name": "Zebra Groupware", "description": "설명", "status": "TODO", "startDate": "2026-01-01", "dueDate": "2026-12-31", "teamCount": 0, "actionCount": 0, "completedActionCount": 0, "meetingCount": 0, "progressPct": 0.0, "teamNames": [] } ], "page": 0, "size": 20, "totalElements": 1, "totalPages": 1, "hasNext": false }, "httpStatus": 200, "message": "프로젝트 목록을 조회했습니다." }4.⚠️ 프론트엔드 참고 및 주의사항
sort=name을 안 보내던 기존 요청은 동작 그대로다 — 이번 변경은 파라미터 추가만, 기존 계약은 안 건드림keyword는 이름 필드만 검색 대상이다(설명·태그는 검색 안 됨)🚨 주요 에러 코드 및 예외 (Exceptions)
💡 백엔드 리뷰 포인트 (Backend Review)
keyword가 도메인 계약(ProjectRepository)부터 프레젠테이션까지 5계층 전부에 흘러가는지, content 쿼리와 count 쿼리가 항상 같은 Specification을 쓰는 기존 원칙이 keyword 조건에도 유지됐는지 확인 부탁ProjectService.getOwnerDashboardSummary(대시보드 KPI)가 같은countByCompanyId를 호출하고 있어서 이번 시그니처 변경에 딸려 함께 수정됐다 — 원래 이슈 범위 밖이지만 컴파일이 걸려서 불가피했음. 이 부분만 별도로 봐주시면 좋겠음✅ 체크리스트
Summary by CodeRabbit
새 기능
개선 사항