Skip to content

Conversation

@Ji-soo708
Copy link
Member

@Ji-soo708 Ji-soo708 commented Aug 1, 2025

💡 작업 내용

  • FE 요청으로 공고 키워드 자동완성 일일 사용량 제한 로직 비활성화

✅ 셀프 체크리스트

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

🙋🏻‍ 확인해주세요

  • 주석 처리한 PR이라 바로 머지하겠습니다~

🔗 Jira 티켓


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

Summary by CodeRabbit

  • 버그 수정

    • 키워드 추출 기능에서 일일 사용량 제한 검증이 비활성화되었습니다.
  • 테스트

    • 일일 사용량 초과 시 예외가 발생하는 테스트가 비활성화되었습니다.

@Ji-soo708 Ji-soo708 self-assigned this Aug 1, 2025
@Ji-soo708 Ji-soo708 added the ✨ FEATURE 기능 추가 label Aug 1, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 1, 2025

Walkthrough

일일 사용량 제한 검증 기능이 비활성화되었습니다. 실제 코드에서는 해당 검증 메서드 호출이 주석 처리되었고, 테스트 코드에서는 일일 사용량 초과 예외를 확인하는 테스트가 주석 처리되었습니다. 그 외의 로직 변경은 없습니다.

Changes

Cohort / File(s) Change Summary
일일 사용량 제한 검증 비활성화
application/src/main/kotlin/com/dobby/usecase/experiment/ExtractExperimentPostKeywordsUseCase.kt
일일 사용량 제한을 검증하는 메서드 호출이 execute 함수 내에서 주석 처리되어 더 이상 동작하지 않음.
일일 사용량 초과 테스트 비활성화
application/src/test/kotlin/com/dobby/usecase/experiment/ExtractExperimentPostKeywordsUseCaseTest.kt
일일 사용량 초과 시 예외 발생을 검증하는 테스트 케이스 및 관련 import가 주석 처리됨.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

오늘도 코드를 살짝 고쳐,
토끼는 주석을 살포시 얹었네.
제한의 벽을 잠시 쉬게 하고,
테스트도 잠시 눈을 감네.
hop hop, 자유롭게 달려볼까,
내일은 또 어떤 변화가 올까? 🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

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

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/YS-534

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.

@github-actions github-actions bot changed the title feat: 공고 키워드 자동완성 일일 사용량 제한 로직 비활성화 [YS-534] feat: 공고 키워드 자동완성 일일 사용량 제한 로직 비활성화 Aug 1, 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 (3)
application/src/main/kotlin/com/dobby/usecase/experiment/ExtractExperimentPostKeywordsUseCase.kt (2)

21-21: 사용하지 않는 코드 정리 고려

일일 사용량 제한이 영구적으로 비활성화될 예정이라면, 사용하지 않는 상수(DAILY_USAGE_LIMIT)와 검증 메서드(validateDailyUsageLimit)를 제거하는 것을 고려해보세요. 임시 비활성화라면 현재 상태를 유지하는 것이 적절합니다.

영구 제거 시 다음 코드를 삭제할 수 있습니다:

-    companion object {
-        private const val DAILY_USAGE_LIMIT = 2
-    }

-    private fun validateDailyUsageLimit(memberId: String) {
-        val today = TimeProvider.currentDateTime().toLocalDate()
-        val startOfDay = today.atStartOfDay()
-        val endOfDay = today.plusDays(1).atStartOfDay()
-
-        val todayUsageCount = experimentPostKeywordsGateway.countByMemberIdAndCreatedAtBetween(
-            memberId = memberId,
-            start = startOfDay,
-            end = endOfDay
-        )
-
-        if (todayUsageCount >= DAILY_USAGE_LIMIT) {
-            throw ExperimentPostKeywordsDailyLimitExceededException
-        }
-    }

Also applies to: 48-62


3-3: 사용하지 않는 import 정리

ExperimentPostKeywordsDailyLimitExceededException import가 더 이상 사용되지 않습니다. 영구 비활성화라면 제거를 고려해보세요.

-import com.dobby.exception.ExperimentPostKeywordsDailyLimitExceededException
application/src/test/kotlin/com/dobby/usecase/experiment/ExtractExperimentPostKeywordsUseCaseTest.kt (1)

55-61: 사용하지 않는 목 설정 정리

남아있는 테스트에서 countByMemberIdAndCreatedAtBetween 메서드에 대한 목 설정이 더 이상 필요하지 않습니다. 일일 사용량 검증이 비활성화되었으므로 해당 목 설정을 제거할 수 있습니다.

-        every {
-            experimentPostKeywordsLogGateway.countByMemberIdAndCreatedAtBetween(
-                memberId = memberId,
-                start = currentDateTime.toLocalDate().atStartOfDay(),
-                end = currentDateTime.toLocalDate().plusDays(1).atStartOfDay()
-            )
-        } returns 1
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4b28335 and 814609f.

