Skip to content

refactor: 학습 단계 예외 검증 로직 추가 (#16)#31

Merged
rkdehdrbs7885-oss merged 2 commits into
developfrom
feat/#16-learning-entity
Jul 22, 2026
Merged

refactor: 학습 단계 예외 검증 로직 추가 (#16)#31
rkdehdrbs7885-oss merged 2 commits into
developfrom
feat/#16-learning-entity

Conversation

@rkdehdrbs7885-oss

@rkdehdrbs7885-oss rkdehdrbs7885-oss commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

📍 개요

유저 학습 단계 예외 사항 추가

⛓️‍💥 관련 이슈


🛠️ 작업 내용

  • 유저 학습 단계 예외 사항 추가

🔥 리뷰 요청 사항

리뷰어가 중점적으로 확인해주었으면 하는 내용을 작성해주세요.

  • 예외 코드 처리 방식

✅ 체크리스트

  • [o ] 코드 컨벤션을 준수했습니다.
  • [o ] 불필요한 코드 및 import를 제거했습니다.
  • [o ] 예외 처리를 적용했습니다.
  • 테스트를 완료했습니다.
  • [o ] 관련 Issue를 연결했습니다.

📎 참고 사항

Summary by CodeRabbit

  • 버그 수정
    • 학습 단계가 다른 학습에 속하는 경우 저장 전에 오류를 표시하도록 검증을 강화했습니다.
    • 잘못된 학습 단계 참조 시 명확한 오류 코드와 안내 메시지를 제공합니다.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@rkdehdrbs7885-oss, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d12c0d61-2383-4db4-8675-3c9c751f0874

📥 Commits

Reviewing files that changed from the base of the PR and between 65f575e and a6c689d.

📒 Files selected for processing (1)
  • src/main/java/com/mr/domain/learning/entity/UserLearningProgress.java
📝 Walkthrough

Walkthrough

UserLearningProgress.create(...) 호출 시 learninglearningStep의 소속 관계를 검증합니다. 불일치하면 HTTP 400 오류 상태와 함께 GeneralException을 발생시킵니다.

Changes

학습 진행 상태 검증

Layer / File(s) Summary
생성 검증 및 오류 계약
src/main/java/com/mr/domain/learning/entity/UserLearningProgress.java, src/main/java/com/mr/domain/learning/exception/LearningErrorStatus.java
create(...) 전에 두 학습 객체의 참조 일치 여부를 확인하고, 불일치 시 INVALID_LEARNING_STEP 오류를 GeneralException으로 발생시킵니다. 해당 오류는 HTTP 400, LEARNING_400_01 코드와 메시지를 사용합니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • Musereview/BE#24: UserLearningProgress 엔티티 구현과 create(...) 검증 로직이 직접 연결됩니다.

Poem

학습과 단계 손을 맞잡고
엇갈린 참조는 멈춰 세우네
400의 종이 울리면
올바른 길로 다시 가네
작은 검증, 큰 안심 ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning [#16] 변경은 UserLearningProgress 검증과 예외 enum 추가에 그쳐, 학습/진행상태/알림 엔티티 구현이라는 핵심 범위를 충족하지 못합니다. 학습, 학습 진행 상태, 알림 엔티티의 구현 누락분을 보완하고, 연관 필드·관계·검증 로직까지 포함해 다시 검토하세요.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed 추가된 예외 enum과 학습 단계 검증은 이슈의 예외 처리 및 엔티티 구현 범위와 자연스럽게 맞물립니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 학습 단계 예외 검증 로직 추가라는 핵심 변경을 잘 요약하며, 간결하고 관련성이 높습니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#16-learning-entity

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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/java/com/mr/domain/learning/entity/UserLearningProgress.java`:
- Around line 85-92: Update validateLearningAndStep to compare Learning and
learningStep.getLearning() using their non-null identifiers rather than entity
equals, while safely handling a null associated learning. Preserve the existing
INVALID_LEARNING_STEP exception when either identifier is missing or the IDs
differ.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 19e13755-c487-46a8-8784-7529a0584c36

📥 Commits

Reviewing files that changed from the base of the PR and between 15f82bb and 65f575e.

📒 Files selected for processing (2)
  • src/main/java/com/mr/domain/learning/entity/UserLearningProgress.java
  • src/main/java/com/mr/domain/learning/exception/LearningErrorStatus.java

@rkdehdrbs7885-oss rkdehdrbs7885-oss changed the title refactor: 팀 리뷰 수정_3 (#16) refactor: 학습 단계 예외 검증 로직 추가 (#16) Jul 21, 2026
@rkdehdrbs7885-oss

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ownue ownue left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

컨벤션에 맞춰 오류코드 명세 후 사용하신 것 좋네요~!

@on1yoneprivate on1yoneprivate left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

수고하셨습니다~

@rkdehdrbs7885-oss
rkdehdrbs7885-oss merged commit 27f7b7e into develop Jul 22, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants