-
Notifications
You must be signed in to change notification settings - Fork 322
Lectures
: Integrate slide visibility scheduling into ScheduleService
#10705
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
Conversation
End-to-End (E2E) Test Results Summary
|
End-to-End (E2E) Test Results Summary
|
…fecycle' into feature/lectures/create-slide-lifecycle
End-to-End (E2E) Test Results Summary
|
End-to-End (E2E) Test Results Summary
|
End-to-End (E2E) Test Results Summary
|
End-to-End (E2E) Test Results Summary
|
WalkthroughThis update introduces comprehensive scheduling and lifecycle management for slide entities, mirroring the mechanisms previously available for exercises and participations. A new Changes
Sequence Diagram(s)sequenceDiagram
participant Admin as AdminScheduleResource
participant Schedule as ScheduleService
participant SlideService as SlideLifecycleService
participant Slide as Slide
Admin->>Schedule: getAllSlideSchedules(pageable)
Schedule->>Schedule: findAllSlideEvents(pageable)
Schedule-->>Admin: Page<ScheduledSlideEvent>
sequenceDiagram
participant SlideUnhideSched as SlideUnhideScheduleService
participant SlideUnhide as SlideUnhideService
participant Schedule as ScheduleService
participant SlideExec as SlideUnhideExecutionService
participant Slide as Slide
SlideUnhideSched->>SlideUnhide: handleSlideHiddenUpdate(slide)
alt slide.hidden == null
SlideUnhide->>Schedule: cancelScheduledTaskForSlideLifecycle(slide.id, UNHIDE)
else slide.hidden in past
SlideUnhide->>Schedule: cancelScheduledTaskForSlideLifecycle(slide.id, UNHIDE)
SlideUnhide->>SlideExec: unhideSlide(slide.id)
else slide.hidden in future
SlideUnhide->>Schedule: cancelScheduledTaskForSlideLifecycle(slide.id, UNHIDE)
Schedule->>Schedule: scheduleSlideTask(slide, UNHIDE, ...)
end
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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). (8)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
Documentation and Community
|
End-to-End (E2E) Test Results Summary |
End-to-End (E2E) Test Results Summary
|
End-to-End (E2E) Test Results Summary
|
End-to-End (E2E) Test Results Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/test/java/de/tum/cit/aet/artemis/lecture/service/SlideUnhideServiceTest.java (1)
35-36
: Consider using @MockitoBean instead of @MockitoSpyBean for manually created service.Since you're manually instantiating the
SlideUnhideService
with mocked dependencies, using@MockitoSpyBean
forslideUnhideExecutionService
may not be the intended approach. Consider using@MockitoBean
for cleaner mock management.- @MockitoSpyBean + @MockitoBean private SlideUnhideExecutionService slideUnhideExecutionService;
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/test/java/de/tum/cit/aet/artemis/lecture/service/SlideUnhideServiceTest.java
(6 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`src/test/java/**/*.java`: test_naming: descriptive; test_size: small_specific; ...
src/test/java/**/*.java
: test_naming: descriptive; test_size: small_specific; fixed_data: true; junit5_features: true; assert_use: assertThat; assert_specificity: true; archunit_use: enforce_package_rules; db_query_count_tests: track_performance; util_service_factory_pattern: true; avoid_db_access: true; mock_strategy: static_mocks; context_restart_minimize: true
⚙️ Source: CodeRabbit Configuration File
List of files the instruction was applied to:
src/test/java/de/tum/cit/aet/artemis/lecture/service/SlideUnhideServiceTest.java
🧠 Learnings (2)
📓 Common learnings
Learnt from: julian-christl
PR: ls1intum/Artemis#7993
File: src/main/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizScheduleService.java:515-518
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The additional database call for initializing team's students in `QuizScheduleService` is considered to have minimal performance impact due to the rarity of the endpoint's usage, as assessed by `julian-christl`.
Learnt from: SamuelRoettgermann
PR: ls1intum/Artemis#9303
File: src/main/java/de/tum/in/www1/artemis/service/exam/StudentExamService.java:296-300
Timestamp: 2024-10-20T18:37:45.365Z
Learning: When reviewing code changes in `StudentExamService.saveSubmission`, if the PR aims to improve readability without changing logic, avoid suggesting changes that alter logic, such as adding exceptions in the default case of switch statements.
src/test/java/de/tum/cit/aet/artemis/lecture/service/SlideUnhideServiceTest.java (12)
Learnt from: julian-christl
PR: ls1intum/Artemis#8052
File: src/test/java/de/tum/in/www1/artemis/lecture/CompetencyIntegrationTest.java:310-310
Timestamp: 2024-06-10T19:44:09.116Z
Learning: Modifications to parameters in `competencyProgressUtilService.createCompetencyProgress` for debugging purposes are considered irrelevant to the test outcomes but helpful for clarity during debugging.
Learnt from: magaupp
PR: ls1intum/Artemis#9751
File: src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java:143-148
Timestamp: 2024-11-26T20:43:17.588Z
Learning: In `src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java`, the test package name assigned in `populateUnreleasedProgrammingExercise` does not need to adhere to naming conventions.
Learnt from: Strohgelaender
PR: ls1intum/Artemis#8574
File: src/main/java/de/tum/in/www1/artemis/service/tutorialgroups/TutorialGroupService.java:0-0
Timestamp: 2024-10-08T15:35:42.972Z
Learning: The `tryToFindMatchingUsers` method in `TutorialGroupService.java` has been updated to skip registrations without a student, enhancing the method's robustness. This change was implemented in commit `bef30f9751de0913143e8cb28cc0088264052261`.
Learnt from: alexjoham
PR: ls1intum/Artemis#9455
File: src/test/java/de/tum/cit/aet/artemis/iris/IrisTextExerciseChatMessageIntegrationTest.java:401-401
Timestamp: 2024-10-15T11:33:17.915Z
Learning: In the Artemis project, when new fields are added to classes like `PyrisChatStatusUpdateDTO`, corresponding tests may be implemented in separate integration test classes such as `IrisChatTokenTrackingIntegrationTest`.
Learnt from: SimonEntholzer
PR: ls1intum/Artemis#9918
File: src/main/java/de/tum/cit/aet/artemis/programming/service/sshuserkeys/UserSshPublicKeyExpiryNotificationService.java:52-57
Timestamp: 2024-12-13T16:34:24.743Z
Learning: In `UserSshPublicKeyExpiryNotificationService`, changing the visibility of `notifyUserOnExpiredKey()` or modifying its lambda return value can cause issues and should be avoided.
Learnt from: SimonEntholzer
PR: ls1intum/Artemis#9345
File: src/main/java/de/tum/cit/aet/artemis/core/service/telemetry/TelemetryService.java:0-0
Timestamp: 2024-10-08T21:46:22.597Z
Learning: In the `TelemetryService` class, the fields `useTelemetry`, `sendAdminDetails`, `eurekaEnabled`, and `sendingDelay` are intentionally kept public for testability purposes.
Learnt from: SamuelRoettgermann
PR: ls1intum/Artemis#10921
File: src/test/java/de/tum/cit/aet/artemis/exam/ExamIntegrationTest.java:1334-1339
Timestamp: 2025-06-15T04:13:22.541Z
Learning: In Artemis ExamIntegrationTest, time difference assertions use ChronoUnit.MILLIS.between().isLessThan(1) without Math.abs() because the server only stores and retrieves timestamp values without calling now(), making differences predictable and consistent due to serialization/storage precision rather than timing variations.
Learnt from: jakubriegel
PR: ls1intum/Artemis#8050
File: src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismUtilService.java:62-66
Timestamp: 2024-10-08T15:35:42.972Z
Learning: The `createCourseWithUsers` method in `PlagiarismUtilService.java` uses fixed inputs as it is designed to be a test helper method for simplifying the setup of courses and users in tests.
Learnt from: jakubriegel
PR: ls1intum/Artemis#8050
File: src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismUtilService.java:62-66
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `createCourseWithUsers` method in `PlagiarismUtilService.java` uses fixed inputs as it is designed to be a test helper method for simplifying the setup of courses and users in tests.
Learnt from: jakubriegel
PR: ls1intum/Artemis#8050
File: src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismUtilService.java:125-136
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `createTeamTextExerciseAndSimilarSubmissions` method in `PlagiarismUtilService.java` uses fixed inputs as it is designed to be a test helper method for simplifying the setup of team exercises and submissions in tests.
Learnt from: jakubriegel
PR: ls1intum/Artemis#8050
File: src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismUtilService.java:125-136
Timestamp: 2024-10-08T15:35:48.767Z
Learning: The `createTeamTextExerciseAndSimilarSubmissions` method in `PlagiarismUtilService.java` uses fixed inputs as it is designed to be a test helper method for simplifying the setup of team exercises and submissions in tests.
Learnt from: valentin-boehm
PR: ls1intum/Artemis#7384
File: src/test/java/de/tum/in/www1/artemis/exam/StudentExamIntegrationTest.java:975-980
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `testSubmitStudentExam_notInTime` method does not require additional checks to verify the state of `studentExam1` after receiving a `HttpStatus.FORBIDDEN` because the control flow in the `StudentExamResource` is straightforward and ensures no state change occurs.
🧬 Code Graph Analysis (1)
src/test/java/de/tum/cit/aet/artemis/lecture/service/SlideUnhideServiceTest.java (2)
src/main/webapp/app/lecture/shared/entities/lecture-unit/attachmentVideoUnit.model.ts (1)
AttachmentVideoUnit
(5-15)src/main/webapp/app/lecture/shared/entities/lecture-unit/slide.model.ts (1)
Slide
(4-10)
⏰ 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). (9)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
- GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
- GitHub Check: Build .war artifact
- GitHub Check: client-style
- GitHub Check: client-tests
- GitHub Check: server-style
- GitHub Check: server-tests
- GitHub Check: Analyse
🔇 Additional comments (4)
src/test/java/de/tum/cit/aet/artemis/lecture/service/SlideUnhideServiceTest.java (4)
74-104
: Well-structured test with comprehensive verification.The test effectively verifies the scheduling behavior for future hidden dates, including proper argument capture and verification of method calls. The use of
ArgumentCaptor
to verify specific parameters passed toscheduleSlideTask
is thorough.
106-129
: Comprehensive test coverage for past hidden date scenario.The test properly verifies that slides with past hidden dates are immediately unhidden rather than scheduled, which is the expected behavior. The verification that scheduling methods are not called is important for ensuring correct logic flow.
146-158
: Good verification of cancellation behavior.The test properly verifies that when a slide's hidden date is set to null, the scheduled task is canceled and no new scheduling or immediate unhiding occurs. The comprehensive verification of what should NOT happen (using
never()
) is excellent.
168-178
: Effective test for immediate unhide scenario.The test cleverly uses
handleSlideHiddenUpdate
with a past date to trigger immediate unhiding, which is a good approach for testing the unhide functionality. The verification of both cancellation and execution is thorough.
src/test/java/de/tum/cit/aet/artemis/lecture/service/SlideUnhideServiceTest.java
Show resolved
Hide resolved
End-to-End (E2E) Test Results Summary
|
End-to-End (E2E) Test Results Summary
|
Checklist
General
Server
Motivation and Context
This pull request assigns a distinct name to each scheduled task to improve clarity in debug logs, making it easier to identify and trace specific tasks during execution. It also exposes the scheduling information through an admin REST API via AdminScheduleResource, allowing for better visibility and management of scheduled tasks.
Description
To enable this implementation, the following changes are made:
Steps for Testing
Prerequisites:
Testserver States
You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.
Review Progress
Code Review
Manual Tests
Test Coverage
Screenshots
Summary by CodeRabbit
New Features
Refactor
Tests