-
Notifications
You must be signed in to change notification settings - Fork 3
Chore : SSM 기반 CD 파이프라인 추가 및 EC2 런타임 배포 구조 정리 #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Warning Rate limit exceeded@hyeonda02 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 28 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughCI/CD 워크플로우에 AWS SSM을 통한 배포 작업을 추가하고, Redis 테스트 컨테이너 지원 유틸리티를 도입합니다. 테스트 의존성에 Testcontainers 라이브러리를 추가하고, 기존 테스트 클래스들을 Redis 컨테이너 기반 테스트로 마이그레이션하며, 피처 CI의 Redis 시작 단계는 비활성화합니다. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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. Comment |
Test Results0 tests 0 ✅ 0s ⏱️ Results for commit ecaa90f. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/develop-cicd.yml.github/workflows/feature-ci.ymlconfig
⏰ 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: Continuous Integration
🔇 Additional comments (2)
config (1)
1-1: config 서브모듈 변경사항 검증이 필요합니다.
.github/workflows/develop-cicd.yml파일은 리포지토리에 존재합니다. config 서브모듈이dea519025da8a053e70e7d506dde5198c2a2bd5b로 업데이트되었으나, 구체적인 변경사항(SSM Parameter Store 관련 설정, properties 정리)을 확인하고 워크플로우 파일의 배포 작업 변경사항과 함께 검토되어야 합니다..github/workflows/develop-cicd.yml (1)
67-71: LGTM: 최소 권한 원칙을 따른 역할 분리빌드용 역할과 배포용 역할을 분리하여 OIDC 인증을 구성한 점이 보안 모범 사례를 따르고 있습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 10
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/test/java/umc/teumteum/server/integration/friend/service/FriendLockServiceTest.java (2)
97-98: 예외 타입 확인 필요: GlobalHandler를 예외로 catch하고 있습니다
GlobalHandler는 일반적으로 전역 예외 처리를 담당하는 핸들러 클래스(@ControllerAdvice등)이지 예외 타입이 아닙니다. 이를catch블록에서 예외로 처리하는 것은 잘못된 것으로 보입니다.
FriendException외에 catch해야 할 예외가 있다면 적절한 예외 타입(예: 커스텀 예외의 상위 클래스,RuntimeException등)으로 변경해주세요.코딩 가이드라인에 따라, 의미 있는 커스텀 예외를 사용하고 적절한 예외 처리를 해야 합니다.
🔎 수정 제안
try { friendLockService.followWithLock(loginUser, targetUser.getId()); successCount.incrementAndGet(); - } catch (FriendException | GlobalHandler e) { + } catch (FriendException e) { failCount.incrementAndGet(); } finally {또는 다른 예외도 처리가 필요하다면:
- } catch (FriendException | GlobalHandler e) { + } catch (Exception e) { failCount.incrementAndGet();
112-112: 코드 가독성 개선: 연산자 주변 공백 추가
threadCount-1표현에서 연산자 주변에 공백을 추가하면 가독성이 더 좋아집니다.🔎 제안 수정
- assertThat(failCount.get()).isEqualTo(threadCount-1); + assertThat(failCount.get()).isEqualTo(threadCount - 1);
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (11)
.github/workflows/feature-ci.ymlbuild.gradlesrc/test/java/umc/teumteum/server/integration/friend/service/FriendLockServiceTest.javasrc/test/java/umc/teumteum/server/support/RedisTestContainerSupport.javasrc/test/java/umc/teumteum/server/unit/fcm/service/FcmServiceTest.javasrc/test/java/umc/teumteum/server/unit/global/scheduler/DailyTodoReminderSchedulerTest.javasrc/test/java/umc/teumteum/server/unit/home/service/ActivityServiceTest.javasrc/test/java/umc/teumteum/server/unit/notification/NotificationEnumTest.javasrc/test/java/umc/teumteum/server/unit/notification/service/NotificationServiceTest.javasrc/test/java/umc/teumteum/server/unit/user/service/OnboardingServiceTest.javasrc/test/java/umc/teumteum/server/unit/user/service/UserServiceTest.java
🧰 Additional context used
📓 Path-based instructions (1)
src/**
⚙️ CodeRabbit configuration file
src/**: 다음 항목들을 꼼꼼하게 검토해줘.
- 예외 처리
- 예외가 적절히 처리되었는지 확인해줘. (try-catch, throws, ExceptionAdvice)
- 공통 예외 처리 모듈(예: GlobalHandler, ApiResponse 등)을 잘 활용했는지 확인.
- RuntimeException을 남발하지 않고, 의미 있는 커스텀 예외를 사용하는지 검토.
- 예외 메시지에 민감 정보(DB 정보, 사용자 정보 등)가 노출되지 않게 했는지 점검.
- 코드 품질 & 가독성
- 메소드/클래스가 단일 책임 원칙(SRP)에 맞게 구성되어 있는지.
- 중복 코드가 있는 경우, 유틸/공통 컴포넌트로 추출 가능한지.
- 의미 있는 변수명과 메소드명을 사용했는지.
- 매직 넘버, 하드코딩된 값이 존재하는지 점검.
- 성능 및 효율성
- 불필요한 DB 쿼리 호출, N+1 문제 가능성이 있는지 확인.
- Stream, loop, recursion 사용 시 시간복잡도/메모리 효율성을 고려했는지.
- 캐시 적용 가능성이 있거나, 과도한 연산이 반복되는 구간이 있는지.
- 트랜잭션 관리
- @transactional이 필요한 메소드에 누락되지 않았는지.
- 읽기 전용 트랜잭션(readOnly = true)을 적절히 사용했는지.
- DB 일관성, 롤백 정책이 올바른지 검토.
- 입력 검증 및 보안
- @Valid, Bean Validation 등을 통한 입력값 검증이 되어 있는지.
- 비밀번호, 토큰 등 민감한 정보가 로깅되지 않는지.
- 테스트
- 단위 테스트가 충분히 작성되었는지, 핵심 로직의 검증이 누락되지 않았는지.
- Mocking을 통한 독립 테스트 구조를 유지했는지.
- 경계값 테스트, 예외 케이스 테스트가 포함되어 있는지.
- 구조 및 설계
- Controller, Service, Repository 등 계층 구조가 올바르게 나뉘어 있는지.
- DTO, Entity, Domain 객체 간 변환 로직이 명확하고 중복되지 않는지.
- Config 클래스에서 Bean 등록이 과도하거나 순환 참조 위험이 없는지.
Files:
src/test/java/umc/teumteum/server/integration/friend/service/FriendLockServiceTest.javasrc/test/java/umc/teumteum/server/unit/user/service/UserServiceTest.javasrc/test/java/umc/teumteum/server/unit/notification/service/NotificationServiceTest.javasrc/test/java/umc/teumteum/server/unit/fcm/service/FcmServiceTest.javasrc/test/java/umc/teumteum/server/unit/notification/NotificationEnumTest.javasrc/test/java/umc/teumteum/server/unit/home/service/ActivityServiceTest.javasrc/test/java/umc/teumteum/server/support/RedisTestContainerSupport.javasrc/test/java/umc/teumteum/server/unit/user/service/OnboardingServiceTest.javasrc/test/java/umc/teumteum/server/unit/global/scheduler/DailyTodoReminderSchedulerTest.java
🧬 Code graph analysis (5)
src/test/java/umc/teumteum/server/unit/notification/service/NotificationServiceTest.java (6)
src/test/java/umc/teumteum/server/unit/fcm/service/FcmServiceTest.java (1)
ExtendWith(31-171)src/test/java/umc/teumteum/server/unit/global/scheduler/DailyTodoReminderSchedulerTest.java (1)
ExtendWith(44-281)src/test/java/umc/teumteum/server/unit/home/service/ActivityServiceTest.java (1)
ExtendWith(38-185)src/test/java/umc/teumteum/server/unit/user/service/OnboardingServiceTest.java (1)
ExtendWith(38-197)src/test/java/umc/teumteum/server/unit/user/service/UserServiceTest.java (1)
ExtendWith(26-101)src/test/java/umc/teumteum/server/unit/notification/NotificationEnumTest.java (1)
DisplayName(14-156)
src/test/java/umc/teumteum/server/unit/fcm/service/FcmServiceTest.java (5)
src/test/java/umc/teumteum/server/unit/global/scheduler/DailyTodoReminderSchedulerTest.java (1)
ExtendWith(44-281)src/test/java/umc/teumteum/server/unit/home/service/ActivityServiceTest.java (1)
ExtendWith(38-185)src/test/java/umc/teumteum/server/unit/notification/service/NotificationServiceTest.java (1)
ExtendWith(47-302)src/test/java/umc/teumteum/server/unit/user/service/OnboardingServiceTest.java (1)
ExtendWith(38-197)src/test/java/umc/teumteum/server/unit/user/service/UserServiceTest.java (1)
ExtendWith(26-101)
src/test/java/umc/teumteum/server/unit/home/service/ActivityServiceTest.java (3)
src/test/java/umc/teumteum/server/unit/fcm/service/FcmServiceTest.java (1)
ExtendWith(31-171)src/test/java/umc/teumteum/server/unit/notification/service/NotificationServiceTest.java (1)
ExtendWith(47-302)src/test/java/umc/teumteum/server/unit/user/service/UserServiceTest.java (1)
ExtendWith(26-101)
src/test/java/umc/teumteum/server/unit/user/service/OnboardingServiceTest.java (6)
src/test/java/umc/teumteum/server/unit/fcm/service/FcmServiceTest.java (1)
ExtendWith(31-171)src/test/java/umc/teumteum/server/unit/global/scheduler/DailyTodoReminderSchedulerTest.java (1)
ExtendWith(44-281)src/test/java/umc/teumteum/server/unit/home/service/ActivityServiceTest.java (1)
ExtendWith(38-185)src/test/java/umc/teumteum/server/unit/notification/service/NotificationServiceTest.java (1)
ExtendWith(47-302)src/test/java/umc/teumteum/server/unit/user/service/UserServiceTest.java (1)
ExtendWith(26-101)src/test/java/umc/teumteum/server/unit/notification/NotificationEnumTest.java (1)
DisplayName(14-156)
src/test/java/umc/teumteum/server/unit/global/scheduler/DailyTodoReminderSchedulerTest.java (3)
src/test/java/umc/teumteum/server/unit/home/service/ActivityServiceTest.java (1)
ExtendWith(38-185)src/test/java/umc/teumteum/server/unit/notification/service/NotificationServiceTest.java (1)
ExtendWith(47-302)src/test/java/umc/teumteum/server/unit/user/service/UserServiceTest.java (1)
ExtendWith(26-101)
🪛 YAMLlint (1.37.1)
.github/workflows/feature-ci.yml
[warning] 41-41: comment not indented like content
(comments-indentation)
⏰ 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). (2)
- GitHub Check: Continuous Integration
- GitHub Check: Continuous Integration
🔇 Additional comments (2)
src/test/java/umc/teumteum/server/support/RedisTestContainerSupport.java (1)
9-15: LGTM! 테스트 지원 클래스 설계가 적절합니다.
static컨테이너를 사용하여 테스트 간 Redis 인스턴스를 공유하는 것은 테스트 성능 향상에 효과적입니다.abstract클래스로 설계한 것도 적절합니다.src/test/java/umc/teumteum/server/integration/friend/service/FriendLockServiceTest.java (1)
28-28: TestContainers 도입 변경사항 승인Redis TestContainers 지원 클래스를 상속하도록 변경한 것은 외부 의존성을 격리하고 테스트 환경의 일관성을 보장하는 좋은 개선입니다. PR 목표와 일치합니다.
Also applies to: 33-33
src/test/java/umc/teumteum/server/support/RedisTestContainerSupport.java
Show resolved
Hide resolved
src/test/java/umc/teumteum/server/unit/fcm/service/FcmServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/umc/teumteum/server/unit/global/scheduler/DailyTodoReminderSchedulerTest.java
Outdated
Show resolved
Hide resolved
src/test/java/umc/teumteum/server/unit/home/service/ActivityServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/umc/teumteum/server/unit/notification/NotificationEnumTest.java
Outdated
Show resolved
Hide resolved
src/test/java/umc/teumteum/server/unit/notification/service/NotificationServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/umc/teumteum/server/unit/user/service/OnboardingServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/umc/teumteum/server/unit/user/service/UserServiceTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (5)
src/test/java/umc/teumteum/server/unit/notification/NotificationEnumTest.java (1)
12-12: 사용되지 않는 import를 제거하세요.이 import는 클래스에서 전혀 사용되지 않습니다.
NotificationEnumTest는RedisTestContainerSupport를 상속하지 않으며, 순수한 Enum 로직 테스트로 어떠한 외부 인프라 의존성도 필요하지 않습니다.사용되지 않는 import는 코드 가독성을 저해하고 혼란을 야기할 수 있으므로 제거해주세요.
🔎 제안하는 수정사항
-import umc.teumteum.server.support.RedisTestContainerSupport;코딩 가이드라인 관련: 단위 테스트는 외부 인프라 의존성 없이 독립적으로 실행되어야 합니다.
src/test/java/umc/teumteum/server/unit/user/service/OnboardingServiceTest.java (1)
36-36: 사용되지 않는 import를 제거하세요.이 import는 클래스에서 전혀 사용되지 않습니다.
OnboardingServiceTest는RedisTestContainerSupport를 상속하지 않으며,@ExtendWith(MockitoExtension.class)를 사용하는 순수 단위 테스트입니다.테스트 대상 메서드(
saveSleepPattern,saveRoutines)는 Redis를 사용하지 않으며, 모든 의존성이@Mock으로 처리되어 있습니다. 사용되지 않는 import는 제거해주세요.🔎 제안하는 수정사항
-import umc.teumteum.server.support.RedisTestContainerSupport;코딩 가이드라인 관련: "Mocking을 통한 독립 테스트 구조를 유지했는지" 항목에 따라, 단위 테스트는 외부 인프라 의존성 없이 모킹을 통해 격리되어 실행되어야 합니다.
src/test/java/umc/teumteum/server/unit/notification/service/NotificationServiceTest.java (1)
45-45: 사용되지 않는 import를 제거하세요.이 import는 클래스에서 전혀 사용되지 않습니다.
NotificationServiceTest는RedisTestContainerSupport를 상속하지 않으며, 모든 Repository와 유틸리티를@Mock으로 처리하고MockedStatic을 사용하는 순수 단위 테스트입니다.실제 Redis 인스턴스와의 상호작용이 없는 상태에서 사용되지 않는 import는 제거해주세요.
🔎 제안하는 수정사항
-import umc.teumteum.server.support.RedisTestContainerSupport;코딩 가이드라인 관련: "Mocking을 통한 독립 테스트 구조를 유지했는지" 항목에 따라, 단위 테스트는 외부 인프라 의존성 없이 격리되어 실행되어야 합니다.
src/test/java/umc/teumteum/server/unit/user/service/UserServiceTest.java (1)
20-20: 사용되지 않는 import를 제거하세요.이 import는 클래스에서 전혀 사용되지 않습니다.
UserServiceTest는RedisTestContainerSupport를 상속하지 않으며,UserRepository와NotificationSettingRepository를@Mock으로 처리하는 순수 단위 테스트입니다.실제 Redis 인스턴스가 필요하지 않은 상황에서 사용되지 않는 import는 제거해주세요.
🔎 제안하는 수정사항
-import umc.teumteum.server.support.RedisTestContainerSupport;코딩 가이드라인 관련: "Mocking을 통한 독립 테스트 구조를 유지했는지" 항목에 따라, 단위 테스트는 외부 인프라 의존성 없이 격리되어 실행되어야 합니다.
src/test/java/umc/teumteum/server/unit/home/service/ActivityServiceTest.java (1)
36-36: 사용되지 않는 import를 제거하세요.이 import는 클래스에서 전혀 사용되지 않습니다.
ActivityServiceTest는RedisTestContainerSupport를 상속하지 않으며, 모든 의존성을@Mock으로 처리하는 순수 단위 테스트입니다.테스트 대상 메서드(
getMyWish)는 Redis를 사용하지 않으므로, 사용되지 않는 import는 제거해주세요. 만약 향후 Redis를 사용하는 메서드(saveAiWish,deleteAiWish등)에 대한 테스트가 필요하다면, 별도의 통합 테스트로 분리하고 그곳에서RedisTestContainerSupport를 활용하세요.🔎 제안하는 수정사항
-import umc.teumteum.server.support.RedisTestContainerSupport;코딩 가이드라인 관련: "Mocking을 통한 독립 테스트 구조를 유지했는지" 항목에 따라, 단위 테스트는 외부 인프라 의존성 없이 격리되어 실행되어야 합니다.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (7)
build.gradlesrc/test/java/umc/teumteum/server/support/RedisTestContainerSupport.javasrc/test/java/umc/teumteum/server/unit/home/service/ActivityServiceTest.javasrc/test/java/umc/teumteum/server/unit/notification/NotificationEnumTest.javasrc/test/java/umc/teumteum/server/unit/notification/service/NotificationServiceTest.javasrc/test/java/umc/teumteum/server/unit/user/service/OnboardingServiceTest.javasrc/test/java/umc/teumteum/server/unit/user/service/UserServiceTest.java
🧰 Additional context used
📓 Path-based instructions (1)
src/**
⚙️ CodeRabbit configuration file
src/**: 다음 항목들을 꼼꼼하게 검토해줘.
- 예외 처리
- 예외가 적절히 처리되었는지 확인해줘. (try-catch, throws, ExceptionAdvice)
- 공통 예외 처리 모듈(예: GlobalHandler, ApiResponse 등)을 잘 활용했는지 확인.
- RuntimeException을 남발하지 않고, 의미 있는 커스텀 예외를 사용하는지 검토.
- 예외 메시지에 민감 정보(DB 정보, 사용자 정보 등)가 노출되지 않게 했는지 점검.
- 코드 품질 & 가독성
- 메소드/클래스가 단일 책임 원칙(SRP)에 맞게 구성되어 있는지.
- 중복 코드가 있는 경우, 유틸/공통 컴포넌트로 추출 가능한지.
- 의미 있는 변수명과 메소드명을 사용했는지.
- 매직 넘버, 하드코딩된 값이 존재하는지 점검.
- 성능 및 효율성
- 불필요한 DB 쿼리 호출, N+1 문제 가능성이 있는지 확인.
- Stream, loop, recursion 사용 시 시간복잡도/메모리 효율성을 고려했는지.
- 캐시 적용 가능성이 있거나, 과도한 연산이 반복되는 구간이 있는지.
- 트랜잭션 관리
- @transactional이 필요한 메소드에 누락되지 않았는지.
- 읽기 전용 트랜잭션(readOnly = true)을 적절히 사용했는지.
- DB 일관성, 롤백 정책이 올바른지 검토.
- 입력 검증 및 보안
- @Valid, Bean Validation 등을 통한 입력값 검증이 되어 있는지.
- 비밀번호, 토큰 등 민감한 정보가 로깅되지 않는지.
- 테스트
- 단위 테스트가 충분히 작성되었는지, 핵심 로직의 검증이 누락되지 않았는지.
- Mocking을 통한 독립 테스트 구조를 유지했는지.
- 경계값 테스트, 예외 케이스 테스트가 포함되어 있는지.
- 구조 및 설계
- Controller, Service, Repository 등 계층 구조가 올바르게 나뉘어 있는지.
- DTO, Entity, Domain 객체 간 변환 로직이 명확하고 중복되지 않는지.
- Config 클래스에서 Bean 등록이 과도하거나 순환 참조 위험이 없는지.
Files:
src/test/java/umc/teumteum/server/unit/notification/NotificationEnumTest.javasrc/test/java/umc/teumteum/server/support/RedisTestContainerSupport.javasrc/test/java/umc/teumteum/server/unit/notification/service/NotificationServiceTest.javasrc/test/java/umc/teumteum/server/unit/home/service/ActivityServiceTest.javasrc/test/java/umc/teumteum/server/unit/user/service/OnboardingServiceTest.javasrc/test/java/umc/teumteum/server/unit/user/service/UserServiceTest.java
⏰ 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). (2)
- GitHub Check: Continuous Integration
- GitHub Check: Continuous Integration
🔇 Additional comments (2)
src/test/java/umc/teumteum/server/support/RedisTestContainerSupport.java (2)
9-10: 테스트 컨테이너 지원 클래스 구조가 적절합니다.
@Testcontainers어노테이션과 abstract 클래스를 활용한 구조가 올바르게 설계되었습니다. 테스트 클래스들이 이를 상속받아 Redis 컨테이너를 자동으로 활용할 수 있습니다.
18-23: 이전 리뷰 지적 사항이 완벽하게 해결되었습니다.
@DynamicPropertySource에spring.data.redis.password프로퍼티가 추가되어, 테스트 환경이 프로덕션 환경(RedisConfig) 및docker-compose.yml설정과 일관되게 구성되었습니다. Host, port, password 세 가지 필수 속성이 모두 올바르게 등록되었습니다.
👀 관련 이슈
#303 과 이어지는 작업입니다
✨ 작업한 내용
기존 SSH/Bastion 기반 배포 방식을 제거하고 SSM Run Command 기반의 CD 파이프라인을 추가했습니다
🌀 PR Point
x
🍰 참고사항
x
📷 스크린샷 또는 GIF
Summary by CodeRabbit
릴리즈 노트
새로운 기능
개선사항
Chores
✏️ Tip: You can customize this high-level summary in your review settings.