Conversation
Walkthrough기존 Spring 프로젝트의 CI/CD GitHub Actions 워크플로우가 개편되었습니다. 새로운 EC2 배포 워크플로우가 추가되고, 기존 CD 워크플로우는 삭제되었으며, CI 워크플로우는 최신 액션 버전과 설정 개선이 이루어졌습니다. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (6)
.github/workflows/spring-ci.yaml (1)
35-38: 파일 끝 개행 누락
YAMLLint 경고처럼 EOF 개행이 없습니다. 추가해 주세요.- run: ./gradlew test \ No newline at end of file + run: ./gradlew test +.github/workflows/Spring-develop-CD.yml (5)
1-1: 워크플로우 이름 오탈자
Spring Deplot to EC2→Spring Deploy to EC2로 수정 바랍니다.-name: Spring Deplot to EC2 +name: Spring Deploy to EC2
23-29: Secrets를echo로 바로 출력하면 로그 노출 위험
echo "${{ secrets.* }}"명령은 multi-line secret 을 그대로 로그에 노출할 수 있습니다(특히 set-x, debug 플래그 활성 시).printf '%s'를 사용하거나,>>로 추가 후set -o noclobber등을 고려해 주세요.
36-38: 빌드 산출물 선택 방식이 모호
mv ./build/libs/*SNAPSHOT.jar ./cd.jar는 JAR 가 두 개 이상이면 실패합니다. 첫 번째 파일만 선택하도록find -name '*SNAPSHOT.jar' -print -quit를 사용하거나, Gradle-Pversion으로 이름을 고정하는 편이 안전합니다.- run: mv ./build/libs/*SNAPSHOT.jar ./cd.jar + run: | + JAR_PATH=$(find ./build/libs -maxdepth 1 -name "*SNAPSHOT.jar" -print -quit) + mv "$JAR_PATH" ./cd.jar
63-65:nohup백그라운드 실행만으로는 재부팅 시 서비스 복구 불가
서버 재시작 시 애플리케이션이 자동으로 올라오지 않습니다. systemd unit 파일로 관리하거나pm2,supervisor등 프로세스 매니저 사용을 고려해 주세요.
65-65: 파일 끝 개행 누락
EOF 개행 추가를 권장합니다.- sudo nohup java -jar cd.jar > ./output.log 2>&1 & \ No newline at end of file + sudo nohup java -jar cd.jar > ./output.log 2>&1 & +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/Spring-develop-CD.yml(1 hunks).github/workflows/spring-cd.yml(0 hunks).github/workflows/spring-ci.yaml(1 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/spring-cd.yml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/spring-ci.yaml
[error] 38-38: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/Spring-develop-CD.yml
[error] 65-65: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: deploy
🔇 Additional comments (4)
.github/workflows/spring-ci.yaml (3)
5-5: 모든 브랜치에 대해 CI가 실행되도록 설정됨 – 과도한 실행 여부 확인 필요
branches: ["*"]설정은 모든 브랜치push시 워크플로우가 동작합니다. 불필요한 CI 실행으로 러너 비용이 증가하거나, 임시/실험 브랜치 커밋에도 동일한 시간을 소모할 수 있습니다. 실제 요구사항이 “모든 브랜치”가 아니라면, 대상 브랜치를 구체적으로 제한하는 것을 검토해 주세요.
12-20: 액션 버전 업그레이드 및 JDK 17 설정 변경 LGTM
actions/checkout,actions/setup-java모두 최신 v4로 업그레이드된 점과java-version값을 정수형으로 변경한 부분 모두 문제 없습니다.
24-33:gradlew권한 부여 선행 → 캐시 무결성 보존 흐름 적절
chmod +x gradlew를 캐시 단계 전에 두어 빌드 실패를 예방한 변경은 적절합니다..github/workflows/Spring-develop-CD.yml (1)
40-47: 호스트 키 검증 비활성화 여부 확인 필요
appleboy/scp-action은 기본적으로--StrictHostKeyChecking=no로 동작합니다. 중간자 공격 가능성이 있으므로, 배포 서버의 호스트 키를known_hosts에 등록하고 검증을 강제하는 옵션(known_hosts,fingerprint) 사용을 권장합니다.
Summary by CodeRabbit