-
Notifications
You must be signed in to change notification settings - Fork 350
Iris: Refactor textExerciseChatPipelineExecutionDto
#11671
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
base: develop
Are you sure you want to change the base?
Iris: Refactor textExerciseChatPipelineExecutionDto
#11671
Conversation
…peline-execution-dto
WalkthroughThis pull request restructures the PyrisTextExerciseChatPipelineExecutionDTO record by flattening its design. The nested execution field is removed, and its contents (settings, initialStages) are promoted to top-level fields alongside a new user field. The conversation field is renamed to chatHistory. Callers are updated to use the new DTO structure. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
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: 0
🧹 Nitpick comments (2)
src/test/java/de/tum/cit/aet/artemis/iris/IrisTextExerciseChatMessageIntegrationTest.java (1)
335-339: Session‑title update test remains valid with flattened DTOSwitching to
dto.settings().authenticationToken()anddto.initialStages()keeps this test compatible with the new DTO while still validating the title update behavior. As a minor improvement, you could also assert ondto.sessionTitle()ordto.chatHistory()here if you want coverage of additional DTO fields, but it’s optional.src/main/java/de/tum/cit/aet/artemis/iris/service/session/IrisTextExerciseChatSessionService.java (1)
34-35: Constructor wiring for new DTO shape looks correctThe added
PyrisUserDTOimport and the updatedPyrisTextExerciseChatPipelineExecutionDTOconstruction (exercise, title, conversation/chatHistory, newPyrisUserDTO(user), latest submission text,dto.settings(),dto.initialStages(),settings.customInstructions()) align with the new record definition and keep null‑handling for custom instructions intact.If you touch this again, consider renaming the local
conversationvariable tochatHistoryto mirror the DTO field name.Also applies to: 117-124
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/dto/chat/textexercise/PyrisTextExerciseChatPipelineExecutionDTO.java(1 hunks)src/main/java/de/tum/cit/aet/artemis/iris/service/session/IrisTextExerciseChatSessionService.java(2 hunks)src/test/java/de/tum/cit/aet/artemis/iris/IrisTextExerciseChatMessageIntegrationTest.java(5 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/test/java/**/*.java
⚙️ CodeRabbit configuration file
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
Files:
src/test/java/de/tum/cit/aet/artemis/iris/IrisTextExerciseChatMessageIntegrationTest.java
src/main/java/**/*.java
⚙️ CodeRabbit configuration file
naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_imports
Files:
src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/dto/chat/textexercise/PyrisTextExerciseChatPipelineExecutionDTO.javasrc/main/java/de/tum/cit/aet/artemis/iris/service/session/IrisTextExerciseChatSessionService.java
🧠 Learnings (8)
📓 Common learnings
Learnt from: alexjoham
Repo: ls1intum/Artemis PR: 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: magaupp
Repo: ls1intum/Artemis PR: 8802
File: src/main/resources/templates/rust/exercise/src/context.rs:1-1
Timestamp: 2024-10-08T15:35:42.972Z
Learning: Code inside the `exercise` directories in the Artemis platform is provided to students and is intended for them to implement. TODO comments in these directories are meant to guide students and should not be addressed in the PR.
Learnt from: magaupp
Repo: ls1intum/Artemis PR: 8802
File: src/main/resources/templates/rust/exercise/src/context.rs:1-1
Timestamp: 2024-08-05T00:11:50.650Z
Learning: Code inside the `exercise` directories in the Artemis platform is provided to students and is intended for them to implement. TODO comments in these directories are meant to guide students and should not be addressed in the PR.
📚 Learning: 2024-10-15T11:33:17.915Z
Learnt from: alexjoham
Repo: ls1intum/Artemis PR: 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`.
Applied to files:
src/test/java/de/tum/cit/aet/artemis/iris/IrisTextExerciseChatMessageIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/iris/service/pyris/dto/chat/textexercise/PyrisTextExerciseChatPipelineExecutionDTO.javasrc/main/java/de/tum/cit/aet/artemis/iris/service/session/IrisTextExerciseChatSessionService.java
📚 Learning: 2024-11-26T20:43:17.588Z
Learnt from: magaupp
Repo: ls1intum/Artemis PR: 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.
Applied to files:
src/test/java/de/tum/cit/aet/artemis/iris/IrisTextExerciseChatMessageIntegrationTest.java
📚 Learning: 2025-09-25T20:28:36.905Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/domain/ExamUser.java:16-17
Timestamp: 2025-09-25T20:28:36.905Z
Learning: In the Artemis codebase, ExamUser entity uses ExamSeatDTO as a transient field for performance reasons. SamuelRoettgermann tested domain value objects but they caused 60x slower performance. This architectural exception is approved by maintainers due to significant performance benefits and Artemis naming convention requirements.
Applied to files:
src/test/java/de/tum/cit/aet/artemis/iris/IrisTextExerciseChatMessageIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/iris/service/session/IrisTextExerciseChatSessionService.java
📚 Learning: 2025-04-14T11:08:04.129Z
Learnt from: alexjoham
Repo: ls1intum/Artemis PR: 10666
File: src/main/webapp/app/iris/overview/services/iris-chat-http.service.ts:73-86
Timestamp: 2025-04-14T11:08:04.129Z
Learning: The IrisTutorSuggestionRequestMessage class in src/main/webapp/app/iris/shared/entities/iris-message.model.ts does not have a messageDifferentiator property, unlike IrisUserMessage. Therefore, messageDifferentiator should not be set in the createTutorSuggestion method in the IrisChatHttpService.
Applied to files:
src/test/java/de/tum/cit/aet/artemis/iris/IrisTextExerciseChatMessageIntegrationTest.java
📚 Learning: 2025-07-07T11:43:11.736Z
Learnt from: bassner
Repo: ls1intum/Artemis PR: 10705
File: src/test/java/de/tum/cit/aet/artemis/lecture/service/SlideUnhideServiceTest.java:54-57
Timestamp: 2025-07-07T11:43:11.736Z
Learning: In the Artemis test framework, the AbstractArtemisIntegrationTest base class provides common MockitoSpyBean fields like instanceMessageSendService as protected fields, making them available to all test subclasses through inheritance.
Applied to files:
src/test/java/de/tum/cit/aet/artemis/iris/IrisTextExerciseChatMessageIntegrationTest.java
📚 Learning: 2025-05-26T15:37:20.890Z
Learnt from: bassner
Repo: ls1intum/Artemis PR: 10782
File: src/main/java/de/tum/cit/aet/artemis/iris/service/session/IrisCourseChatSessionService.java:130-130
Timestamp: 2025-05-26T15:37:20.890Z
Learning: The Pyris service expects to receive null as customInstructions when there are no custom instructions configured. Null values should be passed directly to PyrisPipelineService.executeCourseChatPipeline without defensive null handling or conversion to empty strings.
Applied to files:
src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/dto/chat/textexercise/PyrisTextExerciseChatPipelineExecutionDTO.javasrc/main/java/de/tum/cit/aet/artemis/iris/service/session/IrisTextExerciseChatSessionService.java
📚 Learning: 2024-11-29T23:02:09.475Z
Learnt from: kaancayli
Repo: ls1intum/Artemis PR: 9740
File: src/main/java/de/tum/cit/aet/artemis/iris/service/session/IrisLectureChatSessionService.java:126-126
Timestamp: 2024-11-29T23:02:09.475Z
Learning: Token tracking should be implemented for all Iris session types, including `IrisLectureChatSessionService`, by extending `AbstractIrisChatSessionService` where appropriate.
Applied to files:
src/main/java/de/tum/cit/aet/artemis/iris/service/session/IrisTextExerciseChatSessionService.java
⏰ 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: client-tests
- GitHub Check: server-style
- GitHub Check: client-style
- GitHub Check: server-tests
- GitHub Check: Build and Push Docker Image / Build linux/amd64 Docker Image for ls1intum/artemis
- GitHub Check: Build and Push Docker Image / Build linux/arm64 Docker Image for ls1intum/artemis
- GitHub Check: Build .war artifact
- GitHub Check: bean-instantiation-check
- GitHub Check: Analyse
🔇 Additional comments (5)
src/test/java/de/tum/cit/aet/artemis/iris/IrisTextExerciseChatMessageIntegrationTest.java (4)
104-107: Updated access to settings and stages matches new DTO layoutUsing
dto.settings().authenticationToken()anddto.initialStages()here correctly reflects the flattenedPyrisTextExerciseChatPipelineExecutionDTOstructure; behavior stays equivalent to the previousdto.execution().…access.
171-175: Consistent DTO field usage across both pipeline mocksBoth mocks in this test now read the token from
dto.settings()and stages fromdto.initialStages(), which is consistent with the new DTO signature and with the single‑message test above.Also applies to: 179-185
271-275: Resend flow aligned with new DTO structureThe resend test’s assertions on
dto.settings().authenticationToken()anddto.initialStages()are correctly adapted to the refactored DTO and keep the original semantics.
296-300: Rate‑limit test uses new settings/initialStages fields correctlyThe rate‑limit scenario now also accesses the authentication token and stages via the top‑level
settingsandinitialStagesfields, which fits the new DTO design.src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/dto/chat/textexercise/PyrisTextExerciseChatPipelineExecutionDTO.java (1)
9-17: Flattened DTO design matches intended API evolutionThe new
PyrisTextExerciseChatPipelineExecutionDTOrecord cleanly exposes exercise, session title, chat history, user, submission text, settings, initial stages, and optional custom instructions, matching how callers now construct it. This aligns with the refactor away from the nested execution DTO.
End-to-End (E2E) Test Results Summary
|
||||||||||||||||||||||||||||||
Anishyou
left a comment
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.

Checklist
General
Server
Motivation and Context
The
TextExerciseChatPipelineExecutionDTOwas refactored for improved consistency in Iris on edutelligence (see PR). Due to this refactoring, the expected structure and argument names have changed.This PR updates the codebase to pass the correct arguments in the updated format, ensuring compatibility with the new DTO structure.
Description
This PR updates the PyrisTextExerciseChatPipelineExecutionDTO to match the new structure introduced in edutelligence.
The DTO was changed from:
public record PyrisTextExerciseChatPipelineExecutionDTO(PyrisPipelineExecutionDTO execution, PyrisTextExerciseDTO exercise, String sessionTitle, List<PyrisMessageDTO> conversation, String currentSubmission, @Nullable String customInstructions)to the updated format:
public record PyrisTextExerciseChatPipelineExecutionDTO(PyrisTextExerciseDTO exercise, String sessionTitle, List<PyrisMessageDTO> chatHistory, PyrisUserDTO user, String currentSubmission, PyrisPipelineExecutionSettingsDTO settings, List<PyrisStageDTO> initialStages, @Nullable String customInstructions)All necessary adjustments were made throughout the codebase to ensure that the new arguments are passed correctly and that all usages remain consistent with the updated DTO.
Steps for Testing
Warning
This PR can only be tested together with the corresponding PR on edutelligence.
To test this PR on a test server, you need to add the label 'deploy:pyris-test' in the corresponding PR on edutelligence.
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
Performance Review
Code Review
Manual Tests
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.