Skip to content

Development: Migrate file upload exercise endpoints to DTOs#13102

Draft
dogusaytok wants to merge 3 commits into
developfrom
chore/fileupload/exercise-crud-import-search-dto-migration
Draft

Development: Migrate file upload exercise endpoints to DTOs#13102
dogusaytok wants to merge 3 commits into
developfrom
chore/fileupload/exercise-crud-import-search-dto-migration

Conversation

@dogusaytok

@dogusaytok dogusaytok commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR migrates File Upload exercise CRUD, import, search, course-list, update, and re-evaluation REST contracts from JPA entities to dedicated DTOs. It introduces server-side DTO mappings and client-side adapters while preserving existing endpoint paths, authorization rules, behavior, and exam import semantics. It also reduces the File Upload entity-usage architecture violation budget from 15/3/1 to 8/1/1.

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) and too complex database calls.
  • I strictly followed the principle of data economy for all database calls.
  • I strictly followed the server coding and design guidelines and the REST API guidelines.
  • I added multiple integration tests (Spring) related to the features (with a high test coverage).
  • 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 added multiple integration tests (Vitest) related to the features (with a high test coverage), while following the test guidelines.

Motivation and Context

File Upload exercise REST endpoints previously exposed persistence entities directly. This coupled the public API to the JPA model. Dedicated input and response DTOs establish explicit, data-economical API contracts while keeping the internal service layer entity-based.

Description

  • Add dedicated DTOs for File Upload exercise input, responses, team assignment configuration, and plagiarism detection configuration.
  • Migrate create and import request bodies to the input DTO.
  • Migrate create, import, search, course-list, detail, update, and re-evaluation responses to response DTOs.
  • Preserve existing REST paths, authorization rules, side effects, delete behavior, and binary export behavior.
  • Provide lean mappings for search and course-list results while guarding optional lazy associations.
  • Fetch plagiarism configuration where full detail mappings require it.
  • Add Angular DTO interfaces and adapters that reconstruct the existing client-side exercise, course, exam, and exercise-group models.
  • Send scalar course and exercise-group identifiers for create and import requests.
  • Adapt File Upload exercise services, paging, and course exercise loading to consume the new DTO contracts.
  • Adapt server and client tests to the new contracts, including team configuration, plagiarism configuration, exam context, search results, and paging.
  • Reduce the permitted File Upload entity-usage architecture violations to reflect the migrated endpoints.

Steps for Testing

  • 1 Instructor
  • 1 Editor
  • 1 Teaching Assistant
  • 2 Courses
  • 1 existing File Upload Exercise that can be imported
  1. Log in as an instructor and navigate to Course Administration.
  2. Create an individual File Upload exercise with categories, dates, a file-pattern restriction, grading criteria, competency links, and plagiarism-detection settings.
  3. Open the exercise details, verify that all configured values are displayed, update the exercise, and trigger re-evaluation.
  4. Create a team-based File Upload exercise with minimum and maximum team sizes.
  5. Reopen the team exercise and verify its team-assignment configuration in the detail and course-list views.
  6. Search for and import the existing File Upload exercise into the second course.
  7. Verify that the search result displays the correct course context and that the imported exercise retains its supported settings.
  8. Verify that the instructor, editor, and teaching assistant retain their previous access permissions.
  9. Verify that deleting an exercise and exporting its submissions still work as before.

Exam Mode Testing

Prerequisites:

  • 1 Instructor
  • 1 Editor
  • 1 Teaching Assistant
  • 1 Exam with an Exercise Group
  • 1 existing course File Upload Exercise that can be imported
  1. Log in as an instructor and navigate to the exam exercise-group administration.
  2. Create a File Upload exercise in the exercise group.
  3. Import the existing course File Upload exercise into the exercise group.
  4. Verify that the imported exam exercise remains an individual exercise and does not contain team-assignment configuration.
  5. Open and update both exam exercises and verify their exam, exercise-group, and course context.
  6. Search for the exam exercises and verify that the exam and course titles are displayed correctly.
  7. Verify that the editor retains access and that the teaching assistant cannot access exam exercise administration.

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

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Test Coverage

Note: Some tests in the Test job did not pass (failure). Coverage below may be partial.

Client

