Skip to content

Development: Add endpoint to fetch ProgrammingExerciseStudentParticipation by repo name #10715

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

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

janthoXO
Copy link
Contributor

@janthoXO janthoXO commented Apr 20, 2025

Reopening of too long open PR.

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.
  • 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.

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

The VSCode extension should be able to display the problem statement corresponding to an open repository by the user. Therefore it should be able to fetch all the information needed for that by the repository url.

Description

Adds an endpoint to fetch a student programming participation by the repo name (<vc.url>/git/<project_key>/<repo_name>.git) with the exercise, course, latest submission, last result with feedbacks. If the participation has at least a submission, the all testcases of the exercise are appended to the exercise.
This endpoint will be used to automatically detect an participation from a repository url and display the problem statement to it (therefore course, exercise, testcases, submission, result and feedback are needed).
We could also use multiple endpoints to query each data individually but this would lead to more traffic.

Steps for Testing

Postman testing or code review:

Postman Testing with a student account:

  1. Send a request to POST {{base_url}}/api/core/public/authenticate?tool=SCORPIO to login
  2. Retrieve a repoUrl of any exercise you have access to and at best also a submission (you can get one from GET {{base_url}}/api/core/courses/{courseId}/for-dashboard). The repo url should look like <vc.url>/git/<project_key>/<repo_name>.git
  3. Take the repo_name from that url
  4. Send a request to GET {{base_url}}/api/programming/programming-exercise-participations/repo-name/{repo_name}
  5. verify that this participation was returned with your latest submissions, results, feedbacks and exercise with test cases and course

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 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. (Database query tested on Prod with @bassner)

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Performance Tests

  • Test 1
  • Test 2

Test Coverage

Class/File Line Coverage Confirmation (assert/expect)
Feedback.getTestCaseId() 100%
ProgrammingExerciseParticipationResource 88%
RepoNameProgrammingStudentParticipationDTO.RepoUrlProgrammingExerciseDTO 100%

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Introduced a new API endpoint to retrieve detailed programming exercise participation data by repository name, including submissions, results, feedback, and test cases.
    • Added comprehensive data transfer objects (DTOs) to provide structured participation, submission, result, feedback, exercise, course, and test case information.
    • Enhanced feedback details with test case references for improved traceability.
    • Added support for constructing version control repository URIs from base URLs and repository names.
  • Bug Fixes
    • None.
  • Tests
    • Added integration tests to verify participation retrieval by repository name, including scenarios for successful access, missing data, and access control.

@janthoXO janthoXO self-assigned this Apr 20, 2025
@janthoXO janthoXO requested review from a team and krusche as code owners April 20, 2025 19:15
@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Apr 20, 2025
@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) assessment Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module labels Apr 20, 2025
@janthoXO janthoXO changed the title create endpoint to query programming exercise by repo identifier Programming exercises: Add endpoint to fetch ProgrammingExerciseStudentParticipation by repo identifier Apr 20, 2025
Copy link
Contributor

coderabbitai bot commented Apr 20, 2025

Walkthrough

This change introduces a new REST API endpoint that allows retrieval of a student's programming exercise participation, along with the latest submission, result, feedbacks, and related metadata, using only the repository name as an identifier. To support this, a new DTO structure is defined for detailed and structured responses. Supporting repository and entity changes were made, including new methods for fetching submissions with related results and feedback, and new fields for referencing test cases in feedback. Comprehensive integration tests were added to verify the endpoint's functionality and access control.

Changes

File(s) Change Summary
src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseParticipationResource.java Added a new REST endpoint to retrieve programming exercise participation by repository name, including latest submission, result, and feedbacks. Injected new dependencies (ProgrammingSubmissionRepository, ProgrammingExerciseTestCaseRepository), updated constructor, and implemented access control and response DTO conversion logic.
src/main/java/de/tum/cit/aet/artemis/programming/dto/RepoNameProgrammingStudentParticipationDTO.java Introduced a new record DTO and nested DTOs for structured API responses, including static conversion methods from domain entities.
src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingSubmissionRepository.java Added a repository method to fetch the latest submission with its latest result and feedbacks by participation ID, using a JPQL query with eager fetching.
src/main/java/de/tum/cit/aet/artemis/programming/domain/VcsRepositoryUri.java Added a constructor to build a repository URI from a base URL and repository name, extracting project key and formatting the URI accordingly.
src/main/java/de/tum/cit/aet/artemis/assessment/domain/Feedback.java Added a new field testCaseId (with appropriate JPA annotations) and a getter, allowing feedback to reference a test case by ID without loading the full entity.
src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseParticipationIntegrationTest.java Added multiple integration tests for the new endpoint, covering successful retrieval, retrieval with submissions and results, not found, forbidden access, and exam participation scenarios. Added a helper method for extracting repository names from URIs.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ProgrammingExerciseParticipationResource
    participant ProgrammingSubmissionRepository
    participant ProgrammingExerciseTestCaseRepository

    Client->>ProgrammingExerciseParticipationResource: GET /api/programming/programming-exercise-participations/repo-name/{repoName}
    ProgrammingExerciseParticipationResource->>ProgrammingSubmissionRepository: findLatestWithLatestResultAndFeedbacksByParticipationId()
    ProgrammingExerciseParticipationResource->>ProgrammingExerciseTestCaseRepository: findByExerciseId()
    ProgrammingExerciseParticipationResource-->>Client: ResponseEntity<RepoNameProgrammingStudentParticipationDTO>
