Skip to content

[FEAT/CHORE] AI 서버 연동을 위한 RestClient 등 설정 파일 추가#36

Merged
on1yoneprivate merged 7 commits into
developfrom
chore/#10-restclient
Jul 23, 2026
Merged

[FEAT/CHORE] AI 서버 연동을 위한 RestClient 등 설정 파일 추가#36
on1yoneprivate merged 7 commits into
developfrom
chore/#10-restclient

Conversation

@ownue

@ownue ownue commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

📍 개요

서비스 내 AI 서버 연동을 위한 RestClient 등 설정 파일 추가

⛓️‍💥 관련 이슈


🛠️ 작업 내용

  • 서비스 내의 AI 서버 연동을 위한 RestClient 등 설정 파일을 추가했습니다.

🔥 리뷰 요청 사항

리뷰어가 중점적으로 확인해주었으면 하는 내용을 작성해주세요.

  • 설정 파일을 적절히 작성했는지
  • AI API 스펙에 맞춰서 Request를 작성했는지
  • 컨벤션을 준수했는지

✅ 체크리스트

  • 코드 컨벤션을 준수했습니다.
  • 불필요한 코드 및 import를 제거했습니다.
  • 예외 처리를 적용했습니다.
  • 테스트를 완료했습니다.
  • 관련 Issue를 연결했습니다.

📎 참고 사항

  • AI API 명세서가 백엔드 API 명세서 작성 이후에 변경되었습니다. 변경된 코드에 맞춰 Request를 작성해 두었으나, 백엔드 API 명세는 아직 수정하지 못했습니다. 해당 PR 닫힌 후에 수정하겠습니다!
  • 코드래빗 리뷰가 끝난 뒤, 팀원 분들을 리뷰어로 설정할 예정입니다. 감사합니다.

Summary by CodeRabbit

  • 새 기능

    • 음악 메타데이터, 코드, 노트 정보를 내부 AI 분석 서버로 전송하고 분석 결과를 받을 수 있습니다.
    • AI 서버 연결 주소, 분석 경로, 연결·응답 시간 제한을 설정할 수 있습니다.
    • AI 서버의 연결 실패, 시간 초과, 잘못된 응답 및 서버 오류를 구분해 처리합니다.
  • 설정

    • AI 연동 설정이 ai.internal 기준으로 정리되었습니다.
    • 로컬 환경용 AI 서버 설정 예시가 추가되었습니다.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ownue, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4d56bc71-f5d6-4b23-a63c-413034c772fd

📥 Commits

Reviewing files that changed from the base of the PR and between afb24e8 and 32583de.

📒 Files selected for processing (3)
  • src/main/java/com/mr/global/client/ai/AiServerClient.java
  • src/test/java/com/mr/global/client/ai/AiServerClientTest.java
  • src/test/java/com/mr/global/config/AiServerPropertiesBindingTest.java
📝 Walkthrough

Walkthrough

내부 AI 서버 연동을 위한 설정 바인딩, 요청 DTO, 전용 RestClient, 예외 상태 매핑을 추가하고 Jackson 직렬화와 호출 동작을 테스트했습니다.

Changes

AI 서버 연동

Layer / File(s) Summary
AI 서버 설정 계약
src/main/java/com/mr/global/config/AiServerProperties.java, src/main/resources/application.yml, MR_config/local/application.example.yml, .gitignore
ai.internal 설정에 base URL, 연결·읽기 타임아웃, 분석 엔드포인트를 정의하고 설정 바인딩 구조를 추가했습니다.
분석 요청 및 호출 흐름
src/main/java/com/mr/global/client/ai/AiAnalysisRequest.java, src/main/java/com/mr/global/config/AiServerRestClientConfig.java, src/main/java/com/mr/global/apipayload/domain/AiServerErrorStatus.java, src/main/java/com/mr/global/client/ai/AiServerClient.java
분석 요청 record와 snake_case JSON 매핑을 추가하고, 타임아웃이 적용된 RestClient 및 AI 서버 호출·예외 변환을 구현했습니다.
직렬화 및 통합 검증
src/test/java/com/mr/global/client/ai/AiAnalysisRequestSerializationTest.java, src/test/java/com/mr/global/client/ai/AiServerClientTest.java, src/test/java/com/mr/global/config/AiServerPropertiesBindingTest.java
요청 JSON 직렬화, 성공 응답, HTTP 오류, 연결 실패·타임아웃, 설정 프리픽스 바인딩을 검증합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AiServerClient
  participant RestClient
  participant AI 서버
  AiServerClient->>RestClient: AiAnalysisRequest POST
  RestClient->>AI 서버: /analyze 호출
  AI 서버-->>RestClient: JSON 응답 또는 HTTP 오류
  RestClient-->>AiServerClient: JsonNode 반환 또는 GeneralException 변환
