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

Iris: Add chat in text exercises #9362

Merged
merged 32 commits into from
Oct 12, 2024

Conversation

MichaelOwenDyer
Copy link
Contributor

@MichaelOwenDyer MichaelOwenDyer commented Sep 24, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) and too complex database calls.
  • I strictly followed the principle of data economy for all database calls.
  • I strictly followed the server coding and design guidelines.
  • I added multiple integration tests (Spring) related to the features (with a high test coverage).
  • I added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
  • I documented the Java code using JavaDoc style.

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data (e.g. using paging).
  • I strictly followed the principle of data economy for all client-server REST calls.
  • I strictly followed the client coding and design guidelines.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
  • I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I added authorities to all new routes and checked the course groups for displaying navigation elements (links, buttons).
  • I documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Motivation and Context

Up until now, Iris has only been available for programming exercises. We want to expand the availability of Iris to other exercise types.

Description

Iris has been added to text exercises.

  • A new Session type has been added and corresponding SessionService.
  • The Iris button now appears in text exercises when the feature is enabled globally, in the course, and in the exercise itself. Clicking the button opens the Iris chat window.
  • A new Pyris pipeline has been added to power the feature.

Future Work

In this PR, Iris is only aware of the last submission to the exercise. If the user edits the text without submitting, Iris will not see it. This is because it is not possible with the current server architecture for the client to send form data for use in the Pyris feature pipeline. This is outside the scope of this PR.

Steps for Testing

Prerequisites:

  • Iris is enabled globally
  • 1 Course
  • 1 Text exercise
  1. Log in to Artemis
  2. Navigate to Course Administration, click on your course
  3. Navigate to Iris settings and enable Iris Text Exercise Chat
  4. Navigate to the settings of text exercise in the course and enable Text Exercise Chat
  5. Navigate to the exercise as a student
  6. See that the Iris button appears and opens the chat window
  7. Talk to Iris, ask for help solving the exercise
  8. Submit some solution
  9. Continue talking to Iris

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.







Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance even for very large courses with more than 2000 students.
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance even for very large courses with more than 2000 students.

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Performance Tests

  • Test 1
  • Test 2

Test Coverage

Screenshots

Summary by CodeRabbit

  • New Features

    • Introduced IrisTextExerciseChatSession for managing chat sessions related to text exercises.
    • Added support for dynamic variant handling in chat settings based on course configurations.
    • Added new DTOs for managing text exercise chat status updates and pipeline executions.
  • Bug Fixes

    • Improved handling of rate limits and access checks for chat sessions.
  • Documentation

    • Enhanced guidelines for database relationships and fetching strategies, emphasizing best practices for lazy fetching.
  • Chores

    • Removed deprecated classes and methods related to the Hestia integration.
    • Updated repository interfaces to reflect new chat session functionalities.
    • Adjusted coverage thresholds in testing configuration.

@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. labels Sep 24, 2024

This comment was marked as outdated.

@github-actions github-actions bot added the stale label Oct 2, 2024
@github-actions github-actions bot removed the stale label Oct 8, 2024
@MichaelOwenDyer MichaelOwenDyer marked this pull request as ready for review October 9, 2024 15:44
@MichaelOwenDyer MichaelOwenDyer requested a review from a team as a code owner October 9, 2024 15:44
@MichaelOwenDyer MichaelOwenDyer changed the base branch from chore/iris/settings-v3 to develop October 9, 2024 15:47
…cise-support

# Conflicts:
#	src/main/java/de/tum/cit/aet/artemis/iris/domain/session/IrisTextExerciseChatSession.java
#	src/main/java/de/tum/cit/aet/artemis/iris/domain/settings/IrisTextExerciseChatSubSettings.java
#	src/main/java/de/tum/cit/aet/artemis/iris/dto/IrisCombinedTextExerciseChatSubSettingsDTO.java
#	src/main/java/de/tum/cit/aet/artemis/iris/repository/IrisTextExerciseChatSessionRepository.java
#	src/main/java/de/tum/cit/aet/artemis/iris/service/IrisSessionService.java
#	src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/PyrisStatusUpdateService.java
#	src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/dto/data/PyrisTextExerciseDTO.java
#	src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/job/TextExerciseChatJob.java
#	src/main/java/de/tum/cit/aet/artemis/iris/service/session/IrisTextExerciseChatSessionService.java
#	src/main/java/de/tum/cit/aet/artemis/iris/service/settings/IrisSubSettingsService.java
#	src/main/java/de/tum/cit/aet/artemis/iris/web/IrisSettingsResource.java
#	src/main/java/de/tum/cit/aet/artemis/iris/web/IrisTextExerciseChatSessionResource.java
#	src/main/java/de/tum/cit/aet/artemis/iris/web/open/PublicPyrisStatusUpdateResource.java
#	src/main/webapp/app/exercises/text/participate/text-editor.component.ts
#	src/test/java/de/tum/cit/aet/artemis/iris/AbstractIrisIntegrationTest.java
#	src/test/java/de/tum/cit/aet/artemis/iris/IrisTextExerciseChatMessageIntegrationTest.java
@github-actions github-actions bot removed core Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module labels Oct 10, 2024
@github-actions github-actions bot added the core Pull requests that affect the corresponding module label Oct 10, 2024
Copy link
Contributor