Loading

Suggested labels

feature, ready to merge

Suggested reviewers

  • krusche
  • tobias-lippert
  • jfr2102

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f918b61 and 898cb9f.

📒 Files selected for processing (1)
  • src/main/java/de/tum/cit/aet/artemis/programming/dto/RepoNameProgrammingStudentParticipationDTO.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/de/tum/cit/aet/artemis/programming/dto/RepoNameProgrammingStudentParticipationDTO.java
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: client-style
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: server-style
  • GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
  • GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
  • GitHub Check: Build .war artifact
  • GitHub Check: Analyse
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (2)
src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseParticipationResource.java (1)

229-244: Consider adding null checks for feedback.testCaseId.

The code conditionally loads test cases based on whether submissions exist, which is a good optimization. However, when processing feedbacks, there's no explicit check to handle cases where a feedback has a testCaseId that doesn't correspond to an existing test case.

When joining feedback with test cases on the client side, consider adding a safeguard to handle the case of feedbacks referencing non-existent test cases (which could happen if test cases were deleted but feedbacks remain). This could be a client-side check or an additional check in the DTO conversion to ensure data consistency.

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

759-762: Consider improving the repository name extraction method.

The current implementation assumes a specific URI format and may break if the format changes. A more robust approach would use regex or URI parsing.

-    String extractRepoName(String repoUrl) {
-        // <server.url>/git/<project_key>/<repo-name>.git
-        return repoUrl.substring(repoUrl.lastIndexOf("/") + 1, repoUrl.length() - 4);
-    }
+    String extractRepoName(String repoUrl) {
+        // <server.url>/git/<project_key>/<repo-name>.git
+        try {
+            URI uri = new URI(repoUrl);
+            String path = uri.getPath();
+            if (path.endsWith(".git")) {
+                String fileName = path.substring(path.lastIndexOf('/') + 1);
+                return fileName.substring(0, fileName.length() - 4); // Remove .git
+            }
+            return "";
+        } catch (URISyntaxException e) {
+            return "";
+        }
+    }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62da665 and 94f4c45.