Loading

Possibly related PRs

  • Musereview/BE#2: AiServerErrorStatusAiServerClientGeneralException 연동과 직접 연결됩니다.

Poem

설정이 열리고, AI가 답하네
타임아웃엔 시계가 달리네
JSON은 뱀처럼 가지런히
오류 코드는 네 갈래로
RestClient, 출발! 🚀

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning .gitignore에 docs/.claude/CLAUDE.md 무시 규칙이 추가되어 AI 서버 연동 범위를 벗어난 변경이 포함됐습니다. 불필요한 .gitignore 변경은 별도 PR로 분리하고, AI 서버 연동에 필요한 설정/클라이언트 수정만 남기세요.
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 (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 AI 서버용 RestClient와 설정 추가라는 मुख्य 변경을 잘 요약합니다.
Linked Issues check ✅ Passed [#10] application.yml, 설정 바인딩, RestClient, Client, DTO, 예외 처리까지 요구된 연동 기반이 구현되었습니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/#10-restclient

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.

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

🤖 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/mr/global/client/ai/AiServerClient.java`:
- Around line 35-37: Update the ResourceAccessException handling in
AiServerClient to traverse the complete cause chain rather than checking only
e.getCause(). Classify any timeout-related cause, including
SocketTimeoutException, HttpTimeoutException, and connect-timeout exceptions, as
AiServerErrorStatus.TIMEOUT; map non-timeout causes to CONNECTION_FAILED.

In `@src/test/java/com/mr/global/config/AiServerPropertiesBindingTest.java`:
- Around line 39-49: Update 이전_ai_server_프리픽스로는_더이상_바인딩되지_않는다 to run with only
the legacy ai.server.base-url property, removing ai.internal.base-url and
related new-prefix values. Assert the resulting baseUrl() is empty or that the
configured validation failure occurs, so the test independently verifies the
legacy prefix is not bound.
🪄 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: CHILL

Plan: Pro Plus

Run ID: ef6fd935-b920-48c5-a81e-18682b150eda

📥 Commits

Reviewing files that changed from the base of the PR and between 27f7b7e and afb24e8.

📒 Files selected for processing (12)
  • .gitignore
  • MR_config/local/application.example.yml
  • src/main/java/com/mr/global/apipayload/domain/AiServerErrorStatus.java
  • src/main/java/com/mr/global/client/ai/AiAnalysisRequest.java
  • src/main/java/com/mr/global/client/ai/AiServerClient.java
  • src/main/java/com/mr/global/config/AiServerProperties.java
  • src/main/java/com/mr/global/config/AiServerRestClientConfig.java
  • src/main/resources/application.example.yml
  • src/main/resources/application.yml
  • src/test/java/com/mr/global/client/ai/AiAnalysisRequestSerializationTest.java
  • src/test/java/com/mr/global/client/ai/AiServerClientTest.java
  • src/test/java/com/mr/global/config/AiServerPropertiesBindingTest.java
💤 Files with no reviewable changes (1)
  • src/main/resources/application.example.yml

Comment thread src/main/java/com/mr/global/client/ai/AiServerClient.java Outdated
Comment thread src/test/java/com/mr/global/config/AiServerPropertiesBindingTest.java Outdated

@kimyw1018 kimyw1018 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.

에러처리 세분화 잘 해두신것 같습니다 빠르게 머지하시죠

@on1yoneprivate on1yoneprivate 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.

수고하셨습니다~

@on1yoneprivate
on1yoneprivate merged commit 25e7ef6 into develop Jul 23, 2026
2 checks passed
@ownue
ownue deleted the chore/#10-restclient branch July 23, 2026 14:20
@coderabbitai coderabbitai Bot mentioned this pull request Jul 24, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⚙️ Setting - AI 서버 연동을 위한 RestClient 및 설정 추가

3 participants