[♻️Refactor] 자기소개서 persistence DB/JPA 전환#27
Conversation
📝 WalkthroughWalkthrough
ChangesCoverLetter persistence DB/JPA 전환
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/test/java/com/daon/rewrite/global/util/UuidIdGeneratorTest.java (1)
15-16: ⚡ Quick winUUID 형식 검증을 테스트에 추가해 주세요.
현재는
"cl_"이후가 비어있지 않은지만 확인해서, UUID가 아닌 문자열 회귀를 놓칠 수 있습니다. suffix를UUID.fromString(...)으로 파싱 검증하면 계약이 더 명확해집니다.제안 패치
import org.junit.jupiter.api.Test; +import java.util.UUID; import static org.assertj.core.api.Assertions.assertThat; @@ void generateReturnsPrefixAndUuid() { String id = idGenerator.generate("cl"); assertThat(id).startsWith("cl_"); - assertThat(id.substring("cl_".length())).isNotBlank(); + String uuidPart = id.substring("cl_".length()); + assertThat(uuidPart).isNotBlank(); + assertThat(UUID.fromString(uuidPart)).isNotNull(); } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/java/com/daon/rewrite/global/util/UuidIdGeneratorTest.java` around lines 15 - 16, The test in UuidIdGeneratorTest is only checking that the suffix after "cl_" is not blank, but not validating that it is actually a valid UUID format. Replace or supplement the current isNotBlank() assertion with a call to UUID.fromString() to parse the suffix extracted from id.substring("cl_".length()). This will ensure the generated ID truly conforms to the expected "cl_" prefix followed by a valid UUID, rather than just any non-empty string.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/resources/application.yaml`:
- Around line 19-22: The H2 console is currently enabled in the default profile
(application.yaml), which is a security risk as it exposes direct database
access. Change the enabled property under h2.console in application.yaml from
true to false to secure the default environment. Then create a new profile file
application-local.yaml specifically for local development and configure the
h2.console settings there with enabled set to true and path set to /h2-console,
ensuring the console is only available in local development environments and not
in production.
---
Nitpick comments:
In `@src/test/java/com/daon/rewrite/global/util/UuidIdGeneratorTest.java`:
- Around line 15-16: The test in UuidIdGeneratorTest is only checking that the
suffix after "cl_" is not blank, but not validating that it is actually a valid
UUID format. Replace or supplement the current isNotBlank() assertion with a
call to UUID.fromString() to parse the suffix extracted from
id.substring("cl_".length()). This will ensure the generated ID truly conforms
to the expected "cl_" prefix followed by a valid UUID, rather than just any
non-empty string.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: bcdbca26-bdbf-42b7-933c-9263df885b73
📒 Files selected for processing (19)
.gitignorebuild.gradledocs/architecture.mddocs/status.mdsrc/main/java/com/daon/rewrite/coverletter/dto/CreateCoverLetterResponse.javasrc/main/java/com/daon/rewrite/coverletter/entity/CoverLetter.javasrc/main/java/com/daon/rewrite/coverletter/repository/CoverLetterRepository.javasrc/main/java/com/daon/rewrite/coverletter/repository/InMemoryCoverLetterRepository.javasrc/main/java/com/daon/rewrite/coverletter/service/CoverLetterIdGenerator.javasrc/main/java/com/daon/rewrite/coverletter/service/CoverLetterService.javasrc/main/java/com/daon/rewrite/coverletter/service/UuidCoverLetterIdGenerator.javasrc/main/java/com/daon/rewrite/global/util/IdGenerator.javasrc/main/java/com/daon/rewrite/global/util/UuidIdGenerator.javasrc/main/resources/application.yamlsrc/test/java/com/daon/rewrite/coverletter/controller/CoverLetterControllerTest.javasrc/test/java/com/daon/rewrite/coverletter/repository/CoverLetterRepositoryTest.javasrc/test/java/com/daon/rewrite/coverletter/service/CoverLetterServiceTest.javasrc/test/java/com/daon/rewrite/global/util/UuidIdGeneratorTest.javasrc/test/resources/application-test.yaml
💤 Files with no reviewable changes (3)
- src/main/java/com/daon/rewrite/coverletter/service/UuidCoverLetterIdGenerator.java
- src/main/java/com/daon/rewrite/coverletter/repository/InMemoryCoverLetterRepository.java
- src/main/java/com/daon/rewrite/coverletter/service/CoverLetterIdGenerator.java
작업 내용
POST /cover-letters공개 계약을 유지하면서 내부 persistence를 in-memory에서 DB/JPA로 전환했습니다.CoverLetter를cover_lettersJPA entity로 전환하고 ERD 기준 주요 컬럼을 반영했습니다.CoverLetterRepository를 Spring Data JPA repository로 전환하고 in-memory repository를 제거했습니다.IdGenerator/UuidIdGenerator로 정리했습니다.CreateCoverLetterResponse는 내부Instant를 API 계약대로 Asia/SeoulLocalDateTime으로 변환합니다.docs/status.md,docs/architecture.md에 DB/JPA 전환 상태를 반영했습니다.관련 이슈
문서 반영
docs/status.mddocs/architecture.md확인 결과
./gradlew test./gradlew checkgit diff --checkSummary by CodeRabbit
릴리스 노트
새로운 기능
버그 수정
Chores