Skip to content

Conversation

@Ji-soo708
Copy link
Member

@Ji-soo708 Ji-soo708 commented Jul 31, 2025

💡 작업 내용

  • ExperimentPostKeywordMapper 키워드 매핑 로직 정리
  • 추출하지 못한 키워드는 null로 설정

✅ 셀프 체크리스트

  • PR 제목을 형식에 맞게 작성했나요?
  • 브랜치 전략에 맞는 브랜치에 PR을 올리고 있나요?
  • 테스트는 잘 통과했나요?
  • 빌드에 성공했나요?
  • 본인을 assign 해주세요.
  • 해당 PR에 맞는 label을 붙여주세요.

🙋🏻‍ 확인해주세요

  • 단순히 로직을 깔끔히 정리한 PR이라 바로 머지하겠습니다~

🔗 Jira 티켓


https://yappsocks.atlassian.net/browse/YS-533

Summary by CodeRabbit

  • 버그 수정

    • 일부 필드에서 기본값 대신 실제 값이 없는 경우 null로 처리하도록 개선되어, 데이터 누락 시 잘못된 기본값이 표시되는 문제를 방지했습니다.
  • 리팩터링

    • 내부 데이터 변환 방식이 보다 견고하게 변경되어, 잘못된 값이 있을 때 예외 대신 null로 처리됩니다.
    • 사용되지 않는 변환 기능이 제거되었습니다.

@Ji-soo708 Ji-soo708 self-assigned this Jul 31, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 31, 2025

Walkthrough

ExperimentPostKeywordMappertoDomain 함수가 기본값 제공 방식에서 보다 방어적인 enum 파싱 방식으로 변경되었습니다. 여러 필드의 기본값 할당이 제거되었고, 잘못된 enum 문자열 처리 시 null을 반환하도록 수정되었습니다. 또한 toDto 함수가 제거되었습니다. keyword_extraction_prompt.json에서는 누락 정보 처리 시 빈 문자열이나 0 대신 null을 할당하도록 프롬프트 조건이 변경되었습니다.

Changes

Cohort / File(s) Change Summary
ExperimentPostKeywordMapper 리팩토링
infrastructure/src/main/kotlin/com/dobby/external/prompt/ExperimentPostKeywordMapper.kt
toDomain 함수에서 기본값 제거, enum 파싱을 try-catch로 변경, 잘못된 값에 대해 null 반환. toDto 함수 삭제 및 관련 import 제거.
프롬프트 조건 변경
infrastructure/src/main/resources/prompts/keyword_extraction_prompt.json
누락 정보 처리 시 빈 문자열("") 또는 0 대신 null 할당하도록 프롬프트 조건 변경.

Sequence Diagram(s)

sequenceDiagram
    participant DTO as ExperimentPostKeywordDto
    participant Mapper as ExperimentPostKeywordMapper
    participant Domain as ExperimentPostKeywords

    DTO->>Mapper: toDomain(dto)
    alt Enum 파싱 성공
        Mapper->>Domain: 필드 값을 그대로 할당
    else Enum 파싱 실패
        Mapper->>Domain: 해당 필드에 null 할당
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related PRs

Suggested reviewers

  • chock-cho

Poem

🐰
코드를 다듬는 작은 손길,
기본값 대신 신중한 길.
enum 파싱은 조심조심,
toDto는 이제 안녕 인사.
리팩토링 바람이 살랑살랑,
도비의 코드가 더 단단!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 05700dd and bab5e8a.

📒 Files selected for processing (1)
  • infrastructure/src/main/resources/prompts/keyword_extraction_prompt.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • infrastructure/src/main/resources/prompts/keyword_extraction_prompt.json
⏰ 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). (2)
  • GitHub Check: Check Code Quality
  • GitHub Check: build
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refact/YS-533

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Ji-soo708 Ji-soo708 added the ♻️ REFACTORING 리팩토링 label Jul 31, 2025
@github-actions github-actions bot changed the title refactor: ExperimentPostKeywordMapper 키워드 매핑 로직 정리 [YS-533] refactor: ExperimentPostKeywordMapper 키워드 매핑 로직 정리 Jul 31, 2025
@Ji-soo708 Ji-soo708 changed the title [YS-533] refactor: ExperimentPostKeywordMapper 키워드 매핑 로직 정리 [YS-533] refactor: ExperimentPostKeywordMapper 키워드 매핑 로직 리팩터링 Jul 31, 2025
@Ji-soo708 Ji-soo708 merged commit 4b28335 into dev Jul 31, 2025
4 checks passed
@Ji-soo708 Ji-soo708 deleted the refact/YS-533 branch July 31, 2025 12:08
chock-cho pushed a commit that referenced this pull request Oct 21, 2025
* refactor: simplify keyword mapping logic with safe enum parsing

* feat: handle unknown keyword enums as null for robustness
chock-cho pushed a commit that referenced this pull request Oct 21, 2025
* refactor: simplify keyword mapping logic with safe enum parsing

* feat: handle unknown keyword enums as null for robustness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants