-
Notifications
You must be signed in to change notification settings - Fork 1
infra: 배포 자동화 스크립트 작성 #192
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
WalkthroughOracle 데이터베이스 기반 OCI 클라우드 배포를 지원하는 인프라 및 구성 변경사항들을 추가합니다. 새로운 GitHub Actions CI/CD 워크플로우(개발/프로덕션), OCI 배포용 Docker 설정, 날짜/시간 데이터 변환기, Spring 프로필 설정이 포함되어 있습니다. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 주의가 필요한 영역:
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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). (3)
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 |
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
🧹 Nitpick comments (6)
build.gradle.kts (1)
34-35:ojdbc11에 명시적 버전을 지정하세요.
ojdbc11과oraclepki는 companion jar로 같은 버전을 사용해야 합니다.oraclepki:23.5.0.24.07과 호환되는ojdbc11의 버전은23.5.0.24.07입니다. 두 라이브러리 모두 동일한 버전으로 명시하면 재현 가능한 빌드와 호환성을 보장할 수 있습니다.runtimeOnly("com.oracle.database.jdbc:ojdbc11:23.5.0.24.07") runtimeOnly("com.oracle.database.security:oraclepki:23.5.0.24.07")src/main/resources/application-prod-oci.yaml (1)
1-67: prod-oci 설정 키/ENV 네이밍 일관성전체 구조와 키 구성은 dev-oci와 잘 맞습니다. 다만
admin.domain은 YAML 에서${PROD_DOMAIN_ADMIN}를 사용하고, CD 워크플로우에서는PROD_ADMIN_DOMAIN시크릿을 사용하고 있어 로컬/운영에서 어떤 ENV 이름을 기대하는지 혼동될 여지가 있습니다. 둘 중 하나로 통일해 두면 이후 운영·디버깅 시 조금 더 명확할 것 같습니다.src/main/kotlin/co/yappuworld/global/persistence/converter/LocalTimeStringConverter.kt (1)
1-16: LocalTime 변환기는 구현은 적절하지만 autoApply 범위를 한 번 확인해 보세요
HH:mm:ss포맷과 null 처리 모두 문제 없어 보입니다. 다만@Converter(autoApply = true)로 선언되어 있어서 프로젝트 내 모든LocalTime필드에 이 컨버터가 전역 적용됩니다. Oracle 스키마에서 해당 컬럼들이 모두 문자열 기반으로 정의돼 있지 않거나, 일부 엔티티에서는 기본 JPA 매핑(TIME/TIMESTAMP)을 유지하고 싶다면 예상치 못한 매핑 변경이 생길 수 있습니다.특정 컬럼에만 적용하는 편이 안전하다면
autoApply = false로 두고 필요한 필드에만@Convert를 거는 방향도 검토해 보시면 좋겠습니다.src/main/kotlin/co/yappuworld/global/persistence/converter/LocalDateStringConverter.kt (1)
1-16: LocalDate 변환기도 autoApply 전역 적용 영향 범위를 점검해 두는 편이 좋습니다
DateTimeFormatter.ISO_LOCAL_DATE사용과 null 처리 모두 자연스럽습니다. 다만@Converter(autoApply = true)덕분에 모든LocalDate속성에 이 컨버터가 자동 적용되므로, 기존에 DATE 타입으로 매핑되던 컬럼들이 문자열 기반으로 바뀌거나, 일부 엔티티에서 의도치 않은 매핑 변화가 생길 수 있습니다.전역 적용이 정말 원하는 동작인지, 아니면 필요한 필드에만
@Convert(converter = LocalDateStringConverter::class)를 다는 쪽이 나은지 한 번 검토해 보시는 것을 권장드립니다..github/workflows/yappu-oci-dev-cd.yaml (1)
27-58: dev-oci CD 워크플로우는 동작 관점에서는 잘 짜여 있지만, 외부 액션/시크릿 처리 측면에서 몇 가지 점검 포인트가 있습니다
microsoft/variable-substitution@v1는 현재 deprecated/archived 상태이고 Node 12 런타임에 묶여 있어서, GitHub Actions 러너 업데이트 시 장기적으로 깨질 수 있습니다. 유지보수성을 생각하면 자체 스크립트(yq 등)나 다른 유지보수 중인 액션으로 교체하는 방향을 한 번 검토해 보시는 게 좋겠습니다.Copy Secrets이후에 JAR 를 빌드하기 때문에, 최종 Docker 이미지/JAR 안에 DB/Firebase/JWT 등 시크릿 값이 그대로 포함됩니다. 인프라/보안 정책 상 괜찮은 패턴이라면 유지해도 되지만, 아티팩트/이미지 유출 리스크를 줄이고 싶다면 컨테이너 ENV 또는 외부 설정 볼륨을 통해 주입하는 구조도 고려할 수 있습니다.Also applies to: 80-86, 125-137
src/main/kotlin/co/yappuworld/schedule/infrastructure/entity/SessionEntity.kt (1)
4-5: SessionEntity 날짜/시간 컬럼 매핑은 일관적이지만, 컨버터 사용 방식은 조금 단순화할 수 있습니다
LocalDateStringConverter/LocalTimeStringConverter에autoApply = true가 설정된 상태에서 각 필드에 다시@get:Convert(...)를 붙이고 있어 다소 중복입니다. 전역 적용이 괜찮다면@Convert를 제거하고@Column만 두거나, 반대로 컨버터 쪽에서autoApply = false로 바꾸고 필요한 필드에만@Convert를 두는 식으로 한 방향으로 정리하면 JPA 매핑 의도가 더 읽기 쉬울 것 같습니다.Also applies to: 13-15, 32-43
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
.github/workflows/yappu-oci-dev-cd.yaml(1 hunks).github/workflows/yappu-oci-prod-cd.yaml(1 hunks)build.gradle.kts(1 hunks)docker/docker-compose-dev-oci.yaml(1 hunks)docker/docker-compose-dev.yaml(1 hunks)docker/docker-compose-prod-oci.yaml(1 hunks)docker/docker-compose-prod.yaml(1 hunks)docker/dockerfile-dev-oci(1 hunks)docker/dockerfile-prod-oci(1 hunks)src/main/kotlin/co/yappuworld/global/persistence/converter/LocalDateStringConverter.kt(1 hunks)src/main/kotlin/co/yappuworld/global/persistence/converter/LocalTimeStringConverter.kt(1 hunks)src/main/kotlin/co/yappuworld/schedule/infrastructure/entity/ScheduleEntity.kt(0 hunks)src/main/kotlin/co/yappuworld/schedule/infrastructure/entity/SessionEntity.kt(2 hunks)src/main/kotlin/co/yappuworld/user/client/application/usecase/SignUpExecutor.kt(1 hunks)src/main/resources/application-dev-oci.yaml(1 hunks)src/main/resources/application-local.yaml(1 hunks)src/main/resources/application-prod-oci.yaml(1 hunks)src/main/resources/application.yaml(1 hunks)
💤 Files with no reviewable changes (1)
- src/main/kotlin/co/yappuworld/schedule/infrastructure/entity/ScheduleEntity.kt
🧰 Additional context used
🪛 actionlint (1.7.9)
.github/workflows/yappu-oci-prod-cd.yaml
186-186: the runner of "release-drafter/release-drafter@v5" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
⏰ 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: build
🔇 Additional comments (9)
src/main/kotlin/co/yappuworld/user/client/application/usecase/SignUpExecutor.kt (1)
32-38: 동시성 제어 메커니즘 제거로 인한 경쟁 조건 위험
executeWithLock래퍼 제거로 인해checkSubmitApplicationAvailability와signUpApplicationCommandService.submit()사이에 TOCTOU(Time-Of-Check to Time-Of-Use) 경쟁 조건이 발생할 수 있습니다. 동일한 이메일로 동시에 여러 요청이 들어올 경우 두 요청 모두 가용성 체크를 통과한 후 중복으로 신청서를 생성할 수 있습니다.추가로
signUp함수에서는 여전히executeWithLockReturning을 사용하고 있어 일관성이 없습니다.MySQL → Oracle 마이그레이션 이유로 락 기능을 사용하지 못하는 상황이라면, 다음 중 하나의 방식으로 해결이 필요합니다:
- 데이터베이스 유니크 제약조건 추가:
(applicant_email, status)wherestatus = 'PENDING'- JPA 낙관적 잠금 활용:
@Version필드 추가- Oracle 호환 분산 락 사용: Redis + Redisson 등
- 해당 메커니즘이 이미 존재한다면 검증 필요
docker/docker-compose-prod.yaml (1)
10-11: 프로덕션 환경에서 Oracle Wallet 경로 검증이 필요합니다.하드코딩된 호스트 경로
/opt/oracle/wallet이 프로덕션 서버에 존재하고 올바른 권한으로 설정되어 있는지 확인해야 합니다. 경로가 없거나 권한이 부족하면 배포가 실패합니다.src/main/resources/application.yaml (1)
10-12: LGTM!OCI 프로파일 그룹이 기존 프로파일과 일관성 있게 구성되었습니다.
dev-oci는 개발 환경처럼 콘솔 로깅만,prod-oci는 프로덕션 환경처럼 Sentry 로깅도 포함하도록 적절히 설정되었습니다.docker/docker-compose-prod-oci.yaml (1)
1-11: LGTM!OCI 프로덕션 환경 설정이 개발 환경과 일관성 있게 구성되었습니다. 이미지 네이밍과 Dockerfile 참조가 적절합니다.
docker/dockerfile-prod-oci (2)
1-10: Alpine 베이스 이미지 사용 시 Oracle 클라이언트 라이브러리 호환성을 확인하세요.Alpine Linux는 musl libc를 사용하므로 Oracle 클라이언트 라이브러리가 glibc 기반으로 컴파일된 경우 호환성 문제가 발생할 수 있습니다. Oracle JDBC와 PKI 라이브러리가 Alpine에서 정상 작동하는지 테스트가 필요합니다.
필요하다면 표준 Debian/Ubuntu 기반 이미지 사용을 고려하세요:
FROM bellsoft/liberica-openjdk-debian:21
7-7: 이 리뷰 의견은 불필요합니다. GitHub Actions 워크플로우의 yappu-oci-prod-cd.yaml에서 Gradle 빌드 시-Dspring.profiles.active=prod-oci시스템 프로퍼티가 올바르게 전달되고 있으며, build.gradle.kts의 bootJar 태스크에서 이 프로퍼티를 읽어yappu-world-prod-oci.jar로 정확하게 파일명을 설정합니다. 배포 단계에서도 올바른 파일을 복사하고 있으므로 추가 확인이 필요하지 않습니다.docker/docker-compose-dev-oci.yaml (1)
1-11: dockerfile-dev-oci 파일 포함 여부 확인 필요합니다.OCI 개발 환경 설정이 적절하며 구성이 기존 개발 환경과 일관성 있게 작성되었습니다. 다만
dockerfile-dev-oci파일이 이 PR에 포함되어 있는지 확인하세요.docker/dockerfile-dev-oci (1)
1-10: dev-oci Dockerfile 구성은 현재 플로우와 잘 정합됩니다Liberica JDK 21 기반,
yappu-world-dev-oci.jar경로,dev-oci프로필 실행까지 CI/CD 설정과 잘 맞아서 필수로 손볼 부분은 없어 보입니다.src/main/resources/application-dev-oci.yaml (1)
1-67: [rewritten comment]
[classification tag]
📌 Related Issue
🚨 해결하려는 문제가 무엇인가요?
⭐️ 어떻게 해결했나요?
🤔 어떤 부분에 집중하여 리뷰해야 할까요?
🗒️ 참고자료
RCA 룰
Summary by CodeRabbit
릴리스 노트
새로운 기능
Chores
✏️ Tip: You can customize this high-level summary in your review settings.