[Fix] 관리자 프로젝트 페이지네이션이 정상 동작하지 않는 문제 해결 #30 - #38
Conversation
추가 반영: Project/ProjectRequest
|
|
LGTM PaginationUtils 으로 페이지 네이션 처리에 대한 공통 처리 로직이 생긴 것이 너무 좋은 것 같습니다. 고생하셨습니다! |
|
Conflicht 해결해주시고 작업이 완료되었다면 Draft 풀어주세요 |
추가 반영: ProjectRequest 페이지네이션 marker 규약 정리ProjectRequest 목록도 OpenStack 리소스형 도메인과 동일하게 ID cursor 방식으로 맞췄습니다.
검증 결과: 로컬 Swagger 테스트 환경:
|
|
Conflict 해결해주시고 Draft 풀어주세요. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f3c7804d2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try { | ||
| Map<String, String> keystoneListProjectRequest = Collections.emptyMap(); | ||
| if (pageRequest != null) KeystoneAPIUtils.createKeystoneListProjectRequest( | ||
| PageRequest normalized = PaginationUtils.normalize(pageRequest, false); |
There was a problem hiding this comment.
Preserve unpaginated user project listings
When the non-paginated GET /api/v1/projects flow calls ProjectModule.getAllProjectListForUser, it passes pageRequest as null, but this normalization now turns that into limit=10 and sends the limit to Keystone. Users with more than 10 accessible projects will only see the first 10 in this list endpoint, whereas the previous null-page path sent no pagination query and the caller still expects all projects.
Useful? React with 👍 / 👎.
…-pagination # Conflicts: # src/test/java/com/acc/local/service/adapters/project/AdminProjectServiceAdapterTest.java # src/test/java/com/acc/local/service/modules/auth/ProjectModuleTest.java
업데이트 반영 및 실제 동작 검증 완료Codex Agent Comment 제안을 반영해
재검토 요청드립니다. @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0bfd6a8249
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
LGTM |
📌 변경 요약 (Summary)
limit,marker가 무시되던 문제를 수정했습니다.next/prev페이지 이동이 실제로 동작하도록 수정했습니다.links.nextURL 전체가 아닌 marker 값만 추출하도록 수정했습니다.🔗 관련 이슈 (Related Issue)
Closes #30
🛠 작업 내용 / 작업 순서 (Implementation Details)
links파싱 로직 확인PaginationUtils추가 및 null/blank/default marker 처리 통합projectRequestId기반 cursor 조회로 변경✨ 주요 변경 사항 (Key Changes)
PaginationUtils추가PageRequestnull/default 처리관리자/사용자 프로젝트 생성요청 목록 수정
pageRequest.getMarker()호출만 하고 값을 쓰지 않던 문제 수정projectRequestId > marker/projectRequestId < marker기반 cursor 조회 적용direction=prev조회 시 DESC로 가져온 결과를 응답 순서에 맞게 ASC로 재정렬limit + 1조회로 다음/이전 페이지 존재 여부를 판단nextMarker,prevMarker,first,last계산을 실제 cursor 결과 기준으로 정리Keystone project pagination 수정
marker,limit가 실제 전달되도록 보정links.next/links.previous에서 marker query param만 추출하도록 수정인증 도메인 보강
🧪 테스트 결과 (Test Results)
테스트 환경
http://127.0.0.1:8080aolda-issue1-mariadbMariaDB 컨테이너aolda-test-redisRedis 컨테이너SessionData를 직접 생성하고acc-session-id쿠키로 API 호출테스트 방법
대상 자동 테스트 실행
./gradlew test --tests com.acc.local.service.modules.auth.ProjectModuleTest --tests com.acc.local.service.adapters.project.AdminProjectServiceAdapterTest --tests com.acc.global.common.PaginationUtilsTestBUILD SUCCESSFUL전체 자동 테스트 실행
./gradlew testBUILD SUCCESSFUL실제 API 테스트 환경 확인
/actuator/health호출로UP확인프로젝트 생성요청 테스트 데이터 생성
PENDING상태의issue30-selftest-*프로젝트 생성요청 5건 삽입issue30-selftest-session생성keystoneUserId는 관리자 테스트 사용자로 설정관리자 프로젝트 생성요청 목록 실제 API 호출
GET /api/v1/admin/projects/request?keyword=issue30-selftest&limit=2&direction=nextGET /api/v1/admin/projects/request?keyword=issue30-selftest&limit=2&direction=next&marker=issue30-selftest-002GET /api/v1/admin/projects/request?keyword=issue30-selftest&limit=2&direction=prev&marker=issue30-selftest-003GET /api/v1/admin/projects/request?keyword=issue30-selftest&limit=2&direction=next&marker=issue30-selftest-004사용자 프로젝트 생성요청 목록 실제 API 호출
GET /api/v1/projects/request?keyword=issue30-selftest&limit=2&direction=nextGET /api/v1/projects/request?keyword=issue30-selftest&limit=2&direction=next&marker=issue30-selftest-002GET /api/v1/projects/request?keyword=issue30-selftest&limit=2&direction=prev&marker=issue30-selftest-003관리자 프로젝트 목록 실제 API 호출
GET /api/v1/admin/projects?limit=1&direction=nextGET /api/v1/admin/projects?limit=1&direction=next&marker={projectId}인증 도메인 실제 API 호출
GET /api/v1/admin/users?limit=1&direction=nextGET /api/v1/admin/users?limit=1&direction=next&marker={userId}GET /api/v1/admin/roles?limit=1&direction=nextGET /api/v1/admin/roles?limit=1&direction=next&marker={roleId}GET /api/v1/admin/notices?limit=1&direction=next테스트 리소스 정리 검증
project_requests테스트 데이터 삭제테스트 결과
검증 결과 요약: