-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Programming exercises
: Remove unnecessary binary files from template and solution repository comparison
#10091
Programming exercises
: Remove unnecessary binary files from template and solution repository comparison
#10091
Conversation
…ere that function is called
…necessary-files-from-comparison
WalkthroughThe pull request introduces a feature to exclude binary files from repository file listings across multiple components of the Artemis application. This change involves modifying several services and resources to add an Changes
Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
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. 🔧 PMD (7.8.0)src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java[ERROR] Error at ruleset.xml:58:5 59| 67| 72| 76| 79| 80| 82| 83| 84| 85| 86| 87| 88| 91| 92| 107| 120| 125| 135| 138| 185| 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)`src/test/java/**/*.java`: test_naming: descriptive; test_si...
⏰ Context from checks skipped due to timeout of 90000ms (9)
🔇 Additional comments (4)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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 (4)
src/test/java/de/tum/cit/aet/artemis/programming/util/GitUtilService.java (2)
205-206
: Consider using Path.of() consistently.The code uses string concatenation for file paths in some places. Consider using
Path.of()
consistently for better path handling.- public File getFile(REPOS repo, String fileToRead) { - Path path = Path.of(getCompleteRepoPathStringByType(repo), fileToRead); + public File getFile(REPOS repo, String fileName) { + return Path.of(getCompleteRepoPathStringByType(repo)).resolve(fileName).toFile(); - public String getFileContent(REPOS repo, String fileToRead) { - try { - Path path = Path.of(getCompleteRepoPathStringByType(repo), fileToRead); + public String getFileContent(REPOS repo, String fileName) { + try { + Path path = Path.of(getCompleteRepoPathStringByType(repo)).resolve(fileName);Also applies to: 210-212
260-271
: Consider extracting file comparison logic.The file comparison logic is becoming complex. Consider extracting it into a separate method for better maintainability.
+ private boolean compareFileContent(REPOS local, REPOS remote, String fileName) { + String localContent = getFileContent(local, fileName); + String remoteContent = getFileContent(remote, fileName); + return localContent.equals(remoteContent); + } + public boolean isLocalEqualToRemote() { - String fileContentLocal1 = getFileContent(REPOS.LOCAL, GitUtilService.FILES.FILE1.toString()); - String fileContentLocal2 = getFileContent(REPOS.LOCAL, GitUtilService.FILES.FILE2.toString()); - String fileContentLocal3 = getFileContent(REPOS.LOCAL, GitUtilService.FILES.FILE3.toString()); - String fileContentLocal4 = getFileContent(REPOS.LOCAL, GitUtilService.FILES.FILE4.toString() + ".jar"); - - String fileContentRemote1 = getFileContent(REPOS.REMOTE, GitUtilService.FILES.FILE1.toString()); - String fileContentRemote2 = getFileContent(REPOS.REMOTE, GitUtilService.FILES.FILE2.toString()); - String fileContentRemote3 = getFileContent(REPOS.REMOTE, GitUtilService.FILES.FILE3.toString()); - String fileContentRemote4 = getFileContent(REPOS.REMOTE, GitUtilService.FILES.FILE4.toString() + ".jar"); - - return fileContentLocal1.equals(fileContentRemote1) && fileContentLocal2.equals(fileContentRemote2) && fileContentLocal3.equals(fileContentRemote3) - && fileContentLocal4.equals(fileContentRemote4); + return compareFileContent(REPOS.LOCAL, REPOS.REMOTE, FILES.FILE1.toString()) + && compareFileContent(REPOS.LOCAL, REPOS.REMOTE, FILES.FILE2.toString()) + && compareFileContent(REPOS.LOCAL, REPOS.REMOTE, FILES.FILE3.toString()) + && compareFileContent(REPOS.LOCAL, REPOS.REMOTE, FILES.FILE4.toString() + ".jar"); }src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java (1)
847-863
: Inconsistent URL parameter handling between similar methods.The URL parameter handling differs between the two methods:
redirectGetSolutionRepositoryFiles
always includes the parameter:"?omitBinaries=" + omitBinaries
redirectGetTemplateRepositoryFiles
conditionally includes it:(omitBinaries ? "?omitBinaries=" + omitBinaries : "")
Consider using the same approach in both methods for consistency.
- return new ModelAndView("forward:/api/repository/" + participation.getId() + "/files-content" + (omitBinaries ? "?omitBinaries=" + omitBinaries : "")); + return new ModelAndView("forward:/api/repository/" + participation.getId() + "/files-content" + "?omitBinaries=" + omitBinaries);src/main/java/de/tum/cit/aet/artemis/programming/service/GitService.java (1)
1035-1036
: Consider making binary extensions configurable.The list of binary extensions is currently hardcoded. Consider making it configurable through application properties to allow easier customization without code changes.
- List<String> binaryExtensions = List.of(".exe", ".jar", ".dll", ".so", ".class", ".bin"); + @Value("${artemis.version-control.binary-extensions}") + private List<String> binaryExtensions = List.of(".exe", ".jar", ".dll", ".so", ".class", ".bin");
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (14)
src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/PyrisDTOService.java
(2 hunks)src/main/java/de/tum/cit/aet/artemis/programming/service/GitService.java
(1 hunks)src/main/java/de/tum/cit/aet/artemis/programming/service/RepositoryService.java
(2 hunks)src/main/java/de/tum/cit/aet/artemis/programming/service/hestia/TestwiseCoverageService.java
(1 hunks)src/main/java/de/tum/cit/aet/artemis/programming/service/hestia/behavioral/BehavioralTestCaseService.java
(1 hunks)src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java
(2 hunks)src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
(1 hunks)src/main/webapp/app/exercises/programming/manage/services/programming-exercise.service.ts
(2 hunks)src/test/java/de/tum/cit/aet/artemis/programming/GitServiceTest.java
(7 hunks)src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseIntegrationTestService.java
(3 hunks)src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCIntegrationTest.java
(1 hunks)src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java
(2 hunks)src/test/java/de/tum/cit/aet/artemis/programming/util/GitUtilService.java
(4 hunks)src/test/javascript/spec/service/programming-exercise.service.spec.ts
(1 hunks)
👮 Files not reviewed due to content moderation or server errors (4)
- src/main/java/de/tum/cit/aet/artemis/programming/service/hestia/TestwiseCoverageService.java
- src/test/java/de/tum/cit/aet/artemis/programming/GitServiceTest.java
- src/main/java/de/tum/cit/aet/artemis/programming/service/RepositoryService.java
- src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java
🧰 Additional context used
📓 Path-based instructions (14)
src/test/javascript/spec/service/programming-exercise.service.spec.ts (1)
Pattern src/test/javascript/spec/**/*.ts
: jest: true; mock: NgMocks; bad_practices: avoid_full_module_import; perf_improvements: mock_irrelevant_deps; service_testing: mock_http_for_logic; no_schema: avoid_NO_ERRORS_SCHEMA; expectation_specificity: true; solutions: {boolean: toBeTrue/False, reference: toBe, existence: toBeNull/NotNull, undefined: toBeUndefined, class_obj: toContainEntries/toEqual, spy_calls: {not_called: not.toHaveBeenCalled, once: toHaveBeenCalledOnce, with_value: toHaveBeenCalledWith|toHaveBeenCalledExactlyOnceWith}}
src/main/java/de/tum/cit/aet/artemis/programming/service/hestia/TestwiseCoverageService.java (1)
Pattern src/main/java/**/*.java
: 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
src/main/java/de/tum/cit/aet/artemis/programming/web/repository/RepositoryProgrammingExerciseParticipationResource.java (1)
Pattern src/main/java/**/*.java
: 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
src/main/java/de/tum/cit/aet/artemis/programming/service/hestia/behavioral/BehavioralTestCaseService.java (1)
Pattern src/main/java/**/*.java
: 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
src/main/webapp/app/exercises/programming/manage/services/programming-exercise.service.ts (1)
src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCIntegrationTest.java (1)
Pattern src/test/java/**/*.java
: 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
src/main/java/de/tum/cit/aet/artemis/programming/service/RepositoryService.java (1)
Pattern src/main/java/**/*.java
: 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
src/test/java/de/tum/cit/aet/artemis/programming/util/GitUtilService.java (1)
Pattern src/test/java/**/*.java
: 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
src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java (1)
Pattern src/test/java/**/*.java
: 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
src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/PyrisDTOService.java (1)
Pattern src/main/java/**/*.java
: 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
src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseIntegrationTestService.java (1)
Pattern src/test/java/**/*.java
: 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
src/test/java/de/tum/cit/aet/artemis/programming/GitServiceTest.java (1)
Pattern src/test/java/**/*.java
: 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
src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java (1)
Pattern src/main/java/**/*.java
: 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
src/main/java/de/tum/cit/aet/artemis/programming/service/GitService.java (1)
Pattern src/main/java/**/*.java
: 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
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (15)
src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/PyrisDTOService.java (2)
69-69
: Consider enabling binary file filtering for test repository.The
omitBinaries
parameter is set tofalse
, which means binary files will be included in the test repository content. Given the PR's objective to optimize request sizes by excluding binary files, consider setting this totrue
.
160-161
: Consider enabling binary file filtering for repository content.The
omitBinaries
parameter is set tofalse
, which means binary files will be included in the repository content. Given the PR's objective to optimize request sizes by excluding binary files, consider setting this totrue
.Run this script to verify the impact of including binary files:
✅ Verification successful
Consider enabling binary file filtering for repository content.
The
omitBinaries
parameter should be set totrue
to reduce response sizes by excluding binary files from repository content. This aligns with:
- Existing support for binary filtering in repository endpoints
- The PR's objective to optimize request sizes
- Current practices in related services
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for binary files in repositories to assess potential impact. # Search for common binary file extensions echo "Searching for binary files in repositories..." fd -e jar -e class -e war -e ear -e zip -e tar -e gz -e rar -e exe -e dll -e so -e dylib --exec ls -lhLength of output: 2302
Script:
#!/bin/bash # Find usages of getFilesContentFromWorkingCopy rg "getFilesContentFromWorkingCopy" -B 2 -A 2Length of output: 5642
src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCIntegrationTest.java (2)
187-188
: LGTM!The test method correctly tests the scenario where binary files are included.
190-193
: LGTM!Good addition of a test case to verify binary file filtering functionality.
src/main/java/de/tum/cit/aet/artemis/programming/service/hestia/behavioral/BehavioralTestCaseService.java (1)
195-195
: Consider enabling binary file filtering for solution repository.The
omitBinaries
parameter is set tofalse
, which means binary files will be included in the solution repository content. Since this service is used for behavioral test case analysis, which typically focuses on source code, consider setting this totrue
to optimize performance.src/test/java/de/tum/cit/aet/artemis/programming/util/GitUtilService.java (2)
51-51
: LGTM!Good addition of FILE4 to support binary file testing scenarios.
100-100
: LGTM!Good addition of a .jar file to test binary file filtering functionality.
src/test/javascript/spec/service/programming-exercise.service.spec.ts (1)
463-470
: LGTM! Improved request matching flexibility.The custom matcher function is a good improvement as it:
- Makes the tests more maintainable by allowing partial URL matches
- Separates the HTTP method check from the URL matching
- Reduces test brittleness
src/test/java/de/tum/cit/aet/artemis/programming/RepositoryIntegrationTest.java (2)
146-149
: LGTM! Well-structured setup for binary file testing.The binary file setup is implemented correctly using the Path API and follows the test setup pattern used in other parts of the code.
273-288
: LGTM! Comprehensive test coverage for binary file exclusion.The test method effectively verifies that:
- Binary files (.jar) are excluded when omitBinaries=true
- Non-binary files are still included
- The response is not empty
src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseIntegrationTestService.java (2)
Line range hint
2312-2329
: LGTM! Well-structured test method with good separation of concerns.The method effectively handles both binary and non-binary test cases through the omitBinaries parameter, with clean delegation to specific test methods.
2341-2349
: LGTM! Comprehensive test for binary file exclusion.The test method:
- Sets up mixed content (binary and non-binary files)
- Verifies query parameter forwarding
- Uses proper assertions
src/main/webapp/app/exercises/programming/manage/services/programming-exercise.service.ts (1)
627-627
: LGTM! Optimization to reduce request payload size.The addition of
?omitBinaries=true
parameter to HTTP requests will help reduce payload size by excluding binary files from the response.Also applies to: 640-640
src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java (1)
821-837
: LGTM! Well-structured parameter handling.The addition of the optional
omitBinaries
parameter with a default value offalse
is well-implemented and follows RESTful practices.src/main/java/de/tum/cit/aet/artemis/programming/service/GitService.java (1)
1025-1058
: LGTM! Well-implemented binary file filtering.The implementation correctly filters out binary files and maintains backward compatibility through method overloading. The logging of omitted files is helpful for debugging.
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.
Added a few code improvement suggestions:
src/main/java/de/tum/cit/aet/artemis/programming/service/GitService.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/cit/aet/artemis/programming/service/GitService.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/cit/aet/artemis/programming/service/GitService.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/cit/aet/artemis/programming/service/GitService.java
Outdated
Show resolved
Hide resolved
src/main/java/de/tum/cit/aet/artemis/programming/service/RepositoryService.java
Outdated
Show resolved
Hide resolved
src/test/java/de/tum/cit/aet/artemis/programming/GitServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseIntegrationTestService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/main/java/de/tum/cit/aet/artemis/programming/service/GitService.java (2)
99-100
: Consider extending binary extensions list and moving to configuration.While the current list covers common binary formats, consider:
- Adding more binary extensions (e.g.,
.war
,.ear
,.dylib
,.o
,.obj
,.pyc
)- Moving this list to a configuration file for easier maintenance and environment-specific customization
1027-1050
: LGTM! Consider a minor optimization for binary extension checks.The implementation correctly filters binary files while maintaining the original functionality. For better performance with multiple files, consider:
-if (omitBinaries && nextFile.isFile() && BINARY_EXTENSIONS.stream().anyMatch(nextFile.getName()::endsWith)) { +// Create a static Set for O(1) lookup +private static final Set<String> BINARY_EXTENSIONS_SET = Set.of(".exe", ".jar", ".dll", ".so", ".class", ".bin", ".msi"); + +// Use Set.contains for faster lookup +if (omitBinaries && nextFile.isFile() && BINARY_EXTENSIONS_SET.stream().anyMatch(ext -> nextFile.getName().endsWith(ext))) {
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/main/java/de/tum/cit/aet/artemis/programming/service/GitService.java
(2 hunks)src/main/java/de/tum/cit/aet/artemis/programming/service/RepositoryService.java
(2 hunks)src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseIntegrationTestService.java
(3 hunks)src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCIntegrationTest.java
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCIntegrationTest.java
- src/main/java/de/tum/cit/aet/artemis/programming/service/RepositoryService.java
- src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseIntegrationTestService.java
🧰 Additional context used
📓 Path-based instructions (1)
src/main/java/de/tum/cit/aet/artemis/programming/service/GitService.java (1)
Pattern src/main/java/**/*.java
: 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
🔇 Additional comments (1)
src/main/java/de/tum/cit/aet/artemis/programming/service/GitService.java (1)
1056-1059
: LGTM! Good backward compatibility.The overloaded method correctly maintains backward compatibility by defaulting
omitBinaries
to false.
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.
reviewed the code, looks good to me.
These changes will only affect programming-exercise worked on as part of the online editor/diff, right? i am wondering because there might be exercises for which it's valid to include executables (like a library.jar). but this should not be really relevant in this context, right?
src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java
Show resolved
Hide resolved
src/main/java/de/tum/cit/aet/artemis/programming/service/hestia/TestwiseCoverageService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on TS4, binary files are excluded as expected
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.
reviewed the code, changes look good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code 👍
…necessary-files-from-comparison
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good! 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapprove
…necessary-files-from-comparison
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good + tested on TS2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on TS2, works as described.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-approve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on TS2, all works as expected
Checklist
General
Server
Client
Changes affecting Programming Exercises
Motivation and Context
Currently, when comparing the template with the solution submission while editing an exercise, binary files such as .jar are unnecessarily included in the request, increasing its size. This leads to inefficient network usage and potential performance issues. Excluding common binary files (e.g., .jar, .exe) from these REST requests will optimize request payloads, improve responsiveness, and reduce unnecessary data transfer.
(see #9929)
Description
When comparing the template with the solution submission, while the binary files (e.g. jar) are not displayed, they are are included in the request unnecessarily increasing the request size.
Steps for Testing
Prerequisites:
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.
Review Progress
Code Review
Manual Tests
Test Coverage
Summary by CodeRabbit
New Features
omitBinaries
parameter for repository file retrieval endpoints.Improvements
Tests