Artemis
Artemis copied to clipboard
`Programming`: Provide theia clone information on redirect
[!WARNING]
This PR builds on top of #9408 and will reflect any changes done to the endpoint there.
Deploy to TS9 for @Theia profile
Use the artemis_admin
credentials for login.
Checklist
General
- [ ] I tested all changes and their related features with all corresponding user types on a test server.
- [x] This is a small issue that I tested locally and was confirmed by another developer on a test server.
- [x] Language: I followed the guidelines for inclusive, diversity-sensitive, and appreciative language.
- [x] I chose a title conforming to the naming conventions for pull requests.
Server
- [x] Important: I implemented the changes with a very good performance and prevented too many (unnecessary) and too complex database calls.
- [x] I strictly followed the principle of data economy for all database calls.
- [x] I strictly followed the server coding and design guidelines.
- [x] I added multiple integration tests (Spring) related to the features (with a high test coverage).
- [x] I added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
- [x] I documented the Java code using JavaDoc style.
Client
- [x] 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).
- [x] I strictly followed the principle of data economy for all client-server REST calls.
- [x] I strictly followed the client coding and design guidelines.
- [x] 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.
- [x] 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). - [x] I documented the TypeScript code using JSDoc style.
- [ ] I added multiple screenshots/screencasts of my UI changes.
- [x] I translated all newly inserted strings into English and German.
Changes affecting Programming Exercises
- [x] 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
The Theia User-Flow aims to integrate seamlessly into the existing Artemis exercise flow. When users click on the Open Online IDE button, we want to require as few clicks as possible before the exercise can be worked. In https://github.com/ls1intum/Artemis/issues/8723, we defined that no further login should be required - at least for working with the repository. In separate repositories, I already implemented the Theia LandingPage which can accept the git clone token for the user and instantly spawn a new session with the repo cloned using the token.
Fixes #9357
Description
This PR clears up the UI, moving the Open in Online IDE
button into the existing <Code>
button. Catering to the required data-sharing, the user's clone token, the user's exercise repo, and the configured Theia Settings are passed to the Landing Page.
Steps for Testing
Prerequisites:
- 1 Instructor
- Create a ProgrammingExercise with enabled online IDE and selected online IDE image. You might want to choose Java17 for simplicity.
- Open the exercise in the student view.
- Verify that the
Code
button contains theOpen Online IDE
button. - Verify that on-click a new tab opens and contains the correct parameters as query params (in the URL)
-
appDef
should match your selected Image -
gitUri
should match your clone URL and the git token -
artemisToken
should be existent but you don't have to verify that
Here, you can see a screenshot highlighting the relevant parts.
Exam Mode Testing
Make sure that none of that functionality is visible in the Exam Mode.
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
Class/File | Line Coverage | Confirmation (assert/expect) |
---|---|---|
app/shared/components/code-button | 95% | ✅ |
Screenshots
Summary by CodeRabbit
Release Notes
-
New Features
- Added a method to exchange cookies for bearer tokens for user authentication.
- Introduced a new token generation method that allows for additional claims and enhanced validity control.
- Enhanced JWT extraction and validation to support both cookie and Authorization header.
- Added functionality to generate a new token and return it as both a cookie and bearer token.
- Simplified WebSocket handshake process by directly extracting and validating JWT from requests.
- Integrated support for the Theia online IDE, including checks for configuration and enabling the IDE based on exercise properties.
-
Bug Fixes
- Removed deprecated functionality related to the Theia online IDE, simplifying the user interface.
-
Tests
- Enhanced testing coverage for new authentication features.