Skip to content

chore: 프로젝트 초기 세팅 - #2

Open
Jinyoung-Kim96 wants to merge 1 commit into
devfrom
chore/1-init-setting
Open

Jinyoung-Kim96 wants to merge 1 commit into
devfrom
chore/1-init-setting

Conversation

@Jinyoung-Kim96

@Jinyoung-Kim96 Jinyoung-Kim96 commented Apr 26, 2026

Copy link
Copy Markdown

📝 작업 내용

  • 초기 설정 및 확인용 hello controller 생성

🚀 주요 변경 사항

완료한 이슈 번호 #1
Close #1
관련된 이슈 번호 (닫고 싶지 않은 경우)
Related to #

✅ 자체 체크리스트 (필수)

  • ./gradlew build 실행 결과 정상 (인증샷 첨부)
  • Postman 테스트 완료 (인증샷 첨부)
  • 팀 내 컨벤션 준수 및 불필요한 로그, import 제거
  • 중요한 변경 사항이 팀에 공유되었는지

📸 테스트 인증샷

image image

💬 리뷰어 전달사항 (선택)

특별히 봐주었으면 하는 부분이나 논의가 필요한 점을 적어주세요.

  • 논의점


📎 참고 자료

관련 문서, 레퍼런스 링크 등이 있다면 여기에 첨부해주세요.

Summary by CodeRabbit

릴리스 노트

  • 새 기능
    • 알림 서비스 애플리케이션 추가
    • HTTP 엔드포인트 제공 (/notifications/hello)
    • 포트 19600에서 서비스 실행

@Jinyoung-Kim96 Jinyoung-Kim96 linked an issue Apr 26, 2026 that may be closed by this pull request
3 tasks
@coderabbitai

coderabbitai Bot commented Apr 26, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Spring Boot 기반 알림 서비스 프로젝트의 초기 설정을 구성합니다. Gradle 빌드 시스템, 프로젝트 구조, Spring Boot 애플리케이션 클래스, 간단한 REST 엔드포인트, 애플리케이션 설정, 그리고 기본 테스트를 포함합니다.

Changes

Cohort / File(s) Summary
Gradle 설정
.gitattributes, build.gradle, gradle/wrapper/gradle-wrapper.properties, gradlew, gradlew.bat, settings.gradle
Java 21 Spring Boot 프로젝트를 위한 Gradle 빌드 시스템 구성. Spring Cloud BOM 2025.0.2, Spring Web, Eureka 클라이언트 의존성 포함. POSIX 및 Windows 환경 모두 지원.
Spring Boot 애플리케이션
src/main/java/com/michelet/notification/NotificationApplication.java
@SpringBootApplication 어노테이션이 적용된 부트스트랩 클래스 추가. 애플리케이션 시작점 제공.
REST 컨트롤러
src/main/java/com/michelet/notification/HelloController.java
/notifications/hello 엔드포인트를 통해 "hello from notification-service" 메시지를 반환하는 REST 컨트롤러 구현.
애플리케이션 설정
src/main/resources/application.yaml
애플리케이션 이름(notification-service) 및 포트(19600) 설정. Eureka 클라이언트 비활성화.
테스트
src/test/java/com/michelet/notification/NotificationApplicationTests.java
Spring Boot 테스트 프레임워크를 통한 애플리케이션 컨텍스트 로드 확인 테스트.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 새로운 프로젝트가 태어났네요,
Gradle 빌드, Spring Boot의 춤,
Hello world 엔드포인트 반짝반짝,
포트 19600으로 실행 준비 완료!
알림 서비스의 첫걸음이 시작됩니다. 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 프로젝트 초기 설정을 명확하게 설명하며, 변경사항의 주요 목적과 일치합니다.
Linked Issues check ✅ Passed PR이 이슈 #1의 주요 코딩 요구사항인 프로젝트 생성, Eureka 클라이언트 설정, Hello World API 생성을 모두 충족합니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 이슈 #1의 초기 프로젝트 설정 요구사항 범위 내에 있습니다.

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

✨ 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 chore/1-init-setting

Comment @coderabbitai help to get the list of available commands and usage tips.

@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: 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.yaml Line 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

📥 Commits

Reviewing files that changed from the base of the PR and between 96cccd7 and 0b1c40e.

⛔ Files ignored due to path filters (1)
  • gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar
📒 Files selected for processing (10)
  • .gitattributes
  • build.gradle
  • gradle/wrapper/gradle-wrapper.properties
  • gradlew
  • gradlew.bat
  • settings.gradle
  • src/main/java/com/michelet/notification/HelloController.java
  • src/main/java/com/michelet/notification/NotificationApplication.java
  • src/main/resources/application.yaml
  • src/test/java/com/michelet/notification/NotificationApplicationTests.java

Comment on lines +8 to +12
eureka:
client:
enabled: false
# service-url:
# defaultZone: ${EUREKA_DEFAULT_ZONE:http://localhost:8761/eureka/}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 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/resources

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

Repository: Miche-Let/notification_service

Length of output: 381


🏁 Script executed:

# Java config 클래스에서 Eureka 설정이 있는지 확인
rg -i 'eureka|@EnableEurekaClient|@EnableDiscoveryClient' src/main/java --type java -A 3

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

Repository: 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.yaml

Repository: Miche-Let/notification_service

Length of output: 364


🏁 Script executed:

# build.gradle 확인 (Eureka 의존성 확인)
cat build.gradle

Repository: 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:...})을 프로파일별 파일에 옮기거나 중앙
설정에서 관리하도록 수정하세요.

@ji-circle ji-circle 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.

확인했습니다!

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.

[CHORE] 프로젝트 초기 세팅

2 participants