Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 과제 마감날짜 유효성 검사 로직 수정 #759

Merged
merged 4 commits into from
Sep 4, 2024

Conversation

AlmondBreez3
Copy link
Member

@AlmondBreez3 AlmondBreez3 commented Sep 4, 2024

🌱 관련 이슈

📌 작업 내용 및 특이사항

  • 이미 테스트는 기존 커리큘럼의 시작날짜로 검증하는 것으로 생각하고 짜놨더라고요 그래서 validator부분에서 비교하는 날짜만 추가했습니다 ~

📝 참고사항

📚 기타

Summary by CodeRabbit

  • 새로운 기능
    • 스터디 과제의 마감일 검증 로직을 개선하여 커리큘럼 시작일을 기준으로 마감일을 평가합니다.
  • 버그 수정
    • 스터디 과제 게시 검증 과정에서 마감일 검증의 기준을 변경하여 정확성을 향상시켰습니다.

@AlmondBreez3 AlmondBreez3 self-assigned this Sep 4, 2024
@AlmondBreez3 AlmondBreez3 requested a review from a team as a code owner September 4, 2024 13:30
Copy link

coderabbitai bot commented Sep 4, 2024

Warning

Rate limit exceeded

@AlmondBreez3 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 16 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 5b256d2 and 8b63077.

Walkthrough

변경 사항은 StudyDetailValidator.java 파일의 validatePublishStudyAssignmentvalidateDeadLine 메서드에 대한 수정으로, 과제 유효성 검사 로직에 영향을 미칩니다. validatePublishStudyAssignment 메서드는 validateDeadLine 메서드에 추가 매개변수인 studyDetail.getPeriod().getStartDate()를 전달하도록 변경되었으며, 이로 인해 마감일 검증 기준이 변경되었습니다. validateDeadLine 메서드는 새로운 매개변수를 수용하도록 업데이트되어, 마감일이 현재 시간 이전인지 확인하는 대신 커리큘럼 시작일 이전인지 확인하게 됩니다.

Changes

파일 경로 변경 요약
src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetailValidator.java validatePublishStudyAssignment 메서드의 기능 변경 및 validateDeadLine 메서드의 매개변수 추가로 마감일 검증 로직 수정

Assessment against linked issues

Objective Addressed Explanation
과제 마감 기간은 Max(커리큘럼 시작일, 현재일) 이후여야 합니다. (#756)
현재 커리큘럼 시작일 이전에도 개설 가능합니다. (#756) 커리큘럼 시작일 이전 개설 여부 검증 없음.

🐰
변경된 코드에 기뻐하며,
마감일이 새로워졌네!
커리큘럼과 함께 뛰어가,
과제는 이제 더 밝아!
귀여운 토끼가 춤을 춰,
새로운 시작을 축하해! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 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.

Copy link

github-actions bot commented Sep 4, 2024

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 83cc9a9 and ecc211c.

Files selected for processing (1)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetailValidator.java (2 hunks)
Additional comments not posted (2)
src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetailValidator.java (2)

22-22: 변경 사항이 적절해 보입니다!

validateDeadLine 메서드에 커리큘럼 시작일을 추가로 전달하여 마감일 검증 기준을 변경한 것은 PR 목적에 부합하는 것으로 보입니다. 이를 통해 과제 마감일이 커리큘럼 시작일과 현재 날짜 중 더 늦은 날짜 이후로 설정되도록 할 수 있습니다.


32-35: 변경 사항이 적절해 보입니다!

validateDeadLine 메서드에서 마감일을 현재 시간이 아닌 커리큘럼 시작일과 비교하도록 변경한 것은 PR 목적에 부합하는 것으로 보입니다. 이를 통해 마감일 검증 기준을 보다 적절한 시간 기준으로 개선할 수 있습니다.

Copy link
Member

@Sangwook02 Sangwook02 left a comment

Choose a reason for hiding this comment

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

확인부탁드려요

@@ -29,8 +29,8 @@ private void validateStudyMentorAuthorization(Member member, StudyDetail studyDe
}
}

private void validateDeadLine(LocalDateTime deadline) {
if (deadline.isBefore(LocalDateTime.now())) {
private void validateDeadLine(LocalDateTime deadline, LocalDateTime curriculumStartDate) {
Copy link
Member

Choose a reason for hiding this comment

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

StudyDetail이 가진 Curriculum에 startAt이 따로 있습니다.
변수명 수정해주셔야 할 것 같습니다

Copy link
Member

@uwoobeat uwoobeat left a comment

Choose a reason for hiding this comment

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

데드라인을 오늘 이전으로 설정할 수 없다는 요구사항은 여전히 있는데 고치시는 이유가 뭔가요?

Copy link

github-actions bot commented Sep 4, 2024

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ecc211c and 5b256d2.

Files selected for processing (1)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetailValidator.java (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetailValidator.java

Copy link

github-actions bot commented Sep 4, 2024

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link
Member

@uwoobeat uwoobeat left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@Sangwook02 Sangwook02 left a comment

Choose a reason for hiding this comment

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

lgtm

@AlmondBreez3 AlmondBreez3 merged commit d304af7 into develop Sep 4, 2024
1 check passed
@AlmondBreez3 AlmondBreez3 deleted the feature/756-assignment-due-date branch September 4, 2024 15:07
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