@kaancayli kaancayli left a comment

Choose a reason for hiding this comment

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

Overall good code. Couple of suggestions

yassinsws
yassinsws previously approved these changes Oct 11, 2024
Copy link
Contributor

@yassinsws yassinsws left a comment

Choose a reason for hiding this comment

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

Coder looks good

kaancayli
kaancayli previously approved these changes Oct 11, 2024
Copy link
Contributor

@kaancayli kaancayli left a comment

Choose a reason for hiding this comment

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

LGTM

@krusche krusche added this to the 7.6.0 milestone Oct 12, 2024
Base automatically changed from chore/iris/settings-v3 to develop October 12, 2024 10:38
@krusche krusche dismissed stale reviews from kaancayli, yassinsws, and coderabbitai[bot] October 12, 2024 10:38

The base branch was changed.

MichaelOwenDyer and others added 7 commits October 12, 2024 13:46
# Conflicts:
#	src/main/java/de/tum/cit/aet/artemis/iris/domain/settings/IrisCourseSettings.java
#	src/main/java/de/tum/cit/aet/artemis/iris/domain/settings/IrisExerciseSettings.java
#	src/main/java/de/tum/cit/aet/artemis/iris/domain/settings/IrisGlobalSettings.java
#	src/main/java/de/tum/cit/aet/artemis/iris/domain/settings/IrisSubSettingsType.java
#	src/main/java/de/tum/cit/aet/artemis/iris/dto/IrisCombinedSettingsDTO.java
#	src/main/java/de/tum/cit/aet/artemis/iris/service/IrisSessionService.java
#	src/main/java/de/tum/cit/aet/artemis/iris/service/settings/IrisSettingsService.java
#	src/main/java/de/tum/cit/aet/artemis/iris/service/settings/IrisSubSettingsService.java
#	src/main/java/de/tum/cit/aet/artemis/iris/web/IrisSettingsResource.java
#	src/main/java/de/tum/cit/aet/artemis/iris/web/IrisVariantsResource.java
#	src/main/webapp/app/entities/iris/settings/iris-settings.model.ts
#	src/main/webapp/app/entities/iris/settings/iris-sub-settings.model.ts
#	src/main/webapp/app/iris/settings/iris-settings-update/iris-settings-update.component.html
#	src/main/webapp/app/iris/settings/iris-settings-update/iris-settings-update.component.ts
#	src/main/webapp/i18n/de/iris.json
#	src/test/java/de/tum/cit/aet/artemis/iris/AbstractIrisIntegrationTest.java
#	src/test/java/de/tum/cit/aet/artemis/iris/settings/IrisSettingsIntegrationTest.java
#	src/test/javascript/spec/component/iris/settings/iris-course-settings-update.component.spec.ts
#	src/test/javascript/spec/component/iris/settings/iris-enabled.component.spec.ts
#	src/test/javascript/spec/component/iris/settings/iris-exercise-settings-update.component.spec.ts
#	src/test/javascript/spec/component/iris/settings/iris-global-settings-update.component.spec.ts
@krusche krusche merged commit ebc28b2 into develop Oct 12, 2024
23 of 28 checks passed
@krusche krusche deleted the feature/iris/add-text-exercise-support branch October 12, 2024 16:15
@krusche krusche changed the title Iris: Add Iris chat in text exercises Iris: Add chat in text exercises Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) core Pull requests that affect the corresponding module database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. iris Pull requests that affect the corresponding module ready for review server Pull requests that update Java code. (Added Automatically!) tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants