Skip to content

Conversation

@Elfari1028
Copy link
Contributor

@Elfari1028 Elfari1028 commented Nov 25, 2025

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 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 guidelines.
  • I strictly followed the AET UI-UX 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 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 LocalVC and Jenkins*.

Motivation and Context

While iterating on Problem Statement, Template, Solution, Test and Auxiliary repositories of Programming Exercises, multilple people could be editing them at the same time, often resulting in one overwriting someone else's changes, causing data loss and delays in work.

This PR introduces a basic synchronization notification:

  • When there are multiple instances of client, using online code editor at the same to edit repositories/problem statement:
    • If one person saves their changes, other browser windows with the same repository open would receive a notification, prompting them to refresh the files.

Description

Server

  • Added new ProgrammingExerciseEditorSyncService: handles Websocket connection to clients, and with one public method broadcastChange to send messages to all clients currently subscribed to /topic/programming-exercises/{exerciseId}/synchronization with ProgrammingExerciseEditorSyncEventDTO

  • ExerciseVersionService now has one more step after an ExerciseVersion has been logged: calls determineSynchronizationForActiveEditors to determine whether a synchronization notification should be sent to clients.

  • ExerciseVersionService broadcasts changes when: 1. Problem statement is different from previous version 2. Template/Solution/Tests/Auxiliary repository has a new commit

Since it is possible in online editor to save file without committing it, addtional synchronization notification is needed when files changes without commit:

  • AuxiliaryRepositoryResource, RepositoryProgrammingExerciseParticipationResource, TestRepositoryResource now broadcast changes when put, post, delete requests are made. Additionally, RepositoryProgrammingExerciseParticipationResource only broadcast changes when it's a Solution/Template repository

Client

  • Created ProgrammingExerciseEditorSyncService to manage websocket subscription for code-editor-instructor-and-editor-container.component.ts
  • CodeEditorInstructorBaseContainerComponent now opens a websocket subcription to receive messages notifying them about other user's changes.
  • When receiving a message with ProgrammingExerciseEditorSyncTarget being problem_statement, regardless of which repository is being viewed, a notification will notify user to refresh the page
  • When receiving a message with ProgrammingExerciseEditorSyncTarget being a repository type, the code will compare it with currently selected repository, a notification will notify user to refresh the page if the edit was made on the same repository
  • Browser who saved the change will not receive a notification about their own edit

Steps for Testing

Prerequisites:

  • 1 Instructor

Deploy on test server:

Follow these steps on two different browsers, or tabs, or different users (etc.)

  1. Log in to Artemis
  2. Navigate to Course Administration
  3. Navigate to a Course Management of a course
image
  1. Navigate to a Programming Exercise manage page, and click "Edit in Editor"
image

Path 1:
1: Add some changes in Problem Statement and click "Submit", notice in the other browser tab you receive a notification reading "This repository was updated in another session. Refresh the files to sync the changes."

You can do this after selecting " Template" repository for one browser and "Solution" for another browser and notice the same notification

image

Path 2:

  1. Select the same repository for both browser's code editor

a. Do one of these actions: Create file, rename file, delete file.

OR b. edit a file by adding some lines (and wait for 30 seconds for autosave to be triggerred)

c. Click "Submit" to commit the changes

  1. notice the Notification in the other browser reads: "This repository was updated in another session. Refresh the files to sync the changes."
image

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

  • 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

image image

Summary by CodeRabbit

  • New Features
    • Real-time editor synchronization via WebSocket with fine-grained targets (template, solution, tests, auxiliary repositories, problem statement); same-client updates are ignored and other-session changes trigger user warnings in the editor.
  • Tests
    • Extensive unit and integration tests covering broadcast behavior, subscription lifecycle, and various repository actions.
  • Documentation
    • Added localization strings for synchronization alerts (English and German).

✏️ Tip: You can customize this high-level summary in your review settings.

…e active client saves changes to Problem Statement and Tests/Solution/Template/Auxiliary repositories.
@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Nov 25, 2025
@github-actions github-actions bot added the tests label Nov 25, 2025
@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) exercise Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module labels Nov 25, 2025
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report215 ran209 passed3 skipped3 failed1h 18m 23s 833ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/atlas/CompetencyManagement.spec.ts
ts.Competency Management › Creates a competency❌ failure2m 4s 57ms
ts.Prerequisite Management › Creates a prerequisite❌ failure2m 4s 155ms
ts.Prerequisite Management › Prerequisite editing › Edits a prerequisite❌ failure2m 4s 707ms

@Elfari1028 Elfari1028 changed the title Feature/exercise synchronization/notify active editors when new changes are saved Programming Exercise: Notify active editors when new changes are saved by another user Nov 26, 2025
@Elfari1028 Elfari1028 changed the title Programming Exercise: Notify active editors when new changes are saved by another user Programming exercises: Notify active editors when new changes are saved by another user Nov 26, 2025
wasnertobias
wasnertobias previously approved these changes Nov 27, 2025
Copy link
Member

@wasnertobias wasnertobias left a comment

Choose a reason for hiding this comment

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

reviewed code and functionality in person - comments added by yourself. (Small changes left => Afterwards looks good to me!)

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ✅Skipped ⚠️FailedTime ⏱
End-to-End (E2E) Test Report215 ran212 passed3 skipped0 failed1h 5m 11s 106ms
TestResultTime ⏱
No test annotations available

Elfari1028 and others added 3 commits November 27, 2025 14:07
…ses to better reflect their purpose for editor synchronization
…when-new-changes-are-saved' of github.com:ls1intum/Artemis into feature/exercise-synchronization/notify-active-editors-when-new-changes-are-saved
coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 27, 2025
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report215 ran211 passed3 skipped1 failed1h 6m 50s 86ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/programming/ProgrammingExerciseParticipation.spec.ts
ts.Programming exercise participation › Programming exercise team participation › Check team participation › Instructor checks the participation❌ failure8s 733ms

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report215 ran210 passed3 skipped2 failed1h 12m 52s 442ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/programming/ProgrammingExerciseParticipation.spec.ts
ts.Programming exercise participation › Programming exercise team participation › Check team participation › Instructor checks the participation❌ failure7s 960ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure2m 38s 446ms

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report215 ran210 passed3 skipped2 failed1h 9m 39s 548ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/quiz-exercise/QuizExerciseParticipation.spec.ts
ts.Quiz Exercise Participation › DnD Quiz participation › Student can participate in DnD Quiz❌ failure2m 4s 760ms
e2e/exercise/programming/ProgrammingExerciseParticipation.spec.ts
ts.Programming exercise participation › Programming exercise team participation › Check team participation › Instructor checks the participation❌ failure8s 63ms

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report218 ran214 passed3 skipped1 failed1h 1m 3s 511ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/programming/ProgrammingExerciseParticipation.spec.ts
ts.Programming exercise participation › Programming exercise team participation › Check team participation › Instructor checks the participation❌ failure8s 694ms

@helios-aet helios-aet bot temporarily deployed to artemis-test6.artemis.cit.tum.de November 28, 2025 21:38 Inactive
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report218 ran213 passed3 skipped2 failed1h 12m 13s 717ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/programming/ProgrammingExerciseParticipation.spec.ts
ts.Programming exercise participation › Programming exercise team participation › Check team participation › Instructor checks the participation❌ failure7s 800ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure2m 41s 823ms

@Elfari1028 Elfari1028 marked this pull request as ready for review November 29, 2025 13:50
@Elfari1028 Elfari1028 requested review from a team and krusche as code owners November 29, 2025 13:50
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 29, 2025

Walkthrough

