Skip to content

Feature/20 dev gRPC#21

Merged
coehgns merged 19 commits intomainfrom
feature/20-dev-gRPC
Aug 15, 2025
Merged

Feature/20 dev gRPC#21
coehgns merged 19 commits intomainfrom
feature/20-dev-gRPC

Conversation

@coehgns
Copy link
Copy Markdown
Contributor

@coehgns coehgns commented Aug 1, 2025

📌 개요

  • 관리자 ID(UUID)를 기반으로 내부 관리자 정보를 조회할 수 있는 gRPC 클라이언트를 구현했습니다.
  • 서비스 간 통신의 효율성과 타입 안정성을 확보하기 위해 CoroutineStub 기반의 gRPC 호출 방식을 사용했습니다.
  • 누락된 커밋들과 gRPC 관련 의존성을 추가하였습니다.

🧩 주요 변경 사항

✅ 기능 구현

  • AdminGrpcClient 클래스 생성

  • getAdminInfoByAdminId(UUID): InternalAdminResponse 메서드 구현

  • CoroutineStub을 사용한 비동기 gRPC 호출

  • InternalAdminResponse DTO 생성

  • gRPC 응답 데이터를 도메인 내부에서 사용할 수 있도록 변환

  • admin.proto 정의

  • GetAdminByUUID RPC 메서드 및 관련 메시지 정의

Summary by CodeRabbit

  • New Features

    • gRPC 기반 외부 관리자 서비스 연동을 위한 클라이언트 및 데이터 응답 클래스가 추가되었습니다.
    • 관리자 정보를 조회하는 gRPC 서비스 및 프로토콜 정의가 도입되었습니다.
    • 신규 Gradle 빌드 스크립트가 추가되어 다양한 의존성과 플러그인, 프로토콜 버퍼 설정이 적용되었습니다.
  • Bug Fixes

    • 없음
  • Tests

    • 애플리케이션 컨텍스트 로드 여부를 확인하는 통합 테스트가 추가되었습니다.
  • Chores

    • gRPC, Protobuf 등 관련 라이브러리 및 버전 상수가 추가되었습니다.
    • Kotlin 플러그인 버전이 변경되었습니다.
    • 코드 스타일 검사에서 복잡성 및 매직 넘버 규칙이 비활성화되었습니다.

@coehgns coehgns self-assigned this Aug 1, 2025
@coehgns coehgns added the Setup label Aug 1, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 1, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

gRPC 및 protobuf 관련 의존성 추가와 버전 관리가 이루어졌으며, casper-feed 모듈의 Gradle 빌드 스크립트와 proto 파일, gRPC 클라이언트 및 응답 DTO, 통합 테스트 클래스가 새로 도입되었습니다. 또한 detekt 정적 분석 규칙 일부가 비활성화되었고, Kotlin 버전이 다운그레이드되었습니다.

Changes

Cohort / File(s) Change Summary
gRPC & Protobuf 의존성 및 버전 관리
buildSrc/src/main/kotlin/Dependencies.kt, buildSrc/src/main/kotlin/DependencyVersion.kt
gRPC 서버/클라이언트 및 protobuf 관련 의존성 상수와 버전 상수 3종이 새로 추가됨.
Kotlin 플러그인 버전 변경
buildSrc/src/main/kotlin/PluginVersion.kt
KOTLIN_VERSION이 1.9.25에서 1.9.23으로 변경됨.
casper-feed 빌드 및 의존성 설정
casper-feed/build.gradle.kts
casper-feed 모듈의 Gradle 빌드 스크립트가 새로 추가되어, 다양한 플러그인, 의존성, Protobuf/gRPC 설정, Kotlin/JVM 옵션, 테스트 설정이 포함됨.
gRPC 클라이언트 및 응답 DTO 추가
casper-feed/src/main/kotlin/hs/kr/entrydsm/feed/infrastructure/grpc/client/AdminGrpcClient.kt,
casper-feed/src/main/kotlin/hs/kr/entrydsm/feed/infrastructure/grpc/client/dto/response/InternalAdminResponse.kt
Admin 서비스와 통신하는 gRPC 클라이언트와, 응답을 담는 DTO 클래스가 새로 생성됨.
Proto 서비스 정의
casper-feed/src/main/proto/admin.proto
AdminService gRPC 서비스 및 관련 메시지들이 정의된 proto 파일이 추가됨.
통합 테스트 추가
casper-feed/src/test/kotlin/hs/kr/entrydsm/feed/CasperFeedApplicationTests.kt
SpringBootTest 기반의 애플리케이션 컨텍스트 로드 테스트가 추가됨.
정적 분석 규칙 변경
detekt.yml
LongParameterList 및 MagicNumber 규칙이 비활성화됨.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant AdminGrpcClient
    participant gRPC_Server

    Client->>AdminGrpcClient: getAdminInfoByAdminId(adminId)
    AdminGrpcClient->>gRPC_Server: GetAdminByUUID(admin_id)
    gRPC_Server-->>AdminGrpcClient: GetAdminIdResponse(admin_id)
    AdminGrpcClient-->>Client: InternalAdminResponse(id)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15-20 minutes

Poem

🐇
새로운 gRPC 바람이 분다,
proto 파일에 꿈을 싣고,
Admin 정보를 찾아가는 길,
Kotlin 코드와 함께 춤춘다.
빌드 스크립트도 새 옷을 입고,
테스트도 살짝 인사하네—
오늘도 코드밭엔 평화가!

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/20-dev-gRPC

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coehgns
Copy link
Copy Markdown
Contributor Author

