Skip to content

[URECA-82] Chore: 코드 정리#57

Merged
joonhyong merged 1 commit intodevelopfrom
URECA-82/Chore/code-refactor
Jan 30, 2026
Merged

[URECA-82] Chore: 코드 정리#57
joonhyong merged 1 commit intodevelopfrom
URECA-82/Chore/code-refactor

Conversation

@joonhyong
Copy link
Copy Markdown
Contributor

@joonhyong joonhyong commented Jan 30, 2026

Key Changes

작업 내역

💬 공유사항 to 리뷰어

비고

Summary by CodeRabbit

릴리스 노트

  • New Features

    • API 문서화 개선 (OpenAPI 메타데이터 추가)
  • Bug Fixes

    • 토큰 만료 검증 로직 강화
  • Chores

    • 예제 기능 제거
    • API 문서 라벨 업데이트
    • 코드 주석 정리

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions github-actions bot changed the title chore: 코드 정리 [URECA-82] Chore: chore: 코드 정리 Jan 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

이 PR은 프로젝트 전반의 코드 정리 작업입니다. 주요 변경 사항은 다음과 같습니다: 인증 및 정책 관련 파일에서 설명 주석 제거, RefreshTokenServiceImpl에 토큰 만료 시간에 대한 null 체크 추가, 여러 컨트롤러에 Swagger/OpenAPI 태그 주석 추가, 레거시 Example 도메인 모듈 전체 삭제(컨트롤러, 서비스, DTO, 매퍼, 모델, XML), Swagger 설정의 태그 라벨 이름 변경, 그리고 각 파일의 인라인 주석 제거입니다.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes


검토 포인트

✅ 긍정적 측면

명확한 의도의 정리 작업입니다. 레거시 Example 모듈의 완전 제거와 주석 정리가 코드베이스를 간결하게 만듭니다.

⚠️ 주의 깊게 검토해야 할 부분

1. RefreshTokenServiceImpl의 null 체크 추가

  • 변경 사항: savedToken.getExpiresAt() 결과에 대한 null 체크 추가, null이면 REFRESH_TOKEN_INVALID 예외 발생
  • 확인 사항:
    • 이 필드가 실제로 null이 될 수 있는 경우가 존재하는지 확인하세요
    • 기존 로직에서 이 null 값으로 인한 NPE 발생 이력이 있었는지 확인하세요
    • 만료된 토큰 삭제 전에 null 체크가 적절히 배치되어 있는지 검증하세요

2. Example 모듈 전체 삭제

  • 변경 사항: ExampleController, ExampleService, ExampleResponse DTO, ExampleMapper, Example 도메인 모델, MyBatis XML 맵퍼 전체 제거
  • 확인 사항:
    • 클라이언트나 다른 모듈에서 GET /examples 엔드포인트를 사용 중인지 확인하세요
    • Example 모델을 참조하는 다른 서비스나 컨트롤러가 있는지 검색으로 확인하세요
    • API 문서나 클라이언트 스펙 업데이트가 필요한지 확인하세요

3. Swagger 태그 일관성

  • 변경 사항: SwaggerConfig에서 "2. Exam" → "2. Policy", "3. STT" → "3. Call"로 이름 변경, 여러 컨트롤러에 @Tag 어노테이션 추가
  • 확인 사항:
    • 모든 컨트롤러가 적절한 태그로 분류되었는지 확인하세요
    • 태그 번호 체계(1, 2, 3, 5...)가 일관성 있게 유지되고 있는지 확인하세요
    • 빠진 컨트롤러가 있는지 검토하세요

📚 개선 제안

1. 주석 제거의 목적 명확화

  • 현재 다양한 파일에서 주석이 제거되었는데, 이들이 정말 불필요한지 재검토하세요
  • 특히 암호화 로직(OAuthTokenCrypto)의 주석은 유지보수성 관점에서 가치가 있을 수 있습니다
  • 참고: 자바 코드 주석 작성 가이드

2. 테스트 커버리지 확인

  • RefreshTokenServiceImpl의 null 체크 로직이 단위 테스트에서 검증되고 있는지 확인하세요
  • Example 모듈 제거 후 관련 통합 테스트도 함께 제거되었는지 확인하세요

3. 마이그레이션 계획

  • Example 엔드포인트를 사용 중인 클라이언트에 대한 deprecation 안내나 마이그레이션 가이드가 필요할 수 있습니다
