-
Notifications
You must be signed in to change notification settings - Fork 1
[REFACTOR] #190: 프로젝트 구조 변경 #191
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
[FIX] 스터디 신청 시 파일 관련 예외 처리 추가 및 구글 로그인 인가 오류 수정
[FIX] 토큰 불일치 로그 추가
[FIX] 토큰 재발급 시 로그 추가
[FIX] 토큰 재발급 시 로그인 타입을 enum으로 저장
[FIX] 구글 로그인 시 쿠키 도메인을 프론트 도메인으로 설정
[FIX] 스터디 상세 조회 시 imagePath 주는 오류 수정
[FEAT] CI 추가 및 RDS 변경
Walkthrough프로젝트를 단일 모듈 루트로 재구성하고 빌드/배포 파이프라인과 Docker 빌드를 루트 기준으로 정리했다. CI/CD 워크플로우는 appspec 준비 방식, 패키징 이름, AWS 자격 설정 및 Docker 이미지 태깅을 갱신했고, 무시 파일과 Gradle 설정이 정리됐다. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as 개발자
participant GH as GitHub Actions (deploy-dev)
participant AWS as AWS Credentials Action
participant S3 as Amazon S3
participant CD as CodeDeploy
Dev->>GH: Push to dev branch
GH->>GH: Prepare appspec.yml (cp appspec.dev.yml)
GH->>GH: Create .env (heredoc)
GH->>GH: zip -> deploy-dev.zip
GH->>AWS: configure-aws-credentials@v4
AWS-->>GH: Temporary credentials
GH->>S3: Upload deploy-dev.zip
GH->>CD: CreateDeployment (bundle: deploy-dev.zip)
CD-->>GH: Deployment started
sequenceDiagram
autonumber
participant Dev as 개발자
participant GH as GitHub Actions (deploy-prod)
participant Docker as Docker Registry
participant AWS as AWS Credentials Action
participant S3 as Amazon S3
participant CD as CodeDeploy
Dev->>GH: Push to main/release
GH->>GH: Build docker image (-t repo:latest, -t repo:SHA)
GH->>Docker: Push latest and SHA tags
GH->>GH: Prepare appspec.yml (cp appspec.prod.yml)
GH->>GH: Create .env (heredoc) and zip -> deploy-prod.zip
GH->>AWS: configure-aws-credentials@v4
AWS-->>GH: Temporary credentials
GH->>S3: Upload deploy-prod.zip
GH->>CD: CreateDeployment (bundle: deploy-prod.zip)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
CI status |
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: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/resources/application-local.yml (1)
51-52: 로그 카테고리 타이포: org.hibername.type → org.hibernate.type오타로 인해 Hibernate 타입 바인딩 로그 레벨이 적용되지 않습니다. 디버깅 가용성 저하를 방지하려면 즉시 수정하세요.
logging: level: org.hibernate.SQL: debug - org.hibername.type: trace + org.hibernate.type: trace
🧹 Nitpick comments (12)
.github/workflows/ci.yml (2)
42-47: Gradle 빌드 단계 개선 제안: 실패 시 로그 보존 및 빌드 캐시 활성화
tee build.log는 유용하나, 워크플로 종료 시 로그가 유실될 수 있습니다. 실패 시 아티팩트 업로드를 추가하고, 가능하다면 빌드 캐시를 활성화하여 반복 빌드 시간을 단축하세요.
- 캐시:
./gradlew build -x test --build-cache ...- 실패 로그 업로드(추가 스텝 예시):
# (파일 내 적절한 위치에 추가) - name: Upload logs on failure if: ${{ failure() }} uses: actions/upload-artifact@v4 with: name: gradle-logs path: | build.log test.log if-no-files-found: ignore retention-days: 7
60-60: 테스트 단계도 동일한 개선 권장테스트 로그도 실패 시 업로드되도록 위 아티팩트 스텝이 함께 커버됩니다. 추가로 H2 모드 설정은 적절하나, Flyway를 끄고 JPA
create-drop을 쓰는 현재 구성이 실제 테스트 의도(스키마/데이터 마이그레이션 검증)와 부합하는지 확인 바랍니다.src/test/java/inha/gdgoc/domain/recruit/service/RecruitMemberServiceTest.java (2)
6-21: 검증·캡처를 위해 필요한 import가 빠졌습니다.
ArgumentCaptor와(또는)Answer등을 사용할 계획이라면 관련 import를 추가하세요. 최소한ArgumentCaptor는 필요합니다.예시:
import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.ArgumentCaptor; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*;
55-69:savedMember빌드는 현재로서는 미사용입니다. 반환 stubbing 또는 제거가 필요합니다.위 코멘트처럼
when(recruitMemberRepository.save(...)).thenReturn(savedMember);로 활용하거나, 그렇지 않다면 블록 자체를 제거해 주세요.Dockerfile (3)
18-18: 부트 JAR 선택을 더 결정적으로 바꿔 ‘-plain.jar’ 오탐을 방지하세요.현재
ls ... | head -n 1은 비결정적일 수 있습니다.*-plain.jar를 제외하고 첫 파일을 복사하도록 변경을 권장합니다.-RUN cp "$(ls build/libs/*.jar | head -n 1)" build/libs/app.jar +RUN cp "$(find build/libs -maxdepth 1 -type f -name '*.jar' ! -name '*-plain.jar' -print -quit)" build/libs/app.jar
21-27: 컨테이너를 비루트 사용자로 실행하여 기본 보안을 강화하세요.런타임 스테이지에서 전용 유저를 생성하고
USER를 설정하면 권한 상승 위험을 낮출 수 있습니다.FROM eclipse-temurin:17-jre WORKDIR /app COPY --from=build /app/build/libs/app.jar app.jar +RUN useradd -r -u 1001 -g root appuser +USER 1001 EXPOSE 8080 ENTRYPOINT ["java","-jar","/app/app.jar"]
7-12: 레이어 캐시 최적화(선택): Gradle 래퍼/의존 파일만 먼저 복사하세요.
COPY . .이전에gradlew,gradle/wrapper/**,build.gradle*,settings.gradle만 먼저 복사하고 종속성 다운로드를 분리하면, 애플리케이션 코드 변경 시 빌드 캐시 활용도가 크게 올라갑니다.필요 시 단계별 COPY와
--mount=type=cache(BuildKit) 사용을 함께 고려해 주세요..github/workflows/deploy-prod.yml (3)
63-67: GitHub→AWS 자격 연계는 OIDC로 전환을 권장합니다(장기 키 제거).현재
aws-actions/configure-aws-credentials@v4에 정적 키를 공급하고 있습니다. OIDC(어설션 기반)로 전환하면 GitHub Secrets에 장기 키를 보관할 필요가 없어집니다.전환 스케치:
permissions: id-token: write contents: read - uses: aws-actions/configure-aws-credentials@v4 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }} + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} + role-session-name: github-actions
24-28: 빌드 캐시/멀티 아키텍처가 필요하면 build-push-action 사용을 고려하세요.단일
docker build도 충분하지만, 캐시/멀티플랫폼이 필요하면docker/build-push-action@v6로 이관해 성능과 재현성을 높일 수 있습니다.
58-58: YAML trailing space 경고를 수정하세요.YAMLlint가 줄 끝 공백을 보고했습니다. 단순 제거만으로 경고를 없앨 수 있습니다.
- +.github/workflows/deploy-dev.yml (2)
22-26: Dev 이미지에도 커밋 SHA 태깅을 추가해 롤백·추적성을 높이세요.현재
latest만 푸시합니다. SHA 태그를 병행하면 특정 배포 버전 추적이 쉬워집니다.- - name: Build and Push Docker Image - run: | - docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/gdgoc-be-app-dev:latest . - docker push ${{ secrets.DOCKER_HUB_USERNAME }}/gdgoc-be-app-dev:latest + - name: Build and Push Docker Image + run: | + IMAGE=${{ secrets.DOCKER_HUB_USERNAME }}/gdgoc-be-app-dev + TAG=${{ github.sha }} + docker build -t $IMAGE:latest -t $IMAGE:$TAG . + docker push $IMAGE:latest + docker push $IMAGE:$TAG
55-55: YAML trailing space 경고를 수정하세요.불필요한 공백만 제거하면 됩니다.
- +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
gradle/wrapper/gradle-wrapper.jaris excluded by!**/*.jar
📒 Files selected for processing (10)
.dockerignore(1 hunks).github/workflows/ci.yml(3 hunks).github/workflows/deploy-dev.yml(1 hunks).github/workflows/deploy-prod.yml(1 hunks).gitignore(1 hunks)Dockerfile(1 hunks)gdgoc/settings.gradle(0 hunks)settings.gradle(1 hunks)src/main/resources/application-local.yml(1 hunks)src/test/java/inha/gdgoc/domain/recruit/service/RecruitMemberServiceTest.java(1 hunks)
💤 Files with no reviewable changes (1)
- gdgoc/settings.gradle
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/deploy-prod.yml
[error] 58-58: trailing spaces
(trailing-spaces)
.github/workflows/deploy-dev.yml
[error] 55-55: trailing spaces
(trailing-spaces)
🔇 Additional comments (6)
settings.gradle (1)
1-1: 검토 완료: bootJar 기본 산출물과 Dockerfile의 app.jar 복사 로직이 일치합니다.
./gradlew및gradle-wrapper.jar모두 정상 확인- Gradle 설정에서
bootJar나archiveFileName을 명시적으로 변경한 부분이 없어 기본 산출물명이 사용됨- Dockerfile의
ls build/libs/*.jar | head -n 1→build/libs/app.jar복사 로직이 모든 버전의 JAR 파일명을 app.jar로 일관되게 처리함위 검증 결과, Gradle 산출물명과 Dockerfile 참조가 일치하므로 추가 조치는 필요 없습니다.
src/main/resources/application-local.yml (1)
28-29: 형식 정리 OK — 동작 변화 없음
spring.flyway의baseline-on-migrate,baseline-version주석 제거는 의미 변경이 없어 안전합니다. 실제 마이그레이션 시작 버전(V1__...)과 값(1)의 정합성만 확인해 주세요..github/workflows/ci.yml (2)
26-30: Temurin 17 설정 전환 LGTM현 구조(루트 모듈)에서 JDK 17 세팅은 적절합니다. Gradle 캐시 및
setup-gradle@v3조합도 표준입니다.
116-118: 종단 실패 게이트 유지 LGTM조합 결과에 따라 명시적으로 실패 처리하는 종단 게이트는 의도에 부합합니다.
src/test/java/inha/gdgoc/domain/recruit/service/RecruitMemberServiceTest.java (1)
1-1: ApplicationRequest 인스턴스 생성 방식 명확화
- 확인 결과
ApplicationRequest클래스에는@Builder또는 정적 팩토리 메서드가 정의되어 있지 않습니다. 대신 Lombok의@AllArgsConstructor가 붙어 있어 모든 필드를 인자로 받는 생성자가 제공됩니다.
• 위치:src/main/java/inha/gdgoc/domain/recruit/dto/request/ApplicationRequest.java(lines 9–13)- 테스트에서 실제 인스턴스를 생성해야 할 경우, 아래와 같이 생성자를 직접 호출하세요.
ApplicationRequest request = new ApplicationRequest(member, answers);- 빌더 패턴 형태의 인스턴스화를 선호한다면, DTO 클래스에 Lombok의
@Builder어노테이션을 추가하여 빌더 메서드를 제공할 수 있습니다. (선택 사항)Likely an incorrect or invalid review comment.
Dockerfile (1)
14-16: Gradle wrapper 사용 관점에서 빌드 커맨드는 적절합니다.CI에서 테스트를 실행하므로
-x test도 합리적이고,bootJar를 명시하여 실행 JAR만 산출하도록 한 점 좋습니다.
src/test/java/inha/gdgoc/domain/recruit/service/RecruitMemberServiceTest.java
Show resolved
Hide resolved
src/test/java/inha/gdgoc/domain/recruit/service/RecruitMemberServiceTest.java
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: 1
🧹 Nitpick comments (1)
.dockerignore (1)
1-9: 비밀/인증서/클라우드 자격과 압축 아카이브까지 추가로 제외해 컨텍스트를 더 안전하고 작게 만드세요.다음 패턴은 실무에서 자주 누락되어 민감정보가 컨텍스트로 섞이거나, 빌드 컨텍스트가 불필요하게 비대해지는 원인입니다. 선택적으로 추가를 권장합니다.
.git .gradle build *.log .DS_Store .env *.env **/*.env + .env.* + **/.env.* + .secrets/ + **/*.pem + **/*.key + **/*.crt + **/*.p12 + .aws/ + .terraform/ + **/.DS_Store + *.tar + *.tar.gz deploy-*.zip + .idea/ + .vscode/ + .github/
.env.*/**/.env.*:.env.local,.env.prod등도 확실히 제외*.pem|*.key|*.crt|*.p12: TLS/서명 키류.aws/,.terraform/: 로컬 자격/상태 유출 방지*.tar*: 대용량 아카이브 컨텍스트 혼입 방지- IDE 폴더와
.github/는 빌드에 불필요한 경우가 대부분이라 제외 권장
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
.dockerignore(1 hunks).gitignore(1 hunks)
🔇 Additional comments (3)
.dockerignore (1)
1-9: 현재 규칙은 목적에 부합합니다 (컨텍스트 슬림화 + 비밀 유출 방지).
.git,.gradle,build, 로그,.DS_Store, 다양한.env패턴,deploy-*.zip제외는 Docker 빌드 컨텍스트를 잘 줄이고, 민감정보 전송 위험도 낮춥니다. 이전 리뷰 지적사항도 반영되었습니다..gitignore (2)
6-6: Gradle Wrapper JAR 재포함 규칙이 정확합니다.
!gradle/wrapper/gradle-wrapper.jar로 올바르게 고정되어 Wrapper 누락으로 인한 초기 빌드 실패를 예방합니다.
7-8: .gitignore 재-include 규칙 검증 완료
현재 리포지토리에는./src/main및./src/test디렉터리만 존재하므로
!src/main/**/build/와!src/test/**/build/패턴이 의도대로 동작합니다.
- 발견된 경로
- FOUND: ./src/main
- FOUND: ./src/test
- 루트 외 추가 모듈(
src/...) 디렉터리 없음- 현 단일 모듈 구조에선 문제 없음
다만, 예제나 툴링용 서브모듈 등으로 추가
src/main/src/test디렉터리가 생길 경우, 해당 패턴이 자동 재포함되지 않을 수 있으므로 멀티모듈 전환 시 재검토를 권장드립니다.
📌 연관된 이슈
✨ 작업 내용
💬 리뷰 요구사항(선택)
Summary by CodeRabbit
신기능
개선/Chores
테스트