Adds real-time editor synchronization: new sync domain types and DTOs, a backend WebSocket broadcasting service, wiring of broadcasts into exercise-version creation and repository operations, a frontend WebSocket subscription service with client-instance filtering and user alerts, plus tests and i18n strings.

Changes

Cohort / File(s) Summary
Core Sync Domain & DTOs
src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingExerciseEditorSyncTarget.java, src/main/java/de/tum/cit/aet/artemis/programming/dto/ProgrammingExerciseEditorSyncEventDTO.java
Add enum ProgrammingExerciseEditorSyncTarget (PROBLEM_STATEMENT, TEMPLATE_REPOSITORY, SOLUTION_REPOSITORY, TESTS_REPOSITORY, AUXILIARY_REPOSITORY) and record ProgrammingExerciseEditorSyncEventDTO(target, @nullableLong auxiliaryRepositoryId,@nullable String clientInstanceId) with JSON non-empty inclusion.
Backend Sync Service
src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseEditorSyncService.java
New Spring service that composes sync topics, reads client-instance header, and broadcasts ProgrammingExerciseEditorSyncEventDTO to a WebSocket topic; logs publish failures and uses non-blocking sends.
Exercise Version Integration
src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java
Constructor now accepts ProgrammingExerciseEditorSyncService; adds logic to compare previous and new programming snapshots and call broadcastChange for the affected sync target when creating a new ExerciseVersion.
Repository Resource Base & Subclasses
src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryResource.java, .../TestRepositoryResource.java, .../AuxiliaryRepositoryResource.java, .../RepositoryProgrammingExerciseParticipationResource.java
Inject ProgrammingExerciseEditorSyncService; add broadcast helper methods; trigger broadcasts after createFile/createFolder/renameFile/deleteFile/resetToLastCommit and in specific updateFiles flows (commit=false with submissions) using the appropriate sync target and optional auxiliaryRepositoryId.
Frontend Sync Service
src/main/webapp/app/programming/manage/services/programming-exercise-editor-sync.service.ts, .../programming-exercise-editor-sync.service.spec.ts
New Angular service and tests: per-exercise STOMP/WebSocket subscriptions, Subjects, and forwarding of typed sync messages; public APIs getSynchronizationUpdates(exerciseId) and unsubscribeFromExercise(exerciseId); lifecycle cleanup.
Frontend Code Editor Integration & Tests
src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-base-container.component.ts, .../code-editor-instructor-and-editor-container.componente.spec.ts
Subscribe to sync updates, ignore messages from same client instance, determine relevance (template/solution/tests/auxiliary/problem statement), and show translated alerts for relevant remote changes; tests added for alert behavior.
Internationalization
src/main/webapp/i18n/en/editor.json, src/main/webapp/i18n/de/editor.json
Add editor.refresh.synchronization.repositoryChanged and editor.refresh.synchronization.problemStatementChanged translation keys.
Backend Tests
src/test/java/.../AuxiliaryRepositoryResourceIntegrationTest.java, .../RepositoryIntegrationTest.java, .../TestRepositoryResourceIntegrationTest.java, .../service/ProgrammingExerciseEditorSyncServiceTest.java
Add/extend tests asserting WebSocket broadcasts for repository and exercise-version operations; verify topics and payloads (target, auxiliaryRepositoryId) and non-broadcasting scenarios.

Sequence Diagram(s)

sequenceDiagram
    participant FE-A as Frontend (Editor A)
    participant Backend as HTTP API
    participant RepoSvc as Repository/ExerciseVersion logic
    participant SyncSvc as ProgrammingExerciseEditorSyncService
    participant WS as WebSocket Broker
    participant FE-B as Frontend (Editor B)

    FE-A->>Backend: HTTP modify repo/commit/version
    Backend->>RepoSvc: persist change / create version
    RepoSvc->>RepoSvc: determine changed sync target(s)
    RepoSvc->>SyncSvc: broadcastChange(exerciseId, target, auxId?)
    SyncSvc->>WS: send ProgrammingExerciseEditorSyncEventDTO(topic)
    WS->>FE-B: deliver sync message
    FE-B->>FE-B: ignore if same client-instance
    alt relevant change
        FE-B->>FE-B: show localized alert (repositoryChanged / problemStatementChanged)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Focus review on:
    • ExerciseVersionService change-detection logic and prioritization across multiple repository targets.
    • Correct mapping of repository operations to sync targets in RepositoryResource and subclasses.
    • WebSocket topic composition, client-instance header handling, and non-blocking error handling in ProgrammingExerciseEditorSyncService.
    • Frontend subscription lifecycle, unsubscribe semantics, and client-instance filtering in the Angular service and component.
    • Tests that capture and assert the broadcast DTO and topic (ArgumentCaptor usage and topic verification).

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.73% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: notifying active editors when new programming exercise changes are saved by another user, which aligns with the comprehensive server and client-side synchronization implementation.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/exercise-synchronization/notify-active-editors-when-new-changes-are-saved

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22a9401 and 3a8dc0d.

📒 Files selected for processing (1)
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.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). (11)
  • GitHub Check: server-tests
  • GitHub Check: client-tests
  • GitHub Check: server-style
  • GitHub Check: client-style
  • GitHub Check: client-tests-selected
  • 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: Codacy Static Code Analysis
  • GitHub Check: bean-instantiation-check
  • GitHub Check: Analyse

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (4)
src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java (1)

295-315: Consider using clearInvocations instead of reset on the WebSocket spy (optional)

For the websocketMessagingService spy, you only need to clear previous interactions before the never() verification. reset(websocketMessagingService) also clears any stubbing on that bean, which can be surprising in more complex tests.

If you don’t rely on any stubbing, this is harmless; otherwise, prefer:

-        reset(websocketMessagingService);
+        clearInvocations(websocketMessagingService);

This keeps existing behavior but avoids unintentionally dropping stubs on the spy.

src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingExerciseEditorSyncTarget.java (1)

3-8: Enum definition is appropriate; @JsonInclude is redundant (optional)

The ProgrammingExerciseEditorSyncTarget enum cleanly covers all synchronization targets used across backend and frontend.

The @JsonInclude(JsonInclude.Include.NON_EMPTY) on the enum itself is not needed (Jackson won’t serialize “empty” enums), but it doesn’t cause harm. You can remove it for clarity if you prefer:

-import com.fasterxml.jackson.annotation.JsonInclude;
-
-@JsonInclude(JsonInclude.Include.NON_EMPTY)
 public enum ProgrammingExerciseEditorSyncTarget {
     PROBLEM_STATEMENT, TEMPLATE_REPOSITORY, SOLUTION_REPOSITORY, TESTS_REPOSITORY, AUXILIARY_REPOSITORY
 }
src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java (1)

166-212: Consider documenting the prioritization behavior.

The method uses a prioritized if-else chain (template → solution → tests → auxiliary → problem statement) that broadcasts only the first detected change. If multiple repositories are modified in a single version, only one notification is sent. Consider adding a JavaDoc comment explaining this prioritization to help future maintainers understand the intended behavior.

