-
Notifications
You must be signed in to change notification settings - Fork 297
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 button to start online IDE from exercise details
#8697
Programming exercises
: Add button to start online IDE from exercise details
#8697
Conversation
WalkthroughThe changes introduce Theia, an online IDE, to enhance the user interface, particularly for programming exercises. This includes new constants, profile settings, and related functionality in the backend, frontend, and test suites to support launching and integrating Theia as an additional IDE option within Artemis. Changes
Sequence Diagram(s)Diagram: Opening Theia from Exercise DetailssequenceDiagram
participant User
participant Browser
participant ArtemisFrontend
participant ArtemisBackend
User->>Browser: Navigate to Exercise Details
Browser->>ArtemisFrontend: Fetch Exercise Details
ArtemisFrontend->>ArtemisBackend: Retrieve Profile Info
ArtemisBackend-->>ArtemisFrontend: Response with Profile Info (including Theia URL)
ArtemisFrontend-->>User: Render Exercise Details with Theia Button
User->>Browser: Click Theia Button
Browser->>ArtemisFrontend: Request to Open Theia
ArtemisFrontend-->>Browser: Open Theia URL in a New Tab
Assessment against linked issues
Possibly related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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: 11
Outside diff range and nitpick comments (1)
src/main/webapp/app/shared/layouts/profiles/profile.service.ts (1)
Line range hint
97-97
: Use strict equality comparison in TypeScript.- return this.profileInfo.pipe(filter((x) => x != undefined) as OperatorFunction<ProfileInfo | undefined, ProfileInfo>); + return this.profileInfo.pipe(filter((x) => x !== undefined) as OperatorFunction<ProfileInfo | undefined, ProfileInfo>);Using
!==
instead of!=
avoids type coercion and is a best practice in TypeScript.
src/main/webapp/app/overview/exercise-details/exercise-details-student-actions.component.html
Show resolved
Hide resolved
src/main/webapp/app/overview/exercise-details/exercise-details-student-actions.component.ts
Outdated
Show resolved
Hide resolved
src/main/webapp/app/overview/exercise-details/exercise-details-student-actions.component.ts
Show resolved
Hide resolved
src/main/webapp/app/overview/exercise-details/exercise-details-student-actions.component.ts
Outdated
Show resolved
Hide resolved
src/main/webapp/app/overview/exercise-details/exercise-details-student-actions.component.ts
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/in/www1/artemis/service/theia/TheiaInfoContributor.java
Show resolved
Hide resolved
Programming exercises
: Add button to start online IDE from exercise detailsProgramming exercises
: Add button to start online IDE from exercise details
You should check on the client tests, i think you are getting a build failed due to an error in following file and line src/test/javascript/spec/service/profile.service.spec.ts(150,11) |
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.
src/main/webapp/app/overview/exercise-details/exercise-details-student-actions.component.ts
Outdated
Show resolved
Hide resolved
But good work on the rest of the code! |
src/main/java/de/tum/in/www1/artemis/service/theia/TheiaInfoContributor.java
Outdated
Show resolved
Hide resolved
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.
Tested locally, works as expected:
- button visible and points to theia ide (with theia profile)
- Behavior unchanged when theia profile not set
However, I think client tests are not compiling and server tests are failing due to the missed class criteria.
@krusche I removed the future work comments, good point 👍 There also have been some minor config changes proposed by @bassner. |
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: 2
src/main/webapp/app/overview/exercise-details/exercise-details-student-actions.component.ts
Show resolved
Hide resolved
src/main/webapp/app/overview/exercise-details/exercise-details-student-actions.component.ts
Show resolved
Hide resolved
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.
Code re-approve.
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.
re-approve
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.
reapprove after changes on config file, LGTM
We want to rename the clone repository button to "Code" (like it is done on Github e.g.) and then include most buttons in there. We could potentially merge this PR in the mean time, because this button will only be available on test servers configured with the theia profile |
I'll merge this so it is available for testing. @iyannsch, when we merge the buttons into the "Code" dropdown, please ensure to also move this button. |
Note: A special test server with the required
theia
profile and infrastructure is currently in creation.Checklist
General
Server
Client
authorities
to all new routes and checked the course groups for displaying navigation elements (links, buttons).Changes affecting Programming Exercises
Motivation and Context
Fixes #8639 .
The currently existing online code editor in Artemis is a great tool for beginners to jump into programming exercises. However, its functionality is limited for more advanced use cases. In my master's thesis, we implement the online IDE Theia as an alternative way to interact with the Artemis exercise workflow. Student do not have to set up an IDE locally anymore, saving them time and the struggle to configure it to fit their numerous courses. Currently, there is no entry point (or jump-off point) for students to start their Theia Instance from Artemis.
Description
I added a new spring profile
theia
to switch this feature on/off. Without the profile active, no changes are visible.For configuring this (and following) feature, I created a new prefilled configuration file in
resources/config/application-theia.yml
. The values are read and offered to the Client via a newTheiaInfoContributor
.In the Client, all configuration values are read, sanitized, and used to create a extensible button action. In future, the
startOnlineIDE()
function will be enhanced by communication steps between Artemis and Theia.Please note that the functionality described in this PR is not production-ready but is one-of-many PRs that form an overall greater feature.
Steps for Testing
Prerequisites:
theia
profile to your run configuration or use the providedArtemis (Server, LocalVC & LocalCI, Theia)
config.Exam Mode Testing
The proposed changes should not affect the exam mode.
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Review Progress
Performance Review
Code Review
Manual Tests
Exam Mode Test
Test Coverage
Screenshots
Button as visible for a student
Summary by CodeRabbit
New Features
Enhancements
Tests