-
Notifications
You must be signed in to change notification settings - Fork 349
Plagiarism checks: Improve continuous plagiarism control component validation
#11644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Plagiarism checks: Improve continuous plagiarism control component validation
#11644
Conversation
End-to-End (E2E) Test Results Summary
|
||||||||||||||||||||||||||||||||||||
Plagiarism checks: Continuous plagiarism control component validation
Plagiarism checks: Continuous plagiarism control component validationPlagiarism checks: Improve continuous plagiarism control component validation
End-to-End (E2E) Test Results Summary
|
||||||||||||||||||||||||
…ol-component-validation
End-to-End (E2E) Test Results Summary
|
||||||||||||||||||||||||
WalkthroughThis pull request introduces comprehensive plagiarism detection configuration validation across multiple exercise types. A new validation method is added to the PlagiarismDetectionConfigHelper, validation constraints are applied to the PlagiarismDetectionConfig domain model, and validation calls are integrated into create/import/update workflows for file-upload, modeling, programming, and text exercises. Frontend UI refinements and extensive test coverage validate the new validation behavior. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.40.0)src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java[] Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (7)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfig.java (1)
8-68: Bean Validation constraints for plagiarism config are well alignedThe new
@Min/@Maxannotations onsimilarityThreshold,minimumScore, andminimumSizecorrectly encode the same bounds used by the helper and UI (0–100 for percentages,>= 0for size), improving safety without changing behavior.If you want stricter symmetry, you could also consider annotating
continuousPlagiarismControlPlagiarismCaseStudentResponsePeriodwith@Min(7)/@Max(31), but the helper already enforces this range so it’s not strictly necessary.src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java (1)
2429-2478: Programming exercise tests correctly assert BAD_REQUEST for invalid plagiarism configsBoth helper methods exercise the relevant invalid combinations (similarity threshold, minimum score, minimum size, and response period) against the create and update endpoints and assert
HttpStatus.BAD_REQUEST, which matches the helper’s contract.Minor style nit: you already import
PlagiarismDetectionConfig, so you can simplify the first instantiation to use the simple class name for consistency:- var config = new de.tum.cit.aet.artemis.plagiarism.domain.PlagiarismDetectionConfig(); + var config = new PlagiarismDetectionConfig();src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)
7-7: CPC config validation logic is sound; consider aligning Javadoc with implementationThe new
validatePlagiarismDetectionConfigOrThrowcentralizes CPC validation with clear ranges and usesBadRequestAlertExceptionconsistently. The only mismatch is the Javadoc rule “If continuousPlagiarismControlEnabled is true, config must not be null”, which is not enforced (and seems redundant given that flag lives on the config itself). Consider either enforcing that rule explicitly or removing it from the Javadoc to avoid confusion.Also applies to: 56-91
src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java (1)
69-69: Consistent CPC validation across modeling create/update/import endpointsImporting
PlagiarismDetectionConfigHelperand validating increateModelingExercise,updateModelingExercise, andimportExerciseensures modeling exercises cannot be saved with invalid CPC configs, including via the re-evaluate path that callsupdateModelingExercise. For even tighter regression safety, you might later add a small import-specific test mirroring the new create/update tests, but the current wiring is correct.Also applies to: 183-185, 264-266, 409-411
src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java (1)
993-1023: New modeling CPC integration tests cover the key invalid branchesThe create/update tests for invalid
PlagiarismDetectionConfigvalues line up with the helper’s bounds and should catch regressions in CPC validation behavior. If you want more precise failure diagnostics, you could additionally assert on the error key (e.g.invalidSimilarityThreshold,invalidResponsePeriod), but that’s optional given the current test style in this class.Also applies to: 1025-1044
src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java (1)
75-75: Text exercise CPC tests are well-aligned with the shared validatorThe new create/update tests for
PlagiarismDetectionConfigexercise the same invalid ranges as the modeling tests and should reliably assert that text endpoints now enforce the shared helper’s bounds. As a small optional enhancement, you could add an import-flow variant and/or assert error keys to increase specificity, but the current coverage already meets the PR’s goals.Also applies to: 353-405
src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java (1)
69-69: File-upload endpoints correctly adopt centralized CPC validationImporting
PlagiarismDetectionConfigHelperand invokingvalidatePlagiarismDetectionConfigOrThrowin create, import, and update ensures file-upload exercises cannot persist invalid CPC configs, and the re-evaluate path benefits via its call toupdateFileUploadExercise. This is consistent with the modeling/text/programming resources. Just make sureFileUploadExerciseImportService.importFileUploadExercise(...)actually uses theimportedFileUploadExercise’s plagiarism config as the basis for the new entity; if it ever copied the config solely from the source exercise, you’d want to apply the validator to the returnednewFileUploadExerciseinstead.Also applies to: 177-179, 235-237, 342-344
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java(4 hunks)src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java(4 hunks)src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfig.java(2 hunks)src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java(2 hunks)src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java(2 hunks)src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java(2 hunks)src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java(3 hunks)src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.html(1 hunks)src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts(1 hunks)src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts(1 hunks)src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java(1 hunks)src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java(1 hunks)src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java(3 hunks)src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java(1 hunks)src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java(1 hunks)src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java(1 hunks)src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java(2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
src/main/webapp/**/*.html
⚙️ CodeRabbit configuration file
@if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.
Files:
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.html
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/ProgrammingExerciseCreationResource.javasrc/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.javasrc/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.javasrc/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfig.javasrc/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.javasrc/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.javasrc/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java
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/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.javasrc/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.javasrc/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java
src/main/webapp/**/*.ts
⚙️ CodeRabbit configuration file
Files:
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.tssrc/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
🧠 Learnings (33)
📚 Learning: 2025-10-28T13:23:39.105Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11507
File: src/main/webapp/app/exam/manage/students/room-distribution/students-room-distribution-dialog.component.html:15-15
Timestamp: 2025-10-28T13:23:39.105Z
Learning: In the students room distribution dialog component (src/main/webapp/app/exam/manage/students/room-distribution/students-room-distribution-dialog.component.html and .ts), the reserve factor input intentionally uses type="text" instead of type="number" to support specific UX requirements: integer-only input with range 0-100, allowing temporary empty state during editing (which resets to 0), showing 0 only on blur when empty, and selecting all text on focus. This precise control is implemented through custom validation handlers (handleReserveFactorInput, resetReserveFactorText, selectAllTextAndOpenDropdown) which is not achievable with native number input constraints.
Applied to files:
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.htmlsrc/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.tssrc/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2024-07-10T08:47:07.884Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/main/webapp/app/shared/range-slider/range-slider.component.ts:16-16
Timestamp: 2024-07-10T08:47:07.884Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting the removal of trivially inferred type annotations for the `step` property in `range-slider.component.ts`.
Applied to files:
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.htmlsrc/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 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/ProgrammingExerciseCreationResource.javasrc/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.javasrc/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.javasrc/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.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/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.javasrc/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.javasrc/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.javasrc/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.javasrc/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.javasrc/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.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/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.javasrc/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.javasrc/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.javasrc/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.javasrc/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.javasrc/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.javasrc/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.javasrc/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.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/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.javasrc/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.javasrc/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.javasrc/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.javasrc/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.javasrc/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.javasrc/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.javasrc/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java
📚 Learning: 2024-08-05T00:11:50.650Z
Learnt from: magaupp
Repo: ls1intum/Artemis PR: 8802
File: src/main/resources/templates/rust/exercise/src/context.rs:1-1
Timestamp: 2024-08-05T00:11:50.650Z
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/ProgrammingExerciseCreationResource.javasrc/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.javasrc/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.javasrc/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.javasrc/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.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/ProgrammingExerciseCreationResource.javasrc/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.javasrc/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
📚 Learning: 2025-06-06T14:47:54.300Z
Learnt from: Wallenstein61
Repo: ls1intum/Artemis PR: 10989
File: src/main/java/de/tum/cit/aet/artemis/programming/web/ExerciseSharingResource.java:122-135
Timestamp: 2025-06-06T14:47:54.300Z
Learning: In Artemis sharing platform integration (under "sharing" profile), endpoints in ExerciseSharingResource use checksum-based authentication with shared secrets instead of PreAuthorize annotations. These endpoints (like getProblemStatement, getExerciseDetails, loadShoppingBasket) validate security through sharingInfo.checkChecksum() calls rather than role-based access control, as they serve as API interfaces for external sharing platform communication.
Applied to files:
src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.javasrc/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.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/ProgrammingExerciseCreationResource.javasrc/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.javasrc/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.javasrc/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.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/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.javasrc/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.javasrc/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.javasrc/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.javasrc/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.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/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.javasrc/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.javasrc/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.javasrc/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.javasrc/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.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/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.javasrc/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.javasrc/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.javasrc/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.javasrc/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.javasrc/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.javasrc/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.javasrc/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: julian-christl
Repo: ls1intum/Artemis PR: 8052
File: src/test/java/de/tum/in/www1/artemis/lecture/CompetencyIntegrationTest.java:310-310
Timestamp: 2024-06-10T19:44:09.116Z
Learning: Modifications to parameters in `competencyProgressUtilService.createCompetencyProgress` for debugging purposes are considered irrelevant to the test outcomes but helpful for clarity during debugging.
Applied to files:
src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.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/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.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/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.javasrc/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.javasrc/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.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: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/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.javasrc/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.javasrc/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.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/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.javasrc/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.javasrc/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.javasrc/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.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/text/web/TextExerciseCreationUpdateResource.javasrc/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.javasrc/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.javasrc/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java
📚 Learning: 2025-08-14T20:54:54.294Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11111
File: src/main/java/de/tum/cit/aet/artemis/exam/domain/room/LayoutStrategy.java:25-36
Timestamp: 2025-08-14T20:54:54.294Z
Learning: In the Artemis codebase, entity fields with `Column(nullable = false)` are considered sufficient for null validation without requiring additional Bean Validation annotations like `NotNull`, as the project follows a pattern of avoiding redundant validation constraints.
Applied to files:
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfig.java
📚 Learning: 2024-10-08T15:35:42.972Z
Learnt from: julian-christl
Repo: ls1intum/Artemis PR: 7829
File: src/main/java/de/tum/in/www1/artemis/web/rest/ComplaintResponseResource.java:0-0
Timestamp: 2024-10-08T15:35:42.972Z
Learning: The user has fixed the issue regarding the redundant wildcard import in `ComplaintResponseResource.java` by removing it in commit 7e392e0.
Applied to files:
src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.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/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts
📚 Learning: 2024-07-16T19:27:15.402Z
Learnt from: SimonEntholzer
Repo: ls1intum/Artemis PR: 8929
File: src/test/java/de/tum/in/www1/artemis/authentication/UserLocalVcIntegrationTest.java:29-33
Timestamp: 2024-07-16T19:27:15.402Z
Learning: When addressing missing test coverage, ensure that new tests specifically validate the functionality introduced in the PR, such as token-based authentication.
Applied to files:
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.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/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts
📚 Learning: 2024-11-02T22:57:57.717Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 9656
File: src/main/webapp/app/lecture/lecture-unit/lecture-unit-management/attachment-unit-form/attachment-unit-form.component.ts:69-71
Timestamp: 2024-11-02T22:57:57.717Z
Learning: In the `src/main/webapp/app/lecture/lecture-unit/lecture-unit-management/attachment-unit-form/attachment-unit-form.component.ts`, the `isFormValid` computed property intentionally uses a logical OR between `this.statusChanges() === 'VALID'` and `this.fileName()` to mirror the original `isSubmitPossible` getter, ensuring consistent form validation behavior.
Applied to files:
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.tssrc/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2024-10-08T15:35:42.972Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/main/webapp/app/shared/range-slider/range-slider.component.ts:65-80
Timestamp: 2024-10-08T15:35:42.972Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting changing the type of the `event` parameter in the `ensureMinValueIsSmallerThanMaxValueViceVersa` method in `range-slider.component.ts`.
Applied to files:
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2024-07-09T19:07:38.801Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/main/webapp/app/shared/exercise-filter/exercise-filter-modal.component.ts:185-188
Timestamp: 2024-07-09T19:07:38.801Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting moving assignments out of expressions within the `resetFilter` method in `exercise-filter-modal.component.ts`.
Applied to files:
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2024-07-10T08:46:02.595Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/main/webapp/app/shared/range-slider/range-slider.component.ts:60-63
Timestamp: 2024-07-10T08:46:02.595Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting changing the type for the `event` parameter in the `onSelectedMinValueChanged` and `onSelectedMaxValueChanged` methods in `range-slider.component.ts`.
Applied to files:
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2024-07-10T08:46:07.854Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/main/webapp/app/shared/range-slider/range-slider.component.ts:55-58
Timestamp: 2024-07-10T08:46:07.854Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting changing the type of the `event` parameter in the `onSelectedMinValueChanged` method in `range-slider.component.ts`.
Applied to files:
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2024-07-10T08:46:22.532Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/main/webapp/app/shared/range-slider/range-slider.component.ts:35-52
Timestamp: 2024-07-10T08:46:22.532Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting changes related to the `querySelectorAll` method in the `ngOnInit` method of the `RangeSliderComponent`.
Applied to files:
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 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/plagiarism/PlagiarismDetectionConfigHelperTest.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/fileupload/FileUploadExerciseIntegrationTest.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/fileupload/FileUploadExerciseIntegrationTest.java
🧬 Code graph analysis (9)
src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java (1)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)
PlagiarismDetectionConfigHelper(17-92)
src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java (1)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)
PlagiarismDetectionConfigHelper(17-92)
src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java (1)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)
PlagiarismDetectionConfigHelper(17-92)
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts (1)
src/main/webapp/app/exercise/shared/entities/exercise/exercise.model.ts (1)
DEFAULT_PLAGIARISM_DETECTION_CONFIG(58-65)
src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java (1)
src/main/webapp/app/exercise/shared/entities/exercise/exercise.model.ts (1)
PlagiarismDetectionConfig(49-56)
src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java (1)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)
PlagiarismDetectionConfigHelper(17-92)
src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java (1)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)
PlagiarismDetectionConfigHelper(17-92)
src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java (1)
src/test/java/de/tum/cit/aet/artemis/modeling/util/ModelingExerciseFactory.java (1)
ModelingExerciseFactory(19-158)
src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java (1)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)
PlagiarismDetectionConfigHelper(17-92)
⏰ 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). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (13)
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts (1)
36-38: Form validator forminimumSizematches backend rulesRemoving the
maxconstraint and keepingValidators.min(0)makes the client consistent with the backend’s@Min(0)constraint and the requirement to allow large minimum sizes.src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.html (1)
42-59: Numeric input steps and bounds now reflect CPC UX and validation
similarityThresholdandminimumScoreusingstep="1"(with [0,100]) plusminimumSizewithmin="0"are consistent with the form validators and the requirement to allow fine-grained thresholds and large minimum sizes.src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts (1)
132-323: CPC form validation tests are comprehensive and consistent with backend rulesThe added tests exercise all key client-side constraints (bounds, required-when-enabled behavior, large
minimumSize, and correct enable/disable of CPC controls) and verify propagation intoexercise.plagiarismDetectionConfig, giving solid coverage of the new behavior.src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java (1)
369-379: LocalVC/LocalCI integration tests correctly delegate invalid-config scenariosAdding the two delegating tests keeps this class consistent with the existing pattern and ensures the invalid plagiarism config behavior is also exercised under the LocalVC/LocalCI setup.
src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java (1)
43-203: Text exercise flows now share centralized plagiarism config validationImporting
PlagiarismDetectionConfigHelperand invokingvalidatePlagiarismDetectionConfigOrThrowin bothcreateTextExerciseandupdateTextExercisecleanly enforces the shared CPC constraints for text exercises before any persistence or external-service interaction.src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java (1)
41-116: Programming exercise creation now enforces shared plagiarism config validationCalling
PlagiarismDetectionConfigHelper.validatePlagiarismDetectionConfigOrThrowafter the standard programming-exercise validations integrates CPC constraints into the create endpoint and keeps behavior consistent with other exercise resources.src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java (1)
40-40: Plagiarism config validation is correctly integrated into the programming update flowCalling
PlagiarismDetectionConfigHelper.validatePlagiarismDetectionConfigOrThrow(updatedProgrammingExercise, ENTITY_NAME)after the existing validation service and authorization (but before loading and updating the persisted exercise) fits the controller’s pattern and ensures invalid CPC configs are rejected also via the re-evaluate endpoint that forwards here.Also applies to: 137-138
src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java (1)
650-660: LGTM! Tests follow established patterns.Both new test methods properly delegate to the test service and follow the established naming and annotation conventions used throughout the file. The tests are small, specific, and appropriately placed.
src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java (3)
677-709: LGTM! Comprehensive validation coverage.The test effectively covers multiple invalid configuration scenarios (negative similarity threshold, score above 100, negative minimum size, and invalid response period). The sequential approach efficiently tests different boundary violations in a single test method while maintaining clarity.
711-730: LGTM! Update validation properly tested.The test correctly validates invalid plagiarism detection configurations during exercise updates, covering upper boundary violations for similarity threshold and response period.
732-751: LGTM! Import validation properly tested.The test correctly validates invalid plagiarism detection configurations during exercise imports, covering a lower boundary violation for minimum score. The test properly sets up the import scenario with a different course and channel name.
src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java (2)
22-28: LGTM! Good test utility additions.The constant and helper method reduce duplication and improve test maintainability. The
createExerciseWithConfig()helper follows the factory pattern commonly used in test utilities.
101-176: LGTM! Comprehensive validation test coverage.The new validation tests thoroughly cover all boundary conditions for plagiarism detection configuration:
- Valid default and null configurations
- Similarity threshold range [0, 100]
- Minimum score range [0, 100]
- Minimum size non-negative
- Response period range [7, 31]
The tests use appropriate AssertJ assertions (
assertThatCode,assertThatThrownBy) and follow coding guidelines for test naming, size, and specificity.
Checklist
General
Server
Client
Changes affecting Programming Exercises
Motivation and Context
#11123
Improve Continuous Plagiarism Control Component Validation
Description
This PR improves the CPC configuration component.
Steps for Testing
Prerequisites:
Client side:
6.1 You can increment/decrement the similarity threshold by 1 through the UI with a max value of 100
6.2 You can set a value >100 for the minimum token count
6.3 The "Significant similarity response period in days" can take values from 7-31
Server side:
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
Manual Tests
Exam Mode Test
Performance Tests
Test Coverage
Screenshots
response when request has invalid CPC values:

Summary by CodeRabbit
New Features
Style