Example:

 /**
  * Compare two exercise snapshots and return the change that should be broadcast to clients.
+ * If multiple changes are detected, only the highest-priority change is broadcast:
+ * 1. Template Repository
+ * 2. Solution Repository
+ * 3. Tests Repository
+ * 4. Auxiliary Repositories
+ * 5. Problem Statement
  *
  * @param exerciseId       the exercise id
  * @param newSnapshot      the new snapshot
  * @param previousSnapshot the previous snapshot (optional)
  */
 private void determineSynchronizationForActiveEditors(Long exerciseId, ExerciseSnapshotDTO newSnapshot, ExerciseSnapshotDTO previousSnapshot) {
src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-base-container.component.ts (1)

206-232: Consider user experience implications of non-dismissible alerts.

The alerts use timeout: 0, meaning they never auto-dismiss. If multiple rapid changes occur from other editors, users could be overwhelmed with persistent alerts. Consider either:

  1. Using a reasonable timeout (e.g., 10000ms)
  2. Implementing alert deduplication
  3. Using a less intrusive notification mechanism for frequent updates

Example with timeout:

         if (problemStatementChanged) {
             this.alertService.addAlert({
                 type: AlertType.WARNING,
                 message: 'artemisApp.editor.synchronization.problemStatementChanged',
-                timeout: 0,
+                timeout: 10000,
             });
         }
         if (repositoryChanged) {
             this.alertService.addAlert({
                 type: AlertType.WARNING,
                 message: 'artemisApp.editor.synchronization.repositoryChanged',
-                timeout: 0,
+                timeout: 10000,
             });
         }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2ec81a6 and 52b92f6.

⛔ Files ignored due to path filters (2)
  • .github/workflows/bean-instantiations.yml is excluded by !**/*.yml
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (18)
  • src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java (6 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingExerciseEditorSyncTarget.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/dto/ProgrammingExerciseEditorSyncEventDTO.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseEditorSyncService.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/AuxiliaryRepositoryResource.java (5 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java (10 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryResource.java (3 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/TestRepositoryResource.java (5 hunks)
  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts (5 hunks)
  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-base-container.component.ts (5 hunks)
  • src/main/webapp/app/programming/manage/services/programming-exercise-editor-sync.service.spec.ts (1 hunks)
  • src/main/webapp/app/programming/manage/services/programming-exercise-editor-sync.service.ts (1 hunks)
  • src/main/webapp/i18n/de/editor.json (1 hunks)
  • src/main/webapp/i18n/en/editor.json (1 hunks)
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java (4 hunks)
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java (10 hunks)
  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java (8 hunks)
  • src/test/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseEditorSyncServiceTest.java (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
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/programming/service/ProgrammingExerciseEditorSyncServiceTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
src/main/webapp/**/*.ts

⚙️ CodeRabbit configuration file

angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

Files:

  • src/main/webapp/app/programming/manage/services/programming-exercise-editor-sync.service.spec.ts
  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-base-container.component.ts
  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
  • src/main/webapp/app/programming/manage/services/programming-exercise-editor-sync.service.ts
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/programming/web/repository/RepositoryResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/AuxiliaryRepositoryResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/dto/ProgrammingExerciseEditorSyncEventDTO.java
  • src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingExerciseEditorSyncTarget.java
  • src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseEditorSyncService.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/TestRepositoryResource.java
  • src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java
src/main/webapp/i18n/de/**/*.json

⚙️ CodeRabbit configuration file

German language translations should be informal (dutzen) and should never be formal (sietzen). So the user should always be addressed with "du/dein" and never with "sie/ihr".

Files:

  • src/main/webapp/i18n/de/editor.json
🧠 Learnings (53)
📚 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/programming/service/ProgrammingExerciseEditorSyncServiceTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/AuxiliaryRepositoryResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/dto/ProgrammingExerciseEditorSyncEventDTO.java
  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingExerciseEditorSyncTarget.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/TestRepositoryResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.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/programming/service/ProgrammingExerciseEditorSyncServiceTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 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/programming/service/ProgrammingExerciseEditorSyncServiceTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 Learning: 2025-08-11T13:22:05.140Z
Learnt from: Wallenstein61
Repo: ls1intum/Artemis PR: 10989
File: src/test/java/de/tum/cit/aet/artemis/programming/service/sharing/ExerciseSharingResourceImportTest.java:128-131
Timestamp: 2025-08-11T13:22:05.140Z
Learning: In the ExerciseSharingResourceImportTest class in Artemis, mockServer.verify() is not needed in the tearDown method as the test design doesn't require strict verification of all mocked HTTP expectations. The mockServer field is managed differently in this test class.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseEditorSyncServiceTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 Learning: 2025-10-22T21:31:54.240Z
Learnt from: Elfari1028
Repo: ls1intum/Artemis PR: 11491
File: src/main/java/de/tum/cit/aet/artemis/exercise/web/ExerciseResource.java:376-378
Timestamp: 2025-10-22T21:31:54.240Z
Learning: In Artemis, ExerciseVersionService.createExerciseVersion(...) (src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java) eagerly re-fetches the target exercise (via type-specific findForVersioningById) before building the ExerciseSnapshotDTO. Controllers (e.g., ExerciseResource.toggleSecondCorrectionEnabled) do not need to reload the exercise before invoking createExerciseVersion.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseEditorSyncServiceTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/AuxiliaryRepositoryResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/dto/ProgrammingExerciseEditorSyncEventDTO.java
  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseEditorSyncService.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/TestRepositoryResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java
📚 Learning: 2025-09-01T10:20:40.706Z
Learnt from: Michael-Breu-UIbk
Repo: ls1intum/Artemis PR: 10989
File: src/main/webapp/app/programming/manage/detail/programming-exercise-detail.component.with-sharing.spec.ts:132-149
Timestamp: 2025-09-01T10:20:40.706Z
Learning: In the Artemis codebase, Angular component test files for ProgrammingExerciseDetailComponent follow a pattern where the component is imported but not explicitly declared in TestBed.configureTestingModule(), yet TestBed.createComponent() still works successfully. This pattern is consistently used across test files like programming-exercise-detail.component.spec.ts and programming-exercise-detail.component.with-sharing.spec.ts.

Applied to files:

  • src/main/webapp/app/programming/manage/services/programming-exercise-editor-sync.service.spec.ts
  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2024-10-13T12:03:02.430Z
Learnt from: pzdr7
Repo: ls1intum/Artemis PR: 9463
File: src/test/javascript/spec/component/shared/monaco-editor/monaco-editor.service.spec.ts:50-55
Timestamp: 2024-10-13T12:03:02.430Z
Learning: In `src/test/javascript/spec/component/shared/monaco-editor/monaco-editor.service.spec.ts`, when a function is called multiple times in a test, use `toHaveBeenCalledTimes` and `toHaveBeenNthCalledWith` assertions instead of `toHaveBeenCalledExactlyOnceWith`.

Applied to files:

  • src/main/webapp/app/programming/manage/services/programming-exercise-editor-sync.service.spec.ts
  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2024-10-20T22:00:52.335Z
Learnt from: pzdr7
Repo: ls1intum/Artemis PR: 9505
File: src/test/javascript/spec/integration/code-editor/code-editor-container.integration.spec.ts:179-181
Timestamp: 2024-10-20T22:00:52.335Z
Learning: In `src/test/javascript/spec/integration/code-editor/code-editor-container.integration.spec.ts`, `ResizeObserver` is mocked within the `beforeEach` block.

Applied to files:

  • src/main/webapp/app/programming/manage/services/programming-exercise-editor-sync.service.spec.ts
  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2025-06-15T13:49:43.096Z
Learnt from: ahmetsenturk
Repo: ls1intum/Artemis PR: 10916
File: src/main/java/de/tum/cit/aet/artemis/atlas/web/LearnerProfileResource.java:36-41
Timestamp: 2025-06-15T13:49:43.096Z
Learning: In the Artemis codebase, the development team has decided to allow direct injection of repositories into REST resources rather than always delegating to service layers. This architectural decision was communicated and decided with peer developers.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/AuxiliaryRepositoryResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/TestRepositoryResource.java
📚 Learning: 2025-08-19T09:13:51.235Z
Learnt from: ekayandan
Repo: ls1intum/Artemis PR: 11027
File: src/main/java/de/tum/cit/aet/artemis/programming/service/GitArchiveHelper.java:0-0
Timestamp: 2025-08-19T09:13:51.235Z
Learning: The domain Repository class (de.tum.cit.aet.artemis.programming.domain.Repository) extends JGit's FileRepository, making it polymorphically compatible with JGit APIs while providing additional Artemis-specific methods like getParticipation() and getLocalPath().

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/AuxiliaryRepositoryResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/TestRepositoryResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 Learning: 2025-02-11T12:05:49.151Z
Learnt from: janthoXO
Repo: ls1intum/Artemis PR: 9406
File: src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseParticipationResource.java:209-209
Timestamp: 2025-02-11T12:05:49.151Z
Learning: In ProgrammingExerciseParticipationResource, exam-related authorization checks and sensitive information filtering for results and feedbacks are handled by resultService.filterSensitiveInformationIfNecessary().

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/TestRepositoryResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 Learning: 2025-08-08T08:50:28.791Z
Learnt from: tobias-lippert
Repo: ls1intum/Artemis PR: 11248
File: src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseParticipationService.java:401-402
Timestamp: 2025-08-08T08:50:28.791Z
Learning: In src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseParticipationService.java, method findStudentParticipationWithLatestSubmissionResultAndFeedbacksElseThrow(long), using List.of() for latestSubmission.setResults(...) is acceptable because the results list is not mutated afterward and is only returned to the client; no follow-up code appends to it.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 Learning: 2024-07-17T12:13:45.428Z
Learnt from: SimonEntholzer
Repo: ls1intum/Artemis PR: 8929
File: src/main/java/de/tum/in/www1/artemis/repository/ParticipationVCSAccessTokenRepository.java:27-29
Timestamp: 2024-07-17T12:13:45.428Z
Learning: The method naming convention `deleteByParticipation_id` in `ParticipationVCSAccessTokenRepository.java` is necessary due to specific framework or library constraints in the Artemis project.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
📚 Learning: 2025-09-15T11:18:26.439Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11378
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java:13-16
Timestamp: 2025-09-15T11:18:26.439Z
Learning: In ExamRoomDistributionService.distributeRegisteredStudents method in src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java, the team has decided not to use Transactional annotation despite multiple repository operations, based on human reviewer consultation.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
📚 Learning: 2025-02-06T17:24:13.928Z
Learnt from: magaupp
Repo: ls1intum/Artemis PR: 10265
File: src/main/resources/templates/dart/exercise/lib/bubble_sort.dart:1-1
Timestamp: 2025-02-06T17:24:13.928Z
Learning: In programming exercise template files (e.g., src/main/resources/templates/dart/exercise/*), implementations should be left empty or incomplete as they are meant to be completed by students as part of the exercise.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 Learning: 2024-10-08T15:35:42.972Z
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.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java
📚 Learning: 2025-06-10T12:26:42.449Z
Learnt from: Wallenstein61
Repo: ls1intum/Artemis PR: 10989
File: src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseImportFromFileService.java:108-117
Timestamp: 2025-06-10T12:26:42.449Z
Learning: In ProgrammingExerciseImportFromFileService, the current directory traversal logic for sharing imports (walking importExerciseDir before extraction) is working correctly in practice and should not be changed to more complex solutions, even if there are theoretical issues with the approach.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 Learning: 2025-08-27T09:46:36.480Z
Learnt from: ekayandan
Repo: ls1intum/Artemis PR: 11027
File: src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java:1839-1839
Timestamp: 2025-08-27T09:46:36.480Z
Learning: In the Artemis codebase, when stubbing GitService.getBareRepository() in tests, it's valid to return a JGit Repository (org.eclipse.jgit.lib.Repository) even though the method signature returns the domain Repository (de.tum.cit.aet.artemis.programming.domain.Repository), because the domain Repository extends JGit's FileRepository, making them polymorphically compatible.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/AuxiliaryRepositoryResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/TestRepositoryResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 Learning: 2024-10-27T11:50:42.955Z
Learnt from: bensofficial
Repo: ls1intum/Artemis PR: 9608
File: src/main/java/de/tum/cit/aet/artemis/programming/service/gitlabci/GitLabCIService.java:202-203
Timestamp: 2024-10-27T11:50:42.955Z
Learning: In `src/main/java/de/tum/cit/aet/artemis/programming/service/gitlabci/GitLabCIService.java`, exception messages are used internally, and minor inconsistencies are acceptable due to performance considerations.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
📚 Learning: 2025-05-11T22:58:13.489Z
Learnt from: theblobinthesky
Repo: ls1intum/Artemis PR: 10581
File: src/main/webapp/app/exercise/import/from-file/exercise-import-from-file.component.ts:57-60
Timestamp: 2025-05-11T22:58:13.489Z
Learning: The ProgrammingExerciseBuildConfig constructor initializes all fields with default values, including new fields like allowBranching (false) and branchRegex ('.*'), so explicit handling of these fields isn't needed when importing old exercise configurations.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
📚 Learning: 2025-08-26T14:21:27.867Z
Learnt from: tobias-lippert
Repo: ls1intum/Artemis PR: 11318
File: src/main/java/de/tum/cit/aet/artemis/exercise/web/ParticipationResource.java:548-549
Timestamp: 2025-08-26T14:21:27.867Z
Learning: The countPresentationScoresForParticipant method in StudentParticipationRepository handles both individual student IDs and team IDs correctly in a single query. When a team ID is passed as the participant ID, the query uses JOIN logic to count presentation scores for team members, so no special branching logic is needed in the calling code.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
📚 Learning: 2025-08-26T14:21:27.867Z
Learnt from: tobias-lippert
Repo: ls1intum/Artemis PR: 11318
File: src/main/java/de/tum/cit/aet/artemis/exercise/web/ParticipationResource.java:548-549
Timestamp: 2025-08-26T14:21:27.867Z
Learning: The countPresentationScoresForParticipant method in StudentParticipationRepository uses a LEFT JOIN with team.students and an OR condition (p.student.id = :participantId OR ts.id = :participantId) to correctly handle both individual and team participations in a single query. The method properly counts presentation scores for both participation types without requiring additional branching logic in the calling code.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
📚 Learning: 2025-08-26T13:23:05.331Z
Learnt from: tobias-lippert
Repo: ls1intum/Artemis PR: 11318
File: src/main/java/de/tum/cit/aet/artemis/exercise/web/ParticipationResource.java:549-552
Timestamp: 2025-08-26T13:23:05.331Z
Learning: The method findGradeScoresForAllExercisesForCourseAndStudent in StudentParticipationRepository handles both individual and team exercises by combining results from separate queries for individual grades, individual quiz grades, and team grades.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 Learning: 2025-06-17T12:31:09.178Z
Learnt from: jfr2102
Repo: ls1intum/Artemis PR: 10983
File: src/main/java/de/tum/cit/aet/artemis/exercise/repository/StudentParticipationRepository.java:110-126
Timestamp: 2025-06-17T12:31:09.178Z
Learning: The query `findByExamIdWithEagerLatestLegalSubmissionsRatedResultAndIgnoreTestRunParticipation` in StudentParticipationRepository fetches all rated results (not just the latest) because the second correction round feature requires access to multiple assessment results per submission for proper correction round management.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/test/java/de/tum/in/www1/artemis/exam/StudentExamIntegrationTest.java:988-993
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `testSubmitStudentExam_differentUser` method does not require additional checks to verify the state of `studentExam1` after receiving a `HttpStatus.FORBIDDEN` because the control flow in the `StudentExamResource` is straightforward and ensures no state change occurs.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8597
File: src/main/webapp/app/exercises/programming/manage/repositories-checkout-directories-dto.ts:8-8
Timestamp: 2024-06-10T19:44:09.116Z
Learning: DTOs are typically defined in the `src/main/webapp/app/entities` folder on the client side in the Artemis project.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/dto/ProgrammingExerciseEditorSyncEventDTO.java
📚 Learning: 2024-10-08T15:35:42.972Z
Learnt from: JohannesStoehr
Repo: ls1intum/Artemis PR: 8679
File: src/main/java/de/tum/in/www1/artemis/web/rest/tutorialgroups/TutorialGroupSessionResource.java:37-37
Timestamp: 2024-10-08T15:35:42.972Z
Learning: The DTOs `CompetencyProgressForLearningPathDTO`, `ProgrammingExerciseResetOptionsDTO`, and `CourseWithIdDTO` do not contain nullable values or `Optional` types, making the `JsonInclude` annotation unnecessary for them.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/dto/ProgrammingExerciseEditorSyncEventDTO.java
📚 Learning: 2025-08-10T18:33:22.476Z
Learnt from: Wallenstein61
Repo: ls1intum/Artemis PR: 10989
File: src/test/java/de/tum/cit/aet/artemis/programming/AbstractProgrammingIntegrationLocalCILocalVCTest.java:3-9
Timestamp: 2025-08-10T18:33:22.476Z
Learning: In the Artemis test framework, `MockitoBean` from `org.springframework.test.context.bean.override.mockito` is the standard annotation used for mocking beans in test classes, not `MockBean`. This is used consistently across test base classes like `AbstractProgrammingIntegrationLocalCILocalVCTest`, `AbstractSpringIntegrationIndependentTest`, and `AbstractSpringIntegrationLocalVCSamlTest`. The project also uses `MockitoSpyBean` from the same package.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 Learning: 2024-10-08T18:07:58.425Z
Learnt from: iyannsch
Repo: ls1intum/Artemis PR: 9379
File: src/main/webapp/app/shared/components/code-button/code-button.component.ts:364-372
Timestamp: 2024-10-08T18:07:58.425Z
Learning: In the `initTheia` method of `CodeButtonComponent` (`code-button.component.ts`), removing the null check for `this.exercise` inside the `subscribe` callback causes a compile-time error, so it should be kept.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-base-container.component.ts
📚 Learning: 2024-10-29T12:28:57.305Z
Learnt from: SimonEntholzer
Repo: ls1intum/Artemis PR: 9478
File: src/main/webapp/app/shared/user-settings/ssh-settings/details/ssh-user-settings-key-details.component.ts:104-111
Timestamp: 2024-10-29T12:28:57.305Z
Learning: In `ssh-user-settings-key-details.component.ts`, changing the error handling code by adding optional chaining (`?.`) and replacing `.indexOf()` with `.includes()` may alter semantics and should be avoided.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-base-container.component.ts
📚 Learning: 2024-10-08T15:35:52.595Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8597
File: src/main/webapp/app/exercises/programming/shared/build-details/programming-exercise-repository-and-build-plan-details.component.ts:52-59
Timestamp: 2024-10-08T15:35:52.595Z
Learning: When handling errors in Angular components, ensure to integrate with the alert service for consistent error display across the application.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-base-container.component.ts
  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2025-02-11T15:46:35.616Z
Learnt from: Wallenstein61
Repo: ls1intum/Artemis PR: 9909
File: src/main/webapp/app/sharing/search-result-dto.model.ts:50-55
Timestamp: 2025-02-11T15:46:35.616Z
Learning: The `IExerciseType` enum in `src/main/webapp/app/sharing/search-result-dto.model.ts` must maintain its current naming (with 'I' prefix) and lowercase string values to ensure compatibility with the external sharing platform connector interface. This is an intentional exception to our TypeScript naming conventions.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-base-container.component.ts
  • src/main/webapp/app/programming/manage/services/programming-exercise-editor-sync.service.ts
📚 Learning: 2024-10-20T21:59:11.630Z
Learnt from: pzdr7
Repo: ls1intum/Artemis PR: 9505
File: src/main/webapp/app/exercises/programming/shared/code-editor/monaco/code-editor-monaco.component.html:9-9
Timestamp: 2024-10-20T21:59:11.630Z
Learning: In Angular templates within the Artemis project (e.g., `src/main/webapp/app/exercises/programming/shared/code-editor/monaco/code-editor-monaco.component.html`), properties like `selectedFile()`, `readOnlyManualFeedback()`, `highlightDifferences()`, and `course()` are signals. It is appropriate to call these signals directly in the template.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-base-container.component.ts
📚 Learning: 2024-10-10T11:42:23.069Z
Learnt from: pzdr7
Repo: ls1intum/Artemis PR: 9443
File: src/test/javascript/spec/component/hestia/git-diff-report/git-diff-modal.component.spec.ts:55-60
Timestamp: 2024-10-10T11:42:23.069Z
Learning: In `git-diff-report-modal.component.spec.ts`, using `fakeAsync` and `tick` does not work for handling asynchronous operations in the tests; alternative methods are needed.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2025-04-01T17:19:55.677Z
Learnt from: tobias-lippert
Repo: ls1intum/Artemis PR: 10610
File: src/test/javascript/spec/service/guided-tour.service.spec.ts:193-193
Timestamp: 2025-04-01T17:19:55.677Z
Learning: In the guide tour service tests, the `router.navigateByUrl` mock should remain synchronous (returning boolean) rather than returning a Promise to maintain compatibility with existing test logic that depends on synchronous behavior.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2024-10-08T15:35:52.595Z
Learnt from: pzdr7
Repo: ls1intum/Artemis PR: 9407
File: src/test/javascript/spec/component/programming-exercise/programming-exercise-custom-aeolus-build-plan.component.spec.ts:172-175
Timestamp: 2024-10-08T15:35:52.595Z
Learning: When testing components that use `MonacoEditorComponent`, it's acceptable not to test `MonacoEditorComponent` functionality within those tests, as dedicated tests already exist for it.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2025-07-03T14:51:57.407Z
Learnt from: ekayandan
Repo: ls1intum/Artemis PR: 10885
File: src/main/webapp/app/programming/shared/git-diff-report/git-diff-report/git-diff-report.component.ts:63-74
Timestamp: 2025-07-03T14:51:57.407Z
Learning: In the `GitDiffReportComponent` (`src/main/webapp/app/programming/shared/git-diff-report/git-diff-report/git-diff-report.component.ts`), directly mutating the `diffInformation` array from `repositoryDiffInformation().diffInformations` to update the `diffReady` property works correctly with Angular's OnPush change detection strategy in this codebase.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2024-10-08T15:35:48.767Z
Learnt from: pzdr7
Repo: ls1intum/Artemis PR: 9407
File: src/test/javascript/spec/component/shared/monaco-editor/monaco-editor-communication-action.integration.spec.ts:46-46
Timestamp: 2024-10-08T15:35:48.767Z
Learning: In integration tests, it's acceptable to import the actual `MonacoEditorComponent` instead of mocking it.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2025-09-01T13:47:02.624Z
Learnt from: Michael-Breu-UIbk
Repo: ls1intum/Artemis PR: 10989
File: src/main/webapp/app/programming/manage/detail/programming-exercise-detail.component.with-sharing.spec.ts:167-169
Timestamp: 2025-09-01T13:47:02.624Z
Learning: In Jest tests, prefer using jest.spyOn() over direct method assignment for mocking service methods, as spies are automatically restored by Jest's cleanup mechanisms (jest.restoreAllMocks()), while direct assignment bypasses this system and can lead to test pollution where mocked methods affect subsequent tests.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2024-10-20T22:04:39.861Z
Learnt from: pzdr7
Repo: ls1intum/Artemis PR: 9505
File: src/test/javascript/spec/integration/code-editor/code-editor-container.integration.spec.ts:233-234
Timestamp: 2024-10-20T22:04:39.861Z
Learning: In the Artemis codebase's TypeScript test files (`*.spec.ts`), the Jest matcher `toHaveBeenCalledOnce()` is acceptable and can be used in tests.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2024-10-12T16:55:30.551Z
Learnt from: magaupp
Repo: ls1intum/Artemis PR: 9440
File: src/main/resources/templates/typescript/exercise/package.json:4-7
Timestamp: 2024-10-12T16:55:30.551Z
Learning: In TypeScript programming exercises in Artemis, tests are not run by the students, so it's unnecessary to include a test script in the package.json file.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2025-07-04T07:39:46.773Z
Learnt from: Wallenstein61
Repo: ls1intum/Artemis PR: 10989
File: src/main/webapp/app/sharing/sharing.component.spec.ts:125-125
Timestamp: 2025-07-04T07:39:46.773Z
Learning: In the Artemis codebase TypeScript test files (`*.spec.ts`), `toHaveBeenCalledOnce()` is the preferred Jest assertion method and is enforced by pre-commit hooks. Do not suggest changing it to `toHaveBeenCalledTimes(1)`.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2024-07-09T19:09:34.276Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/test/javascript/spec/component/shared/sidebar/sidebar-accordion.component.spec.ts:91-96
Timestamp: 2024-07-09T19:09:34.276Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting to change `expect(component.expandAll).toHaveBeenCalledOnce()` to `expect(component.expandAll).toHaveBeenCalledTimes(1)`.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2024-07-09T19:09:58.572Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/test/javascript/spec/component/shared/sidebar/sidebar-accordion.component.spec.ts:115-115
Timestamp: 2024-07-09T19:09:58.572Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting to change `expect(component.setStoredCollapseState).toHaveBeenCalledOnce()` to `expect(component.setStoredCollapseState).toHaveBeenCalledTimes(1)`.

Applied to files:

  • src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts
📚 Learning: 2025-04-22T10:22:01.154Z
Learnt from: tobias-lippert
Repo: ls1intum/Artemis PR: 10714
File: src/main/webapp/app/exercise/exercise-create-buttons/exercise-manage-button/exercise-manage-button.component.ts:38-43
Timestamp: 2025-04-22T10:22:01.154Z
Learning: In the Artemis codebase, the ExerciseType enum has uppercase keys (PROGRAMMING, MODELING, etc.) but lowercase string values ('programming', 'modeling', etc.), which are used directly in translation keys and route paths.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingExerciseEditorSyncTarget.java
  • src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java
📚 Learning: 2024-10-14T10:27:58.500Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/main/webapp/i18n/de/student-dashboard.json:36-37
Timestamp: 2024-10-14T10:27:58.500Z
Learning: Avoid suggesting the translation change for "noExercisesFoundWithAppliedFilter" in the PR ls1intum/Artemis#8858. The preferred translation is "Keine Aufgaben passen zu den gewählten Filtern."

Applied to files:

  • src/main/webapp/i18n/de/editor.json
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/test/java/de/tum/in/www1/artemis/exam/StudentExamIntegrationTest.java:975-980
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `testSubmitStudentExam_notInTime` method does not require additional checks to verify the state of `studentExam1` after receiving a `HttpStatus.FORBIDDEN` because the control flow in the `StudentExamResource` is straightforward and ensures no state change occurs.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/test/java/de/tum/in/www1/artemis/exam/StudentExamIntegrationTest.java:2836-2846
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `testAbandonStudentExamNotInTime` method does not require additional checks to verify the state of `studentExam1` after receiving a `HttpStatus.FORBIDDEN` because the control flow in the `StudentExamResource` is straightforward and ensures no state change occurs.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/test/java/de/tum/in/www1/artemis/exam/StudentExamIntegrationTest.java:2804-2810
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `postWithoutLocation` method used in the `testAbandonStudentExam` test case already checks the response status, ensuring that the abandonment of the exam is accepted.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: pzdr7
Repo: ls1intum/Artemis PR: 8703
File: src/main/java/de/tum/in/www1/artemis/web/rest/QuizParticipationResource.java:39-39
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `Profile(PROFILE_CORE)` annotation in `QuizParticipationResource.java` is used to ensure that all nodes, not just those with the scheduling profile, can handle quiz participations.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java
📚 Learning: 2025-09-25T11:25:54.261Z
Learnt from: Elfari1028
Repo: ls1intum/Artemis PR: 11351
File: src/main/java/de/tum/cit/aet/artemis/versioning/dto/QuizExerciseSnapshotDTO.java:52-53
Timestamp: 2025-09-25T11:25:54.261Z
Learning: In the Artemis versioning system, quiz questions processed by QuizExerciseSnapshotDTO should always have valid IDs (non-null getId()) since versioning works with persisted entities, making null filtering unnecessary according to Elfari1028.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java
📚 Learning: 2025-04-04T09:39:24.832Z
Learnt from: eceeeren
Repo: ls1intum/Artemis PR: 10533
File: src/main/java/de/tum/cit/aet/artemis/core/web/CourseResource.java:839-857
Timestamp: 2025-04-04T09:39:24.832Z
Learning: In the Artemis application, filtering of unreleased exercises is handled at the database level through SQL queries in the repository methods rather than in the application code. The method findByCourseIdWithFutureDueDatesAndCategories in ExerciseRepository applies this filtering, making additional application-level filtering unnecessary.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java
📚 Learning: 2025-10-22T21:32:19.993Z
Learnt from: Elfari1028
Repo: ls1intum/Artemis PR: 11491
File: src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java:114-126
Timestamp: 2025-10-22T21:32:19.993Z
Learning: For ExerciseVersion, the maintainer prefers to keep separate records if two different authors produce the same snapshot at the same time; any deduplication should therefore include author_id in the uniqueness key.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java
🧬 Code graph analysis (5)
src/main/webapp/app/programming/manage/services/programming-exercise-editor-sync.service.spec.ts (2)
src/main/webapp/app/programming/manage/services/programming-exercise-editor-sync.service.ts (1)
  • ProgrammingExerciseEditorSyncMessage (17-21)
src/main/webapp/app/programming/shared/code-editor/services/code-editor-repository.service.ts (1)
  • message (46-48)
src/main/java/de/tum/cit/aet/artemis/programming/web/repository/AuxiliaryRepositoryResource.java (1)
src/main/java/de/tum/cit/aet/artemis/programming/domain/Repository.java (1)
  • Repository (17-84)
src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-base-container.component.ts (2)
src/main/webapp/app/programming/shared/code-editor/services/code-editor-repository.service.ts (1)
  • message (46-48)
src/main/webapp/app/programming/manage/services/programming-exercise-editor-sync.service.ts (1)
  • ProgrammingExerciseEditorSyncMessage (17-21)
src/main/webapp/app/programming/manage/code-editor/instructor-and-editor-container/code-editor-instructor-and-editor-container.componente.spec.ts (1)
src/main/webapp/app/programming/manage/services/programming-exercise-editor-sync.service.ts (1)
  • ProgrammingExerciseEditorSyncMessage (17-21)
src/main/java/de/tum/cit/aet/artemis/programming/web/repository/TestRepositoryResource.java (1)
src/main/java/de/tum/cit/aet/artemis/programming/domain/Repository.java (1)
  • Repository (17-84)
⏰ 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). (7)
  • GitHub Check: Codacy Static Code Analysis
  • 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: client-tests
  • GitHub Check: server-tests
  • GitHub Check: Analyse

Comment on lines +50 to 54
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseEditorSyncTarget;
import de.tum.cit.aet.artemis.programming.domain.Repository;
import de.tum.cit.aet.artemis.programming.dto.FileMove;
import de.tum.cit.aet.artemis.programming.dto.ProgrammingExerciseEditorSyncEventDTO;
import de.tum.cit.aet.artemis.programming.dto.RepositoryStatusDTO;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Commit-flag sync tests don’t match their names and likely miss intended scenarios

The broadcast tests for folder/file create/rename/delete, reset, and PUT /files?commit=false with actual file submissions look correct: they verify a single synchronization message on the expected topic with target=AUXILIARY_REPOSITORY and the correct auxiliaryRepositoryId.

However, the two tests meant to cover commit=true behavior appear misconfigured:

  • Line 297 (testUpdateFilesWithCommitDoesNotBroadcast) calls:
    • PUT ... "/files?commit=false" with List.of()
  • Line 308 (testUpdateFilesCommitTrueWithSubmissionsDoesNotBroadcast) also calls:
    • PUT ... "/files?commit=false" with List.of()

So both tests:

  • Use commit=false instead of commit=true, contradicting their method names and the distinction the PR describes between committed and non-committed updates.
  • Send an empty list instead of representing “with submissions” in the second test, so the “withSubmissions” aspect is not covered.
  • Are effectively duplicates of each other and do not assert any behavior specific to commit=true scenarios.

This likely leaves the commit=true paths of the resource untested and may hide regressions in synchronization behavior around committed changes.

Consider updating them along these lines:

@@
-    void testUpdateFilesWithCommitDoesNotBroadcast() throws Exception {
+    void testUpdateFilesWithCommitDoesNotBroadcast() throws Exception {
         programmingExerciseRepository.save(programmingExercise);
         reset(websocketMessagingService);
 
-        request.put(testRepoBaseUrl + auxiliaryRepository.getId() + "/files?commit=false", List.of(), HttpStatus.OK);
+        request.put(testRepoBaseUrl + auxiliaryRepository.getId() + "/files?commit=true", List.of(), HttpStatus.OK);
@@
-    void testUpdateFilesCommitTrueWithSubmissionsDoesNotBroadcast() throws Exception {
+    void testUpdateFilesCommitTrueWithSubmissionsDoesNotBroadcast() throws Exception {
         programmingExerciseRepository.save(programmingExercise);
         reset(websocketMessagingService);
 
-        request.put(testRepoBaseUrl + auxiliaryRepository.getId() + "/files?commit=false", List.of(), HttpStatus.OK);
+        request.put(
+            testRepoBaseUrl + auxiliaryRepository.getId() + "/files?commit=true",
+            getFileSubmissions(),
+            HttpStatus.OK
+        );

If different semantics are intended (e.g., “with submissions” meaning something else), then at minimum the query parameter in these tests should reflect commit=true, and the test names or setup should be adjusted so they accurately describe what is being verified.

Also applies to: 211-332

@github-project-automation github-project-automation bot moved this from Work In Progress to Ready For Review in Artemis Development Nov 29, 2025
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report218 ran213 passed3 skipped2 failed1h 11m 55s 369ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exam/ExamDateVerification.spec.ts
ts.Exam date verification › Exam timing › Student can start after start Date❌ failure2m 3s 511ms
e2e/exercise/programming/ProgrammingExerciseParticipation.spec.ts
ts.Programming exercise participation › Programming exercise team participation › Check team participation › Instructor checks the participation❌ failure7s 666ms

Elfari1028 and others added 3 commits November 29, 2025 16:26
…when-new-changes-are-saved' of github.com:ls1intum/Artemis into feature/exercise-synchronization/notify-active-editors-when-new-changes-are-saved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 52b92f6 and 22a9401.

📒 Files selected for processing (2)
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java (5 hunks)
  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java (8 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
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/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
🧠 Learnings (18)
📚 Learning: 2025-08-11T13:22:05.140Z
Learnt from: Wallenstein61
Repo: ls1intum/Artemis PR: 10989
File: src/test/java/de/tum/cit/aet/artemis/programming/service/sharing/ExerciseSharingResourceImportTest.java:128-131
Timestamp: 2025-08-11T13:22:05.140Z
Learning: In the ExerciseSharingResourceImportTest class in Artemis, mockServer.verify() is not needed in the tearDown method as the test design doesn't require strict verification of all mocked HTTP expectations. The mockServer field is managed differently in this test class.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.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/programming/TestRepositoryResourceIntegrationTest.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/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 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/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 Learning: 2025-08-10T18:33:22.476Z
Learnt from: Wallenstein61
Repo: ls1intum/Artemis PR: 10989
File: src/test/java/de/tum/cit/aet/artemis/programming/AbstractProgrammingIntegrationLocalCILocalVCTest.java:3-9
Timestamp: 2025-08-10T18:33:22.476Z
Learning: In the Artemis test framework, `MockitoBean` from `org.springframework.test.context.bean.override.mockito` is the standard annotation used for mocking beans in test classes, not `MockBean`. This is used consistently across test base classes like `AbstractProgrammingIntegrationLocalCILocalVCTest`, `AbstractSpringIntegrationIndependentTest`, and `AbstractSpringIntegrationLocalVCSamlTest`. The project also uses `MockitoSpyBean` from the same package.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 Learning: 2025-10-22T21:31:54.240Z
Learnt from: Elfari1028
Repo: ls1intum/Artemis PR: 11491
File: src/main/java/de/tum/cit/aet/artemis/exercise/web/ExerciseResource.java:376-378
Timestamp: 2025-10-22T21:31:54.240Z
Learning: In Artemis, ExerciseVersionService.createExerciseVersion(...) (src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java) eagerly re-fetches the target exercise (via type-specific findForVersioningById) before building the ExerciseSnapshotDTO. Controllers (e.g., ExerciseResource.toggleSecondCorrectionEnabled) do not need to reload the exercise before invoking createExerciseVersion.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 Learning: 2025-08-30T20:20:17.236Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11111
File: src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomIntegrationTest.java:0-0
Timestamp: 2025-08-30T20:20:17.236Z
Learning: In ExamRoomIntegrationTest.validateAdminOverview(), the first assertion should use subset containment (contains) rather than exact equality because the admin overview shows all newest unique exam rooms in the system including those from previous uploads, not just rooms from the current upload being tested. The test only needs to verify that the expected rooms from the current upload are present in the response.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 Learning: 2024-10-04T23:23:49.139Z
Learnt from: magaupp
Repo: ls1intum/Artemis PR: 9261
File: src/main/resources/templates/c_plus_plus/test/testUtils/TestFailedError.py:6-6
Timestamp: 2024-10-04T23:23:49.139Z
Learning: In the Artemis project, when adding new programming language templates like C++, files such as `src/main/resources/templates/c_plus_plus/test/testUtils/TestFailedError.py` may be copied from existing templates without modifications. In such cases, suggesting modifications to these files (e.g., removing unnecessary `pass` statements) may not be necessary.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
📚 Learning: 2024-10-20T18:37:45.365Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 9303
File: src/main/java/de/tum/in/www1/artemis/service/exam/StudentExamService.java:296-300
Timestamp: 2024-10-20T18:37:45.365Z
Learning: When reviewing code changes in `StudentExamService.saveSubmission`, if the PR aims to improve readability without changing logic, avoid suggesting changes that alter logic, such as adding exceptions in the default case of switch statements.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/test/java/de/tum/in/www1/artemis/exam/StudentExamIntegrationTest.java:988-993
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `testSubmitStudentExam_differentUser` method does not require additional checks to verify the state of `studentExam1` after receiving a `HttpStatus.FORBIDDEN` because the control flow in the `StudentExamResource` is straightforward and ensures no state change occurs.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 Learning: 2025-08-19T09:13:51.235Z
Learnt from: ekayandan
Repo: ls1intum/Artemis PR: 11027
File: src/main/java/de/tum/cit/aet/artemis/programming/service/GitArchiveHelper.java:0-0
Timestamp: 2025-08-19T09:13:51.235Z
Learning: The domain Repository class (de.tum.cit.aet.artemis.programming.domain.Repository) extends JGit's FileRepository, making it polymorphically compatible with JGit APIs while providing additional Artemis-specific methods like getParticipation() and getLocalPath().

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 Learning: 2025-06-10T12:26:42.449Z
Learnt from: Wallenstein61
Repo: ls1intum/Artemis PR: 10989
File: src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseImportFromFileService.java:108-117
Timestamp: 2025-06-10T12:26:42.449Z
Learning: In ProgrammingExerciseImportFromFileService, the current directory traversal logic for sharing imports (walking importExerciseDir before extraction) is working correctly in practice and should not be changed to more complex solutions, even if there are theoretical issues with the approach.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 Learning: 2024-10-08T15:35:42.972Z
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.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 Learning: 2025-09-20T16:47:54.380Z
Learnt from: MoritzSpengler
Repo: ls1intum/Artemis PR: 11382
File: src/main/java/de/tum/cit/aet/artemis/quiz/service/QuizTrainingService.java:43-54
Timestamp: 2025-09-20T16:47:54.380Z
Learning: In QuizTrainingService.submitForTraining, cross-course mismatch protection is handled through PreAuthorize("hasAccessToCourse(#courseId)") authorization at the REST layer, ensuring users can only submit for courses they have access to, rather than through explicit courseId validation in the service method.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 Learning: 2024-10-08T15:35:42.972Z
Learnt from: jakubriegel
Repo: ls1intum/Artemis PR: 8050
File: src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismUtilService.java:62-66
Timestamp: 2024-10-08T15:35:42.972Z
Learning: The `createCourseWithUsers` method in `PlagiarismUtilService.java` uses fixed inputs as it is designed to be a test helper method for simplifying the setup of courses and users in tests.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 Learning: 2025-09-20T16:47:54.380Z
Learnt from: MoritzSpengler
Repo: ls1intum/Artemis PR: 11382
File: src/main/java/de/tum/cit/aet/artemis/quiz/service/QuizTrainingService.java:43-54
Timestamp: 2025-09-20T16:47:54.380Z
Learning: In QuizTrainingService.submitForTraining, cross-course validation is handled by the REST layer through authCheckService.checkHasAtLeastRoleInCourseElseThrow() which validates user access to the course before the service method is called, eliminating the need for additional courseId validation in the service layer.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/test/java/de/tum/in/www1/artemis/exam/StudentExamIntegrationTest.java:2836-2846
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `testAbandonStudentExamNotInTime` method does not require additional checks to verify the state of `studentExam1` after receiving a `HttpStatus.FORBIDDEN` because the control flow in the `StudentExamResource` is straightforward and ensures no state change occurs.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java
📚 Learning: 2024-10-08T15:35:48.767Z
Learnt from: jakubriegel
Repo: ls1intum/Artemis PR: 8050
File: src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismUtilService.java:125-136
Timestamp: 2024-10-08T15:35:48.767Z
Learning: The `createTeamTextExerciseAndSimilarSubmissions` method in `PlagiarismUtilService.java` uses fixed inputs as it is designed to be a test helper method for simplifying the setup of team exercises and submissions in tests.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.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). (11)
  • GitHub Check: client-tests
  • GitHub Check: client-tests-selected
  • GitHub Check: client-style
  • GitHub Check: server-style
  • GitHub Check: server-tests
  • GitHub Check: Codacy Static Code Analysis
  • 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: Analyse
  • GitHub Check: bean-instantiation-check
🔇 Additional comments (2)
src/test/java/de/tum/cit/aet/artemis/programming/TestRepositoryResourceIntegrationTest.java (1)

191-439: LGTM! Synchronization broadcast tests are well-structured.

The new tests properly verify WebSocket broadcasts for repository operations:

  • Consistent use of ArgumentCaptor to capture and validate the ProgrammingExerciseEditorSyncEventDTO
  • Correct assertions on target (TESTS_REPOSITORY) and auxiliaryRepositoryId (null for test repository)
  • The distinction between empty submissions (no broadcast) and actual file submissions (broadcast) at lines 403-412 vs 426-439 is logical and covers different code paths

The past review concern about duplicate tests with misleading names appears to have been addressed.

src/test/java/de/tum/cit/aet/artemis/exercise/programming/AuxiliaryRepositoryResourceIntegrationTest.java (1)

211-310: LGTM! Auxiliary repository broadcast tests are comprehensive.

The new synchronization broadcast tests correctly verify:

  • WebSocket messages sent to the proper topic with ArgumentCaptor
  • Target set to AUXILIARY_REPOSITORY
  • auxiliaryRepositoryId matches the repository's ID

The test at lines 282-293 (testUpdateFilesBroadcastsWhenNotCommitted) appropriately covers the non-committed file updates scenario with actual file submissions.

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ✅SkippedFailedTime ⏱
End-to-End (E2E) Test Report1 ran1 passed0 skipped0 failed1s 733ms
TestResultTime ⏱
No test annotations available

@helios-aet helios-aet bot temporarily deployed to artemis-test6.artemis.cit.tum.de November 29, 2025 16:23 Inactive
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report218 ran214 passed3 skipped1 failed1h 12m 9s 888ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/programming/ProgrammingExerciseParticipation.spec.ts
ts.Programming exercise participation › Programming exercise team participation › Check team participation › Instructor checks the participation❌ failure8s 283ms

@helios-aet helios-aet bot temporarily deployed to artemis-test9.artemis.cit.tum.de December 2, 2025 13:47 Inactive
Copy link

@kaleliguray kaleliguray left a comment

Choose a reason for hiding this comment

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

The PR was tested as described. However, there is some issue which you can see on the screenshots. I opened two browser to test the case. Then created programing exercise, tried to edit it in the "Edit in Editor" section. I could modified the exercise as depicted, and I got an warning in the management browser (safari), however, I could not get an warning in the testion browser (chrome). Moreover, I have got an error while checking in the testing browser (chrome). Due to the fact that those problem and my control, there was no warning pop-up corresponding to update.

Browser:

Safari Version 26.1 (21622.2.11.11.9) ---> management browser
Chrome Version 142.0.7444.176 (Official Build) (arm64) ---> testing browser

Test Account

Role: Instructor
Account: artemis_test_user_18

Steps for Testing:

I followed the same steps depicted in the PR page.

  1. Log in to Artemis as an instructor
  2. Create a programming exercise that was mentioned in the PR description
  3. The exercise was published as expected, the warning appeared, and saw it in the testing browser
  4. Go to the exercise section and click on the "Edit in editor" button
  5. Made some modifications in the Problem Statement section
  6. Save it, and click on the Submit button
  7. You will see a warning pop-up in the management browser(Safari); however, there was no warning pop-up in the testing browser(Chrome).
  8. Also, you can get some errors in Chrome while checking (use inspector -> console)

ScreenShots

Screenshot 2025-12-02 at 15 28 58 Screenshot 2025-12-02 at 15 30 23 Screenshot 2025-12-02 at 15 10 07 Screenshot 2025-12-02 at 15 08 00 Screenshot 2025-12-02 at 15 02 09 Screenshot 2025-12-02 at 15 02 35 Screenshot 2025-12-02 at 15 12 03

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!) exercise Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module ready for review server Pull requests that update Java code. (Added Automatically!) tests

Projects

Status: Ready For Review

Development

Successfully merging this pull request may close these issues.

4 participants