📒 Files selected for processing (2)
  • application/src/main/kotlin/com/dobby/usecase/experiment/ExtractExperimentPostKeywordsUseCase.kt (1 hunks)
  • application/src/test/kotlin/com/dobby/usecase/experiment/ExtractExperimentPostKeywordsUseCaseTest.kt (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Ji-soo708
PR: YAPP-Github/Gradmeet-BE#154
File: application/src/main/kotlin/com/dobby/usecase/experiment/ExtractExperimentPostKeywordsUseCase.kt:33-46
Timestamp: 2025-07-27T12:26:47.814Z
Learning: Gradmeet-BE 프로젝트에서 하루 최대 2회 사용 제한이 있는 기능의 경우, unique constraint나 낙관적 락 대신 DB 조회 기반 검증 방식을 선호한다. 분산 락은 나중에 최적화가 필요할 때 고려한다.
Learnt from: Ji-soo708
PR: YAPP-Github/Gradmeet-BE#140
File: domain/src/main/kotlin/com/dobby/gateway/auth/GoogleAuthGateway.kt:7-7
Timestamp: 2025-06-04T09:02:40.657Z
Learning: Ji-soo708의 팀은 로컬 ktlint 기준과 GitHub ktlint 체크 기준이 다를 때, 기존 코드베이스와의 일관성을 위해 로컬 기준을 우선시한다.
Learnt from: Ji-soo708
PR: YAPP-Github/Gradmeet-BE#154
File: infrastructure/src/main/kotlin/com/dobby/mapper/ExperimentPostKeywordsLogMapper.kt:15-22
Timestamp: 2025-07-27T12:37:15.372Z
Learning: Ji-soo708의 팀에서는 JSON 역직렬화 시 예외를 catch하여 래핑하기보다는, 예외를 자연스럽게 상위로 전파시켜 원본 컨텍스트를 보존하고 후속 조치를 용이하게 하는 것을 선호한다.
📚 Learning: ai가 텍스트에서 키워드를 추출하는 과정에서 enum 변환 실패(illegalargumentexception)는 정상적인 상황에 가깝다. 따라서 experimentpostkeywo...
Learnt from: Ji-soo708
PR: YAPP-Github/Gradmeet-BE#150
File: infrastructure/src/main/kotlin/com/dobby/external/prompt/ExperimentPostKeywordMapper.kt:52-58
Timestamp: 2025-07-17T08:06:16.021Z
Learning: AI가 텍스트에서 키워드를 추출하는 과정에서 enum 변환 실패(IllegalArgumentException)는 정상적인 상황에 가깝다. 따라서 ExperimentPostKeywordMapper에서 TimeSlot, MatchType 등의 enum 변환 실패 시 로깅을 추가하지 않는 것이 적절하다.

Applied to files:

  • application/src/test/kotlin/com/dobby/usecase/experiment/ExtractExperimentPostKeywordsUseCaseTest.kt
⏰ 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
🔇 Additional comments (2)
application/src/main/kotlin/com/dobby/usecase/experiment/ExtractExperimentPostKeywordsUseCase.kt (1)

35-35: 일일 사용량 제한 비활성화 확인됨

프론트엔드 요청에 따라 일일 사용량 제한 로직이 정상적으로 비활성화되었습니다. 주석 처리 방식은 향후 재활성화 가능성을 고려한 적절한 접근법입니다.

application/src/test/kotlin/com/dobby/usecase/experiment/ExtractExperimentPostKeywordsUseCaseTest.kt (1)

72-97: 테스트 비활성화 일관성 확인됨

구현부 변경사항과 일치하게 일일 사용량 초과 테스트가 적절히 주석 처리되었습니다. 기능 비활성화에 따른 테스트 수정이 올바르게 반영되었습니다.

영구 비활성화라면 주석 처리된 테스트 코드 제거를 고려해보세요:

-//    given("일일 사용 한도에 도달한 사용자가") {
-//        val memberId = "exceeded_member_456"
-//        val inputText = "실험 참여자 모집"
-//        val input = ExtractExperimentPostKeywordsUseCase.Input(memberId, inputText)
-//
-//        val mockMember = mockk<Member>()
-//        val currentDateTime = LocalDateTime.of(2025, 1, 27, 15, 30, 0)
-//
-//        every { TimeProvider.currentDateTime() } returns currentDateTime
-//        every { memberGateway.getById(memberId) } returns mockMember
-//        every {
-//            experimentPostKeywordsLogGateway.countByMemberIdAndCreatedAtBetween(
-//                memberId = memberId,
-//                start = currentDateTime.toLocalDate().atStartOfDay(),
-//                end = currentDateTime.toLocalDate().plusDays(1).atStartOfDay()
-//            )
-//        } returns 2
-//
-//        `when`("키워드 추출을 요청하면") {
-//            then("DailyLimitExceededException 예외가 발생해야 한다") {
-//                shouldThrow<ExperimentPostKeywordsDailyLimitExceededException> {
-//                    extractExperimentPostKeywordsUseCase.execute(input)
-//                }
-//            }
-//        }
-//    }

@Ji-soo708 Ji-soo708 merged commit 1836990 into dev Aug 1, 2025
4 checks passed
@Ji-soo708 Ji-soo708 deleted the feat/YS-534 branch August 1, 2025 09:26
chock-cho pushed a commit that referenced this pull request Oct 21, 2025
* feat: disable daily usage limit check

* test: temporarily remove tests for keyword autocomplete usage limit
chock-cho pushed a commit that referenced this pull request Oct 21, 2025
* feat: disable daily usage limit check

* test: temporarily remove tests for keyword autocomplete usage limit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ FEATURE 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants