Skip to content

Feat/#71#72

Merged
fixgramwork merged 3 commits intodevelopfrom
feat/#71
Sep 6, 2025
Merged

Feat/#71#72
fixgramwork merged 3 commits intodevelopfrom
feat/#71

Conversation

@fixgramwork
Copy link
Member

@fixgramwork fixgramwork commented Sep 6, 2025

jpa ddl 환경 설정

Summary by CodeRabbit

  • New Features

    • 새 실행 프로필 제공: create(시작 시 스키마 생성), createDrop(시작 시 생성·종료 시 삭제)로 환경별 DB 초기화 선택 가능.
    • 프로필은 필요 시에만 활성화되며 기본 운영 흐름에는 영향을 주지 않습니다.
  • Chores

    • 개발 환경의 스키마 동기화 방식을 검증(validate) 모드로 변경해 예기치 않은 스키마 변경을 방지하고 오류를 조기 감지합니다.

@fixgramwork fixgramwork linked an issue Sep 6, 2025 that may be closed by this pull request
@coderabbitai
Copy link

coderabbitai bot commented Sep 6, 2025

Walkthrough

새 프로필별 Spring Boot 설정 파일 두 개(application-create.yml, application-createDrop.yml)를 추가하고, 개발 프로필(application-dev.yml)에서 Hibernate DDL 전략을 create에서 validate로 변경했습니다. 각 신규 파일은 해당 프로필 활성화 조건과 spring.jpa.hibernate.ddl-auto 값을 정의합니다.

Changes

Cohort / File(s) Summary
프로필 신규 추가: create
src/main/resources/application-create.yml
spring.config.activate.on-profile: create 추가, spring.jpa.hibernate.ddl-auto: create 설정, 주석 추가(# create 용도).
프로필 신규 추가: createDrop
src/main/resources/application-createDrop.yml
spring.config.activate.on-profile: createDrop 추가, spring.jpa.hibernate.ddl-auto: create-drop 설정, 주석 추가(# createDrop 용도).
개발 프로필 설정 변경
src/main/resources/application-dev.yml
spring.jpa.hibernate.ddl-auto 값을 createvalidate로 변경.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor User as Operator
    participant App as Spring Boot App
    participant Prof as Profile Resolver
    participant JPA as Hibernate

    User->>App: 앱 실행 (with --spring.profiles.active)
    App->>Prof: 활성 프로필 결정
    alt 프로필=create
        Prof-->>App: create
        App->>JPA: ddl-auto=create
        Note right of JPA: 스키마 생성
    else 프로필=createDrop
        Prof-->>App: createDrop
        App->>JPA: ddl-auto=create-drop
        Note right of JPA: 시작 시 생성, 종료 시 드롭
    else 프로필=dev
        Prof-->>App: dev
        App->>JPA: ddl-auto=validate
        Note right of JPA: 매핑과 스키마 일치 검증(불일치 시 실패)
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Bug/#66 #68 — 프로필별 spring.jpa.hibernate.ddl-auto 설정을 수정하는 유사한 변경으로, 동일한 구성 패턴과 범위에서 밀접히 관련됨.

Poem

툭, 설정 씨앗 세 알 심고 가네 🌱
create는 밭을 갈고, drop은 깔끔히 정리하고,
dev는 조용히 자로 재어 본다—맞나, 틀리나.
토끼는 귀를 세우고 스키마를 듣지요 🐇
봄바람 결에, 부팅은 가볍게—딱 맞게!

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#71

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.

❤️ Share

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

@fixgramwork fixgramwork self-assigned this Sep 6, 2025
@fixgramwork fixgramwork added the 개발 개발과 관련된 이슈 label Sep 6, 2025
@fixgramwork fixgramwork moved this to 🛠 In Progress in clue_ver_1 Sep 6, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
src/main/resources/application-dev.yml (1)

11-13: 루트 DEBUG는 소음/성능 이슈—타깃 로깅으로 축소 권장

개발 편의성은 유지하되 루트 전체를 디버그로 두기보단 Hibernate SQL 중심으로 좁히면 로그 가독성과 성능 모두 좋아집니다.

 logging:
   level:
-    root: debug
+    root: info
+    org.hibernate.SQL: debug
+    org.hibernate.type.descriptor.sql: trace
src/main/resources/application-createDrop.yml (3)

9-9: EOF 개행 누락

파일 끝 개행이 없어 도구에 따라 경고가 발생합니다. 한 줄 추가해 주세요.

-      on-profile: createDrop
+      on-profile: createDrop
+

7-9: 프로필 네이밍 일관성 제안

값이 create-drop인 것과 맞추어 프로필명을 create-drop으로 통일하면 혼동이 줄어듭니다(선택). 변경 시 전역 참조도 함께 업데이트 필요.

-      on-profile: createDrop
+      on-profile: create-drop

추가로 파일명을 application-create-drop.yml로 맞추는 것도 고려해 주세요.


1-9: create-drop 프로필 문서화 및 사용 범위 격리 권장
로컬/테스트 전용임을 README.md와 해당 YAML 파일 주석에 명시하고, CI/CD 및 런타임 설정에서 createDrop 프로필이 다른 환경에 활성화되지 않도록 이중 확인하세요.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a99008 and 9fe0f3a.

📒 Files selected for processing (3)
  • src/main/resources/application-create.yml (1 hunks)
  • src/main/resources/application-createDrop.yml (1 hunks)
  • src/main/resources/application-dev.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
src/main/resources/application-createDrop.yml

[error] 9-9: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (2)
src/main/resources/application-create.yml (1)

2-9: 파괴적 DDL(create) 프로필: 리소스 내 활성화 설정 미발견, 운영·CI 환경 변수 검증 필요
application-create.yml과 application-createDrop.yml에서 ddl-auto: create/create-drop만 정의되어 있으며, spring.profiles.active 설정은 없습니다. 코드 레벨에서는 실수로 프로필이 활성화될 위험이 없으니, 운영·CI 환경의 SPRING_PROFILES_ACTIVEcreate 또는 createDrop 프로필이 포함되지 않도록 별도 확인하세요.

src/main/resources/application-dev.yml (1)

5-5: dev 환경 ddl-auto: validate 설정 확인 요청
프로젝트 pom.xml/build.gradle 등에서 Flyway·Liquibase 의존성이나 src/main/resources/db/migration 스크립트가 발견되지 않습니다.
‘validate’가 의도대로 스키마 검증만 수행하도록, 필요한 마이그레이션 도구 설정이 제대로 적용됐는지 확인해주세요.

@fixgramwork fixgramwork merged commit 24b67a5 into develop Sep 6, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from 🛠 In Progress to ✅ Done in clue_ver_1 Sep 6, 2025
@fixgramwork fixgramwork deleted the feat/#71 branch November 19, 2025 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

개발 개발과 관련된 이슈

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

ApplicationYAML 다중화

1 participant