Skip to content

fix: RestClient Builder Bean 등록#101

Merged
buddle031 merged 1 commit into
mainfrom
fix/restclient-builder-bean
Jun 27, 2026
Merged

fix: RestClient Builder Bean 등록#101
buddle031 merged 1 commit into
mainfrom
fix/restclient-builder-bean

Conversation

@buddle031

@buddle031 buddle031 commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

✨ 작업 내용 한 줄 요약

  • RestClient.Builder Bean을 등록하여 소셜 연동 해제 기능의 배포 오류를 해결

🛠️ 작업 내용

🧠 기술적 의사결정

📚 참고 자료 (선택)

📷 스크린샷 (선택)

Summary by CodeRabbit

  • New Features
    • 애플리케이션에서 공통으로 사용할 HTTP 클라이언트 빌더를 사용할 수 있도록 설정이 추가되었습니다.
    • 관련 설정 컴포넌트가 새로 등록되어, 다른 기능에서 재사용하기 쉬워졌습니다.

@buddle031 buddle031 requested a review from mike7643 as a code owner June 27, 2026 04:15
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

AuthRestClientConfig 설정 클래스가 추가되고, RestClient.Builder 빈이 등록되었습니다.

Changes

Auth RestClient 구성

Layer / File(s) Summary
RestClient.Builder 빈 추가
src/main/java/com/zimdugo/auth/config/AuthRestClientConfig.java
@Configuration 클래스가 추가되고 restClientBuilder()RestClient.builder()를 반환하는 @Bean으로 등록되었습니다.

Sequence Diagram(s)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 훌쩍훌쩍 스프링 숲길에
토끼가 빈을 하나 띄웠네
RestClient 빌더가 폴짝 생기고
설정 한 줌에 길이 열렸네
당근처럼 반짝, 준비 완료!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning 작업 내용과 기술적 의사결정이 비어 있어 템플릿의 필수 정보를 충분히 채우지 못했습니다. 작업 내용, 기술적 의사결정, 참고 자료 섹션을 채우고 변경 이유와 영향 범위를 구체적으로 적어 주세요.
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
Title check ✅ Passed 제목이 RestClient.Builder 빈 등록이라는 핵심 변경을 명확히 담고 있어 변경 내용과 잘 맞습니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/restclient-builder-bean

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.

🧹 Nitpick comments (1)
src/main/java/com/zimdugo/auth/config/AuthRestClientConfig.java (1)

10-12: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

RestClient.Builder를 singleton으로 노출하면 상태가 공유됩니다.

지금 빈은 기본 scope가 singleton이라서, 다른 주입 지점들이 baseUrl(...) 같은 설정을 누적해서 바꾼 상태를 서로 공유하게 됩니다. 실제로 GoogleSocialAccountUnlinkClientKakaoSocialAccountUnlinkClient가 둘 다 주입받은 builder를 바로 변경하고 있으니, prototype scope로 바꾸거나 Spring Boot가 제공하는 구성 경로를 타는 편이 안전합니다.

제안 예시
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Scope;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
 import org.springframework.web.client.RestClient;
 
 `@Configuration`
 public class AuthRestClientConfig {
 
     `@Bean`
+    `@Scope`(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
     public RestClient.Builder restClientBuilder() {
         return RestClient.builder();
     }
 }
🤖 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/main/java/com/zimdugo/auth/config/AuthRestClientConfig.java` around lines
10 - 12, `restClientBuilder()` currently exposes a shared singleton
`RestClient.Builder`, so mutations like `baseUrl(...)` from clients such as
`GoogleSocialAccountUnlinkClient` and `KakaoSocialAccountUnlinkClient` can leak
between consumers. Change this bean to avoid shared mutable state by switching
the builder to prototype scope or by using Spring Boot’s recommended
configuration path, and keep the fix localized to
`AuthRestClientConfig.restClientBuilder()`.
🤖 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.

Nitpick comments:
In `@src/main/java/com/zimdugo/auth/config/AuthRestClientConfig.java`:
- Around line 10-12: `restClientBuilder()` currently exposes a shared singleton
`RestClient.Builder`, so mutations like `baseUrl(...)` from clients such as
`GoogleSocialAccountUnlinkClient` and `KakaoSocialAccountUnlinkClient` can leak
between consumers. Change this bean to avoid shared mutable state by switching
the builder to prototype scope or by using Spring Boot’s recommended
configuration path, and keep the fix localized to
`AuthRestClientConfig.restClientBuilder()`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 143bb93d-1650-4d6d-a121-3ad9faab34db

📥 Commits

Reviewing files that changed from the base of the PR and between 78eaaf2 and 1c79fe7.

📒 Files selected for processing (1)
  • src/main/java/com/zimdugo/auth/config/AuthRestClientConfig.java

@buddle031 buddle031 merged commit 7b26cfc into main Jun 27, 2026
4 checks passed
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.

1 participant