coehgns commented Aug 2, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 2, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coehgns
Copy link
Copy Markdown
Contributor Author

coehgns commented Aug 2, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 2, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coehgns
Copy link
Copy Markdown
Contributor Author

coehgns commented Aug 2, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 2, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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: 7

🔭 Outside diff range comments (1)
buildSrc/src/main/kotlin/DependencyVersion.kt (1)

2-2: Kotlin 버전 상수 불일치
앞서 지적한 PluginVersion 와 값이 달라 빌드 파이프라인에서 혼용될 가능성이 있습니다. 한쪽 값을 수정하거나, 단일 소스-오브-트루스만 남기는 리팩터를 제안드립니다.

🧹 Nitpick comments (4)
buildSrc/src/main/kotlin/DependencyVersion.kt (1)

15-17: 상수명 오타 및 중복 버전 상수
GOGGLE_PROTOBUF 는 오타로 보이며, 이미 PROTOBUF(3.25.3) 상수가 존재합니다. 중복 정의는 혼란을 유발하므로 다음과 같이 정리하는 편이 좋습니다.

-const val GOGGLE_PROTOBUF = "3.25.3"
+// 중복 제거: 필요 시 PROTOBUF 상수만 사용하거나
+const val GOOGLE_PROTOBUF = "3.25.3"
detekt.yml (1)

14-15: MagicNumber 규칙 전면 해제
완전 비활성화보다는 ignoreNumbers 목록 확장, 테스트 소스 전용 disable 등 세분화 설정을 권장합니다. 매직 넘버 유입 시 유지보수 난이도가 급격히 높아질 수 있습니다.

casper-feed/src/test/kotlin/hs/kr/entrydsm/feed/CasperFeedApplicationTests.kt (1)

22-25: 의미 있는 검증 로직 추가 제안
contextLoads() 가 빈 메서드인 경우 실패 조건이 애매합니다. 간단히 주요 Bean 존재 여부를 확인하면 테스트 신뢰도가 상승합니다.

@Autowired lateinit var adminGrpcClient: AdminGrpcClient

@Test
fun contextLoads() {
    assertNotNull(adminGrpcClient)
}
casper-feed/build.gradle.kts (1)

88-88: 하드코딩된 버전 대신 상수를 사용해주세요.

Spring Kafka 의존성에서 버전이 하드코딩되어 있습니다. 일관성을 위해 Dependencies 상수를 사용하는 것이 좋습니다.

다음과 같이 수정하는 것을 권장합니다:

-    implementation("org.springframework.kafka:spring-kafka:3.1.2")
+    // 위의 Dependencies.KAFKA가 이미 선언되어 있으므로 이 줄은 제거하거나 버전 상수를 사용하세요
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between a4095e6 and e6775e7.

📒 Files selected for processing (9)
  • buildSrc/src/main/kotlin/Dependencies.kt (1 hunks)
  • buildSrc/src/main/kotlin/DependencyVersion.kt (1 hunks)
  • buildSrc/src/main/kotlin/PluginVersion.kt (1 hunks)
  • casper-feed/build.gradle.kts (1 hunks)
  • casper-feed/src/main/kotlin/hs/kr/entrydsm/feed/infrastructure/grpc/client/AdminGrpcClient.kt (1 hunks)
  • casper-feed/src/main/kotlin/hs/kr/entrydsm/feed/infrastructure/grpc/client/dto/response/InternalAdminResponse.kt (1 hunks)
  • casper-feed/src/main/proto/admin.proto (1 hunks)
  • casper-feed/src/test/kotlin/hs/kr/entrydsm/feed/CasperFeedApplicationTests.kt (1 hunks)
  • detekt.yml (2 hunks)
🧰 Additional context used
🪛 Buf (1.55.1)
casper-feed/src/main/proto/admin.proto

3-3: Files with package "casper.feed" must be within a directory "casper/feed" relative to root but were in directory "casper-feed/src/main/proto".

(PACKAGE_DIRECTORY_MATCH)

🔇 Additional comments (4)
casper-feed/src/main/kotlin/hs/kr/entrydsm/feed/infrastructure/grpc/client/dto/response/InternalAdminResponse.kt (1)

10-12: LGTM – 간결하고 명확한 DTO
UUID 필드만 노출하여 도메인 경량화를 잘 수행하셨습니다. 추후 확장(예: 이름·권한) 시에도 가변성 최소화를 위해 별도 DTO 추가를 고려해 주세요.

detekt.yml (1)

4-7: LongParameterList 규칙 비활성화 사유 확인 필요
gRPC stub 생성 코드 등에서 매개변수 길이가 길어질 수 있지만, 전역적으로 규칙을 끄면 핵심 비즈니스 코드 품질이 저하될 수 있습니다. 모듈/패키지 단위 제외 또는 @Suppress 로 국소화하는 방안을 검토해 주세요.

buildSrc/src/main/kotlin/Dependencies.kt (1)

41-42: gRPC Spring Boot starter 의존성이 올바르게 추가되었습니다.

gRPC 서버 및 클라이언트를 위한 Spring Boot starter 의존성이 적절히 정의되었습니다.

casper-feed/build.gradle.kts (1)

94-116: Protobuf 설정이 올바르게 구성되었습니다.

gRPC와 gRPC Kotlin 플러그인이 적절히 설정되어 코드 생성이 제대로 작동할 것입니다.

@coehgns coehgns merged commit 08c77f3 into main Aug 15, 2025
1 check passed
@coehgns coehgns deleted the feature/20-dev-gRPC branch August 15, 2025 09:35
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.

1 participant