Class/File Line Coverage Lines Expects Ratio
course-exercise.service.ts 92.00% 112 16 14.3
file-upload-exercise-paging.service.ts 100.00% 29 6 20.7
file-upload-exercise.service.ts 100.00% 71 22 31.0
file-upload-exercise-dto.ts 71.42% 256 ? ?

Server

Class/File Line Coverage Lines
FileUploadExerciseDTO.java not found (modified) 95
FileUploadExerciseInputDTO.java not found (modified) 93
FileUploadPlagiarismDetectionConfigDTO.java not found (modified) 35
FileUploadTeamAssignmentConfigDTO.java not found (modified) 16
UpdateFileUploadExerciseDTO.java not found (modified) 54
FileUploadExerciseRepository.java not found (modified) 76
FileUploadExerciseResource.java not found (modified) 468

Last updated: 2026-07-04 01:32:17 UTC

@dogusaytok dogusaytok self-assigned this Jul 4, 2026
@github-project-automation github-project-automation Bot moved this to Work In Progress in Artemis Development Jul 4, 2026
@github-actions github-actions Bot added tests server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) exercise Pull requests that affect the corresponding module fileupload Pull requests that affect the corresponding module labels Jul 4, 2026
@dogusaytok dogusaytok temporarily deployed to playwright-e2e-tests July 4, 2026 00:54 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

End-to-End Test Results

Phase Status Details
Phase 1 (Relevant) ❌ Failed
TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
Phase 1: E2E Test Report26 ran21 passed2 skipped3 failed5m 17s
Phase 2 (Remaining) ⏭ Skipped (no remaining tests)
❌ Failed Tests (Phase 1)
  • File upload exercise management › File upload exercise deletion › Deletes an existing file upload exercise (2m 17s)
  • File upload exercise participation › Starts a file upload exercise in the UI (1m 33s)
  • File upload exercise assessment › Feedback › Assesses the file upload exercise submission (0s)

Flakiness Scores for Failed Tests

Test Flakiness Score Default Branch Failure Rate Combined Failure Rate
e2e/exercise/file-upload/FileUploadExerciseManagement.spec.ts#File upload exercise management › File upload exercise deletion › Deletes an existing file upload exercise 0% 0.4% 0.1%
e2e/exercise/file-upload/FileUploadExerciseParticipation.spec.ts#File upload exercise participation › Starts a file upload exercise in the UI 0% 0.3% 0.1%
e2e/exercise/file-upload/FileUploadExerciseAssessment.spec.ts#File upload exercise assessment › Feedback › Assesses the file upload exercise submission 67.8727445394112% 1.5% 0.3%

Test Strategy: Two-phase execution

  • Phase 1: e2e/Login.spec.ts e2e/Logout.spec.ts e2e/SystemHealth.spec.ts e2e/course/CourseExercise.spec.ts e2e/exercise/ExerciseImport.spec.ts e2e/exercise/file-upload/
  • Phase 2: e2e/Passkey.spec.ts e2e/PasskeyReminderPersistence.spec.ts e2e/admin/ e2e/atlas/ e2e/course/CourseChannelMessages.spec.ts e2e/course/CourseDirectMessages.spec.ts e2e/course/CourseGroupChatMessages.spec.ts e2e/course/CourseManagement.spec.ts e2e/course/CourseMessageInteractions.spec.ts e2e/course/CourseOnboarding.spec.ts e2e/course/CourseOverviewSingleLoad.spec.ts e2e/exam/ExamAssessment.spec.ts e2e/exam/ExamChecklists.spec.ts e2e/exam/ExamCreationDeletion.spec.ts e2e/exam/ExamDateVerification.spec.ts e2e/exam/ExamManagement.spec.ts e2e/exam/ExamParticipation.spec.ts e2e/exam/ExamResults.spec.ts e2e/exam/ExamTestRun.spec.ts e2e/exam/test-exam/ e2e/exercise/modeling/ e2e/exercise/programming/ e2e/exercise/quiz-exercise/ e2e/exercise/text/ e2e/iris/ e2e/lecture/ e2e/shared/

Overall: ❌ E2E tests failed

🔗 Workflow Run · 📊 Test Report Phase 1

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

Projects

Status: Work In Progress

Development

Successfully merging this pull request may close these issues.

1 participant