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

Programming exercises: Add online IDE settings #8965

Conversation

iyannsch
Copy link
Contributor

@iyannsch iyannsch commented Jul 3, 2024

All Theia PRs must be tested on TS9 otherwise the profile is not active :)

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) 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.
  • I strictly followed the client coding and design guidelines.
  • I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • 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.

Changes affecting Programming Exercises

  • High priority: I tested all changes and their related features with all corresponding user types on a test server configured with the integrated lifecycle setup (LocalVC and LocalCI).
  • I tested all changes and their related features with all corresponding user types on a test server configured with Gitlab and Jenkins.

Motivation and Context

Fixes #8785

For incorporating the online IDE into Artemis, instructors must have the opportunity to

  • Allow the online IDE for an exercise
  • Select a fitting image/configuration for the exercise

Description

I added configuration files to the server containing all available Theia images and their respective programming language. Those are published to the Client via a new API endpoint.

On the client, I enlarged the editing options for a programming exercise from Offline IDE and Online Editor by the new Online IDE for regular exercises - my changes intentionally exclude exam components for now.
Once the Online IDE has been allowed, the user can choose the configuration (image) in the language section. This can happen during creation and modification of an exercise as an instructor should be able to 'hot-swap' the online IDE.

Steps for Testing

For testing on TS9, you can use the following login data:
test_user
test_user

Prerequisites:

  • 1 Instructor
  1. Log in to Artemis
  2. Navigate to your course
  3. Create a new programming exercise
  4. Allow online IDE
  5. Choose an image below and verify that only valid images are shown (Java-17 for Java, C for C, nothing for other)
  6. Verify that an error is properly displayed when no image is selected
  7. Verify that the correct image is loaded again after saving, exiting, and re-entering the edit mode
  8. Verify that the whole online IDE configuration works also in edit mode

Exam Mode Testing

Verify that in exam mode, none of the features are accessible or required.

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
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Test Coverage

Class/File Line Coverage Confirmation (assert/expect)
update-components 94%
update-components/theia 66%
TheiaConfigurationResource 50% Can't write tests for Resources

Screenshots

Activating the Online IDE Setting during exercise creation or modification
image

Selecting a Image/Configuration for the Online IDE based on Language preference
image

Informing the user about an (yet) incompatible language for the online IDE
image

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a configuration for Theia, an external online IDE, including Theia-specific properties and profiles.
    • Added Theia image selection to programming exercises, allowing users to choose an image when enabling online IDE access.
    • Enhanced the user interface to display Theia IDE options in programming exercise configurations.
    • Introduced a new component for managing Theia images in programming exercises.
  • Enhancements

    • Updated validation logic for online IDE selection, ensuring users select a valid Theia image when the feature is enabled.
    • Improved the display of online IDE availability in programming exercise cells and forms.
    • Added conditional rendering for Theia image selection based on configuration settings.
    • Enhanced participation mode validation for programming exercises based on active profiles.
  • Bug Fixes

    • Corrected the display logic in the student actions component to show the "start Theia" button based on profile and configuration settings.
  • Tests

    • Added test cases to validate the new Theia image selection and online IDE functionality in programming exercises.
    • Adjusted existing tests to accommodate the new online IDE properties and configuration.

iyannsch and others added 30 commits June 4, 2024 13:19
…g-exercises/add-online-ide-button-to-exercise-details
…exercise-details' into feature/programming-exercises/add-exercise-wide-online-ide-settings
Solution:

- extend one of our AbtractSpringTest classes so that a Spring server
  providing the dependency injection mechanism is available
- start the superclass with the `theia` profile so that
  `application-theia.yml` is loaded. Note: dependending on what is
  planned or required a different superclass like
  `AbstractSpringIntegrationLocalCILocalVCTest` might be required.
- add a setter method to the configuration class with the two changes
  above the `TheiaConfiguration` can already be detected as injectable,
  but the construction fails with an error message describing that a
  setter method is missing
Copy link
Contributor

@JohannesWt JohannesWt left a comment

Choose a reason for hiding this comment

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

Code reapprove 👍

Copy link
Contributor

@SimonEntholzer SimonEntholzer left a comment

Choose a reason for hiding this comment

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

Works as described 👍

@janthoXO janthoXO added the deploy:artemis-test9 Testserver for Project Theia label Aug 30, 2024
@janthoXO janthoXO temporarily deployed to artemis-test9.artemis.cit.tum.de August 30, 2024 12:30 — with GitHub Actions Inactive
@github-actions github-actions bot added lock:artemis-test9 and removed deploy:artemis-test9 Testserver for Project Theia labels Aug 30, 2024
@iyannsch iyannsch requested a review from a team August 30, 2024 13:52
@bassner bassner changed the title Programming exercise: Add online IDE settings Programming exercises: Add online IDE settings Sep 2, 2024
@bassner bassner merged commit 90bf23b into develop Sep 2, 2024
45 of 49 checks passed
@bassner bassner deleted the feature/programming-exercises/add-exercise-wide-online-ide-settings branch September 2, 2024 09:08
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!) component:Programming config-change Pull requests that change the config in a way that they require a deployment via Ansible. database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. feature ready for review server Pull requests that update Java code. (Added Automatically!) server-api Improves the server API tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Programming Exercise: Add Exercise-Wide Online IDE Settings
10 participants