🚥 Pre-merge checks | ✅ 1 | ❌ 4
❌ Failed checks (2 warnings, 2 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning ExampleController, ExampleResponse, ExampleService, ExampleMapper, Example, ExampleMapper.xml 등 예제 관련 코드 전체 삭제는 적절하지만, 다수의 Swagger @Tag 어노테이션 추가는 주요 변경사항으로 보기 어렵습니다. Swagger 어노테이션 추가와 예제 코드 삭제를 별도 PR로 분리하세요. 각 PR의 목적과 범위를 명확히 하세요.
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.
Title check ❓ Inconclusive PR 제목이 "코드 정리"로 매우 모호하여 어떤 코드를 정리했는지 구체적으로 알 수 없습니다. 제목을 더 구체적으로 수정하세요. 예: "URECA-82 Chore: 불필요한 예제 코드 및 주석 정리" 또는 주요 변경사항을 명시하세요.
Linked Issues check ❓ Inconclusive 연결된 이슈 #56은 "불필요한 코드 정리"라는 추상적 설명만 제공하며, 체크리스트 항목이 미완료 상태입니다. 이슈 #56의 체크리스트를 완성하고, 어떤 코드가 정리되었는지 명확한 목록을 제시하세요.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch URECA-82/Chore/code-refactor

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In
`@src/main/java/com/ureca/unity/domain/auth/service/RefreshTokenServiceImpl.java`:
- Around line 75-78: The deletion of expired refresh tokens in
RefreshTokenServiceImpl is rolled back because refreshAccessToken() is
transactional and throws CustomException; extract the deletion into a separate
method (e.g., deleteExpiredToken(String refreshToken)) annotated with
`@Transactional`(propagation = Propagation.REQUIRES_NEW) and call
refreshTokenMapper.deleteByToken(...) from that method so the deletion commits
in its own transaction; alternatively, if you prefer not to add a new method,
change the transactional settings on refreshAccessToken() to
`@Transactional`(noRollbackFor = CustomException.class) to prevent rollback of the
delete before rethrowing the exception.

In `@src/main/java/com/ureca/unity/global/config/OAuthTokenCrypto.java`:
- Line 58: 현재 OAuthTokenCrypto 클래스의 복호화 코드에서 조건문 if (in.length < IV_LEN + 1)
return enc;는 조작된 짧은 입력을 원문(enc)으로 그대로 반환해 실패-개방을 유발하므로, 이 분기에서 조용히 원문을 반환하지 말고
null 또는 적절한 런타임 예외(예: IllegalArgumentException 또는 custom InvalidTokenException)를
던지하도록 변경하고, 관련 호출부(복호화 호출자)가 이 반환값/예외를 명시적으로 invalid token 처리하도록 업데이트하세요; 변경 대상
식별자: OAuthTokenCrypto, IV_LEN, 변수 in, 반환값 enc.
🧹 Nitpick comments (1)
src/main/java/com/ureca/unity/global/config/SwaggerConfig.java (1)

18-22: 전역 태그 목록에 "5. Recommend" 추가하기

RecommendController에서 @Tag(name = "5. Recommend")로 선언하고 있는데, SwaggerConfig의 전역 태그 목록(lines 18-22)에 빠져있습니다. 컨트롤러에서 선언한 태그를 전역 리스트에도 명시하면 Swagger UI의 정렬과 메타데이터가 일관되며, OpenAPI 스펙이 더 완전해집니다.

제안 변경
                .tags(List.of(
                        new io.swagger.v3.oas.models.tags.Tag().name("1. Auth"),
                        new io.swagger.v3.oas.models.tags.Tag().name("2. Policy"),
                        new io.swagger.v3.oas.models.tags.Tag().name("3. Call"),
-                       new io.swagger.v3.oas.models.tags.Tag().name("4. Summary")
+                       new io.swagger.v3.oas.models.tags.Tag().name("4. Summary"),
+                       new io.swagger.v3.oas.models.tags.Tag().name("5. Recommend")
                ))

@joonhyong joonhyong merged commit 53f82d1 into develop Jan 30, 2026
3 checks passed
@joonhyong joonhyong deleted the URECA-82/Chore/code-refactor branch January 30, 2026 00:46
@Chaejy Chaejy changed the title [URECA-82] Chore: chore: 코드 정리 [URECA-82] Chore: 코드 정리 Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[URECA-82] Chore: 코드 정리

3 participants