📒 Files selected for processing (6)
  • src/main/java/de/tum/cit/aet/artemis/assessment/domain/Feedback.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/domain/VcsRepositoryUri.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/dto/RepoIdentifierProgrammingStudentParticipationDTO.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingSubmissionRepository.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseParticipationResource.java (7 hunks)
  • src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseParticipationIntegrationTest.java (3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`src/main/java/**/*.java`: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,de...

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/repository/ProgrammingSubmissionRepository.java
  • src/main/java/de/tum/cit/aet/artemis/programming/domain/VcsRepositoryUri.java
  • src/main/java/de/tum/cit/aet/artemis/assessment/domain/Feedback.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseParticipationResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/dto/RepoIdentifierProgrammingStudentParticipationDTO.java
`src/test/java/**/*.java`: test_naming: descriptive; test_size: small_specific; fixed_data: true; junit5_features: true; assert_use: assertThat; assert_specificity: true; archunit_...

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/ProgrammingExerciseParticipationIntegrationTest.java
🧬 Code Graph Analysis (1)
src/main/java/de/tum/cit/aet/artemis/programming/domain/VcsRepositoryUri.java (1)
src/main/webapp/app/exercise/exercise-scores/exercise-scores.component.ts (1)
  • projectKey (304-306)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: validate-pr-title
  • GitHub Check: validate-pr-title
  • GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
  • GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
  • GitHub Check: client-style
  • GitHub Check: server-style
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: Build .war artifact
  • GitHub Check: Analyse
🔇 Additional comments (25)
src/main/java/de/tum/cit/aet/artemis/assessment/domain/Feedback.java (2)

85-89: Looks good - added field to efficiently access test case ID without loading the entity.

The new testCaseId field with insertable = false, updatable = false annotations is a good approach to directly access the test case ID without triggering lazy loading of the full ProgrammingExerciseTestCase entity. This design choice improves performance in the new API endpoint.


256-258: Well-implemented getter for new field.

The getter method follows Java bean conventions and completes the implementation of the new field.

src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingSubmissionRepository.java (2)

21-21: Appropriate import addition.

The added import supports the return type of the new repository method.


146-155: Efficient query implementation for retrieving latest submission with results.

The JPQL query efficiently fetches the latest submission with its latest result and associated feedbacks in a single database operation. The query intelligently uses subqueries to get the latest submission and result, and the fetch joins ensure that related entities are loaded eagerly, preventing N+1 query issues.

The return type Optional<Submission> (superclass) instead of Optional<ProgrammingSubmission> (concrete class) provides flexibility without compromising type safety.

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

36-46: 🛠️ Refactor suggestion

Consider adding validation for repository name format.

The constructor extracts the project key by splitting the repository name at the first hyphen. While this works for the expected format, it will fail with an ArrayIndexOutOfBoundsException if the repository name doesn't contain a hyphen.

public VcsRepositoryUri(String vcBaseUrl, String repositoryName) throws URISyntaxException {
-    var projectKey = repositoryName.split("-")[0];
+    String[] parts = repositoryName.split("-", 2);
+    if (parts.length < 1) {
+        throw new IllegalArgumentException("Repository name must contain at least one character");
+    }
+    var projectKey = parts[0];
    this.uri = new URI(vcBaseUrl + "/git/" + projectKey.toUpperCase() + "/" + repositoryName + ".git");
}

Likely an incorrect or invalid review comment.

src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseParticipationResource.java (8)

81-84: Good dependency management for new functionality.

Properly adding the repository and configuration field needed for the new endpoint.


116-117: Appropriate dependency addition.

The test case repository is needed to fetch test cases in the new endpoint.


118-143: Well-structured constructor with appropriate dependencies.

The constructor correctly initializes all required dependencies for the new functionality.


191-210: Well-documented endpoint with proper security annotations.

The endpoint is well-documented with clear Javadoc, appropriate endpoint path mapping, and security annotations. The method signature is clear, and the @AllowedTools annotation properly restricts access to specific tools.


208-213: Good error handling for URI construction.

The code properly wraps the URI construction in a try-catch block and throws a meaningful error message if the repository URL is invalid.


215-223: Comprehensive authorization checks.

The code performs proper authorization checks to ensure the user has permission to access the participation and that the exercise is released.


224-226: Efficient loading of submission data.

The code uses the new repository method to efficiently load the latest submission with its latest result and feedbacks, and properly handles the case where no submission exists by setting an empty set.


245-246: Clean DTO conversion.

The endpoint properly returns a specialized DTO for the response, avoiding potential lazy loading issues and providing a clean API contract.

src/main/java/de/tum/cit/aet/artemis/programming/dto/RepoIdentifierProgrammingStudentParticipationDTO.java (7)

30-49: Well-structured main DTO definition with comprehensive data model.

The Java record approach for DTOs is an excellent choice here, providing immutability and reducing boilerplate. The static of method handles null safety properly with Optional and includes comprehensive data conversion.


51-70: Proper implementation of submission DTO with appropriate fields.

The submission DTO correctly includes all necessary fields for the client and properly handles collection conversion with null-safety through Optional.


72-91: Results DTO correctly models test case statistics.

All the critical fields for representing test results are properly included, with appropriate null handling and collection transformation.


93-108: Feedback DTO includes essential testCaseId for traceability.

The inclusion of testCaseId in the feedback DTO is a good design choice, enabling the client to correlate feedback with specific test cases without requiring additional requests.


110-133: ProgrammingExercise DTO provides comprehensive exercise data.

This record includes all essential fields for displaying exercise information, with proper null handling and collection transformation. The inclusion of test cases is particularly useful for the client's needs.


135-148: Minimal but sufficient Course DTO.

The Course DTO only includes the essential fields (id, title, shortName) needed for display, adhering to the principle of minimizing DTO data to only what's required.


150-165: TestCase DTO includes all relevant fields for test case display.

The TestCase DTO properly includes visibility information that will be essential for displaying appropriate test case information to students based on their permissions.

src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseParticipationIntegrationTest.java (5)

660-676: Basic repository name retrieval test is properly implemented.

The test verifies the basic functionality of retrieving a participation by repository name, including checking that the returned data has the expected structure and that test cases are null when not eagerly loaded. The helper method extractRepoName correctly parses the repository name from the URI.


678-714: Comprehensive test for retrieving participation with results and feedbacks.

This test thoroughly verifies that:

  1. The endpoint returns both participation and related data
  2. The latest submission and result are correctly included
  3. Feedback data includes test case IDs
  4. Test cases are appropriately included in the exercise data

The test coverage is comprehensive and validates all aspects of the DTO structure.


716-734: Not-found case is properly tested.

The test correctly verifies the 404 response for non-existent repository names, using a robust approach to generate a valid but non-existent repository URL to avoid false positives.


736-743: Access control for unauthorized users is properly tested.

The test correctly verifies that a student cannot access another student's participation by repository name, expecting and asserting the appropriate 403 Forbidden status code.


745-757: Exam-specific access control is properly tested.

The test verifies that exam participations cannot be accessed through this endpoint, correctly ensuring that exam security is maintained.

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 20, 2025
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran196 passed3 skipped2 failed51m 46s 250ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 2s 984ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure1m 43s 503ms

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 20, 2025
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran196 passed3 skipped2 failed49m 54s 783ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 3s 34ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure1m 44s 508ms

@tobikli
Copy link
Member

tobikli commented Apr 21, 2025

Quick question: are the (new) api endpoints in the "Steps for Testing" section correct? I had trouble using these for testing

@janthoXO janthoXO changed the title Programming exercises: Add endpoint to fetch ProgrammingExerciseStudentParticipation by repo identifier Programming exercises: Add endpoint to fetch ProgrammingExerciseStudentParticipation by repo name Apr 21, 2025
@janthoXO
Copy link
Contributor Author

Quick question: are the (new) api endpoints in the "Steps for Testing" section correct? I had trouble using these for testing

You are right the description should be updated now

Copy link

End-to-End (E2E) Test Results Summary

tobikli
tobikli previously approved these changes Apr 24, 2025
Copy link
Member

@tobikli tobikli left a comment

Choose a reason for hiding this comment

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

reapprove

Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran196 passed3 skipped2 failed52m 59s 415ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 3s 187ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure1m 45s 142ms

@helios-aet helios-aet bot temporarily deployed to artemis-test1.artemis.cit.tum.de April 25, 2025 09:17 Inactive
HawKhiem
HawKhiem previously approved these changes Apr 25, 2025
Copy link

@HawKhiem HawKhiem left a comment

Choose a reason for hiding this comment

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

Reapprove

ShuaiweiYu
ShuaiweiYu previously approved these changes Apr 25, 2025
Copy link
Contributor

@ShuaiweiYu ShuaiweiYu left a comment

Choose a reason for hiding this comment

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

code changes looks good to me

Copy link
Collaborator

@MaximilianAnzinger MaximilianAnzinger left a comment

Choose a reason for hiding this comment

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

I noted just one suggestion but this applies to all other appearances.

public static RepoNameSubmissionDTO of(ProgrammingSubmission submission) {
return Optional.ofNullable(submission)
.map(s -> new RepoNameSubmissionDTO(s.getId(), s.isSubmitted(), s.getSubmissionDate(), s.getType(), s.isExampleSubmission(), s.getDurationInMinutes(),
Optional.ofNullable(s.getResults()).orElse(List.of()).stream().filter(Objects::nonNull).map(RepoNameResultDTO::of).toList(), s.getCommitHash(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Optional.ofNullable(s.getResults()).orElse(List.of()).stream().filter(Objects::nonNull).map(RepoNameResultDTO::of).toList(), s.getCommitHash(),
Optional.ofNullable(s.getResults()).orElse(Collections.emptyList()).stream().filter(Objects::nonNull).map(RepoNameResultDTO::of).toList(), s.getCommitHash(),

This is a more lightweight since it returns a singleton EMPTY_LIST rather than creating a new object every time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good i will incorporate it as soon as possible

@krusche krusche changed the title Programming exercises: Add endpoint to fetch ProgrammingExerciseStudentParticipation by repo name Development: Add endpoint to fetch ProgrammingExerciseStudentParticipation by repo name Apr 26, 2025
@helios-aet helios-aet bot temporarily deployed to artemis-test6.artemis.cit.tum.de April 27, 2025 10:47 Inactive
chuuuun
chuuuun previously approved these changes Apr 27, 2025
Copy link

@chuuuun chuuuun left a comment

Choose a reason for hiding this comment

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

Tested on ts6, user 4. Worked as expected

Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran196 passed3 skipped2 failed51m 42s 528ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 2s 841ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure1m 43s 766ms

@helios-aet helios-aet bot temporarily deployed to artemis-test5.artemis.cit.tum.de April 28, 2025 12:00 Inactive
Copy link

@HawKhiem HawKhiem left a comment

Choose a reason for hiding this comment

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

Retested on TS5. Works as described

image

Copy link
Collaborator

@MaximilianAnzinger MaximilianAnzinger left a comment

Choose a reason for hiding this comment

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

Thank you for incorporating my feedback!

Copy link
Member

@tobikli tobikli left a comment

Choose a reason for hiding this comment

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

reapprove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assessment 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.

6 participants