chore: 프로젝트 초기 세팅 - #2
Jinyoung-Kim96 wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughSpring Boot 기반 알림 서비스 프로젝트의 초기 설정을 구성합니다. Gradle 빌드 시스템, 프로젝트 구조, Spring Boot 애플리케이션 클래스, 간단한 REST 엔드포인트, 애플리케이션 설정, 그리고 기본 테스트를 포함합니다. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
src/test/java/com/michelet/notification/NotificationApplicationTests.java (1)
9-11: 핵심 API 동작 검증 테스트 1개를 추가하는 것을 권장합니다.Line 10의
contextLoads()만으로는/notifications/hello응답 회귀를 잡기 어렵습니다.200 OK와 응답 본문 검증 테스트를 함께 두면 PR 목표와도 더 잘 맞습니다.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/test/java/com/michelet/notification/NotificationApplicationTests.java` around lines 9 - 11, Add a unit/integration test in the NotificationApplicationTests class that calls GET "/notifications/hello" and asserts a 200 OK plus the expected response body; create a new test method (e.g., verifyHelloEndpointReturns200AndBody()) that uses MockMvc (add `@AutoConfigureMockMvc` to the test class and `@Autowired` MockMvc mockMvc if not present) or TestRestTemplate if your class is using webEnvironment, perform the GET request, and assert both status is 200 and the response content equals the known hello payload so the PR verifies the /notifications/hello regression.src/main/resources/application.yaml (1)
5-6: 포트 하드코딩 대신 환경변수 오버라이드를 권장합니다.Line 6이 고정값이라 환경별 배포 유연성이 떨어집니다.
변경 제안
server: - port: 19600 + port: ${SERVER_PORT:19600}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/main/resources/application.yaml` around lines 5 - 6, Replace the hardcoded server.port value with an environment-variable-backed expression so deployments can override the port; change the server.port entry in application.yaml to reference an env var (e.g., server.port: ${PORT:19600} or ${SERVER_PORT:19600}) so the app still defaults to 19600 but can be overridden by the PORT/SERVER_PORT environment variable at runtime.build.gradle (1)
26-27: Eureka 의존성은 현재 런타임 설정과 의도가 어긋나 보입니다.
build.gradle의 Line 26에서 Eureka Client를 포함했지만,src/main/resources/application.yamlLine 8-10은eureka.client.enabled: false로 비활성화되어 있습니다. 당장 사용하지 않는다면 의존성은 제거하고, 실제 연결 시점에 다시 추가하는 쪽이 초기 표면(빌드 시간/취약점 면적) 관리에 유리합니다.♻️ 제안 diff
dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@build.gradle` around lines 26 - 27, 현재 application.yaml에서 eureka.client.enabled: false로 비활성화되어 있으므로 build.gradle에 선언된 의존성 implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'를 제거하거나 필요한 경우에만 포함되도록 변경하세요; 즉, build.gradle에서 해당 의존성 문자열을 삭제하거나 프로파일/조건부 빌드(예: 별도 Eureka-enabled gradle profile 또는 optional feature 모듈)로 이동하여 런타임에만 Eureka 클라이언트를 추가되도록 처리하십시오.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/resources/application.yaml`:
- Around line 8-12: 현재 build.gradle에 선언된
spring-cloud-starter-netflix-eureka-client 의존성이 있지만 application.yaml의
eureka.client.enabled가 false로 되어 있어 서비스 디스커버리가 기본적으로 비활성화됩니다; application.yaml의
eureka.client.enabled 값을 프로젝트 아키텍처에 맞게 기본 활성(true) 또는 프로파일별 설정으로
분리(application-dev.yaml, application-prod.yaml 등)하여 환경별로 클라이언트 활성화를 제어하고, 필요하면
주석 처리된 service-url.defaultZone 설정(${EUREKA_DEFAULT_ZONE:...})을 프로파일별 파일에 옮기거나 중앙
설정에서 관리하도록 수정하세요.
---
Nitpick comments:
In `@build.gradle`:
- Around line 26-27: 현재 application.yaml에서 eureka.client.enabled: false로 비활성화되어
있으므로 build.gradle에 선언된 의존성 implementation
'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'를 제거하거나
필요한 경우에만 포함되도록 변경하세요; 즉, build.gradle에서 해당 의존성 문자열을 삭제하거나 프로파일/조건부 빌드(예: 별도
Eureka-enabled gradle profile 또는 optional feature 모듈)로 이동하여 런타임에만 Eureka 클라이언트를
추가되도록 처리하십시오.
In `@src/main/resources/application.yaml`:
- Around line 5-6: Replace the hardcoded server.port value with an
environment-variable-backed expression so deployments can override the port;
change the server.port entry in application.yaml to reference an env var (e.g.,
server.port: ${PORT:19600} or ${SERVER_PORT:19600}) so the app still defaults to
19600 but can be overridden by the PORT/SERVER_PORT environment variable at
runtime.
In `@src/test/java/com/michelet/notification/NotificationApplicationTests.java`:
- Around line 9-11: Add a unit/integration test in the
NotificationApplicationTests class that calls GET "/notifications/hello" and
asserts a 200 OK plus the expected response body; create a new test method
(e.g., verifyHelloEndpointReturns200AndBody()) that uses MockMvc (add
`@AutoConfigureMockMvc` to the test class and `@Autowired` MockMvc mockMvc if not
present) or TestRestTemplate if your class is using webEnvironment, perform the
GET request, and assert both status is 200 and the response content equals the
known hello payload so the PR verifies the /notifications/hello regression.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e0176a5c-b53a-4d01-9677-442b4078b150
⛔ Files ignored due to path filters (1)
gradle/wrapper/gradle-wrapper.jaris excluded by!**/*.jar
📒 Files selected for processing (10)
.gitattributesbuild.gradlegradle/wrapper/gradle-wrapper.propertiesgradlewgradlew.batsettings.gradlesrc/main/java/com/michelet/notification/HelloController.javasrc/main/java/com/michelet/notification/NotificationApplication.javasrc/main/resources/application.yamlsrc/test/java/com/michelet/notification/NotificationApplicationTests.java
| eureka: | ||
| client: | ||
| enabled: false | ||
| # service-url: | ||
| # defaultZone: ${EUREKA_DEFAULT_ZONE:http://localhost:8761/eureka/} |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# 목적: Eureka 설정이 기본/프로파일별로 어떻게 정의되어 있는지 확인
fd -HI 'application*.yml' src/main/resources
fd -HI 'application*.yaml' src/main/resources
rg -n --iglob 'application*.y*ml' 'eureka|enabled|defaultZone|spring.profiles' src/main/resourcesRepository: Miche-Let/notification_service
Length of output: 326
🏁 Script executed:
# 프로파일별 설정 파일 확인 (더 광범위한 검색)
find src/main/resources -type f \( -name 'application*.yaml' -o -name 'application*.yml' \)
# application.yaml 전체 내용 확인
cat src/main/resources/application.yaml
# 다른 프로파일 설정이 있는지 확인
ls -la src/main/resources/ | grep -i applicationRepository: Miche-Let/notification_service
Length of output: 381
🏁 Script executed:
# Java config 클래스에서 Eureka 설정이 있는지 확인
rg -i 'eureka|@EnableEurekaClient|@EnableDiscoveryClient' src/main/java --type java -A 3Repository: Miche-Let/notification_service
Length of output: 56
🏁 Script executed:
# pom.xml 또는 build.gradle 확인 (Eureka 의존성)
find src -name 'pom.xml' -o -name 'build.gradle' | head -5Repository: Miche-Let/notification_service
Length of output: 56
🏁 Script executed:
# 프로젝트 루트의 설정/문서 파일 확인
ls -la | grep -i -E '(readme|pom|gradle|properties)'Repository: Miche-Let/notification_service
Length of output: 434
🏁 Script executed:
# application.yaml에서 Eureka 관련 설정이 더 있는지 확인
cat -n src/main/resources/application.yamlRepository: Miche-Let/notification_service
Length of output: 364
🏁 Script executed:
# build.gradle 확인 (Eureka 의존성 확인)
cat build.gradleRepository: Miche-Let/notification_service
Length of output: 883
Eureka 클라이언트 의존성이 있는데 기본값이 비활성화되어 있습니다.
build.gradle에 spring-cloud-starter-netflix-eureka-client 의존성이 선언되어 있지만, application.yaml에서 enabled: false로 설정되어 있습니다. 프로파일별 설정 파일(application-dev.yaml, application-prod.yaml 등)이 없어 서비스 디스커버리는 설정 변경 없이는 사용될 수 없습니다. 프로젝트 아키텍처에 맞게 기본값과 프로파일별 구성을 재검토해 주세요.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/resources/application.yaml` around lines 8 - 12, 현재 build.gradle에
선언된 spring-cloud-starter-netflix-eureka-client 의존성이 있지만 application.yaml의
eureka.client.enabled가 false로 되어 있어 서비스 디스커버리가 기본적으로 비활성화됩니다; application.yaml의
eureka.client.enabled 값을 프로젝트 아키텍처에 맞게 기본 활성(true) 또는 프로파일별 설정으로
분리(application-dev.yaml, application-prod.yaml 등)하여 환경별로 클라이언트 활성화를 제어하고, 필요하면
주석 처리된 service-url.defaultZone 설정(${EUREKA_DEFAULT_ZONE:...})을 프로파일별 파일에 옮기거나 중앙
설정에서 관리하도록 수정하세요.
📝 작업 내용
🚀 주요 변경 사항
✅ 자체 체크리스트 (필수)
./gradlew build실행 결과 정상 (인증샷 첨부)📸 테스트 인증샷
💬 리뷰어 전달사항 (선택)
📎 참고 자료
Summary by CodeRabbit
릴리스 노트
/notifications/hello)