-
Notifications
You must be signed in to change notification settings - Fork 357
Development: Add endpoint to fetch participation 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
Merged
krusche
merged 38 commits into
develop
from
feature/programming-exercise-by-repo-identifier
Jul 13, 2025
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
94f4c45
create endpoint to query programming exercise by repo identifier
janthoXO cdd3569
fix server tests with wrong url
janthoXO 994c555
change dto name to use the correct term repo name
janthoXO 152bdb1
use optional nullable for coursedto creation
janthoXO f918b61
adjust formating to fulfil code style
janthoXO 01dc5d6
Merge branch 'develop' of github.com:ls1intum/Artemis into feature/pr…
janthoXO 73c2934
Merge branch 'develop' into feature/programming-exercise-by-repo-iden…
janthoXO 0b67324
make dto more lightweight by using singleton empty collections
janthoXO 898cb9f
Merge branch 'develop' into feature/programming-exercise-by-repo-iden…
janthoXO ea0cda1
Merge branch 'develop' into feature/programming-exercise-by-repo-iden…
janthoXO 7302333
Merge branch 'develop' into feature/programming-exercise-by-repo-iden…
krusche 1ea181b
Merge branch 'develop' into feature/programming-exercise-by-repo-iden…
janthoXO 2dc5762
merge
janthoXO a284981
Merge branch 'feature/programming-exercise-by-repo-identifier' of git…
janthoXO 0b8561e
let endpoint only return participation. results are now fetched by sc…
janthoXO fc131b2
Update src/main/java/de/tum/cit/aet/artemis/programming/web/Programmi…
janthoXO 7a33638
rename to repoUri
janthoXO 5f5ea08
Merge branch 'develop' into feature/programming-exercise-by-repo-iden…
janthoXO b9b8287
allow repository url as well as name + adjust tests
janthoXO 34eb574
Merge branch 'feature/programming-exercise-by-repo-identifier' of git…
janthoXO ec6f743
remove repoUri param
janthoXO b8ade7a
Update src/main/java/de/tum/cit/aet/artemis/programming/domain/VcsRep…
janthoXO 3a0dbc9
adjust dto doc comment
janthoXO 204ef6c
change vcUrl to localVCBaseUrl
janthoXO 494d242
Merge branch 'feature/programming-exercise-by-repo-identifier' of git…
janthoXO 3b20ad1
Merge branch 'develop' into feature/programming-exercise-by-repo-iden…
janthoXO a961b04
merge
janthoXO 58ca62d
Merge branch 'develop' into feature/programming-exercise-by-repo-iden…
janthoXO 4de266d
Merge branch 'develop' into feature/programming-exercise-by-repo-iden…
janthoXO c4b37f2
merge
janthoXO e12ed75
Merge branch 'feature/programming-exercise-by-repo-identifier' of git…
janthoXO 0a86125
Merge branch 'develop' into feature/programming-exercise-by-repo-iden…
Mtze 6f6678a
adjusst param required flag
janthoXO c07b93a
Merge branch 'feature/programming-exercise-by-repo-identifier' of git…
janthoXO 113bf52
include repoName pattern check + adjust doc comments
janthoXO f854ee5
adjust uri building to use segment builder
janthoXO c8fc3a0
adjust pattern match for repo type to be any character except newline
janthoXO b7e1a52
adjust pattern to repotype letters, numbers or dashes
janthoXO File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
...va/de/tum/cit/aet/artemis/programming/dto/RepoNameProgrammingStudentParticipationDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| package de.tum.cit.aet.artemis.programming.dto; | ||
|
|
||
| import java.time.ZonedDateTime; | ||
| import java.util.Optional; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
|
||
| import de.tum.cit.aet.artemis.assessment.domain.AssessmentType; | ||
| import de.tum.cit.aet.artemis.core.domain.Course; | ||
| import de.tum.cit.aet.artemis.exercise.domain.DifficultyLevel; | ||
| import de.tum.cit.aet.artemis.exercise.domain.ExerciseMode; | ||
| import de.tum.cit.aet.artemis.exercise.domain.ExerciseType; | ||
| import de.tum.cit.aet.artemis.exercise.domain.IncludedInOverallScore; | ||
| import de.tum.cit.aet.artemis.programming.domain.ProgrammingExercise; | ||
| import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseStudentParticipation; | ||
| import de.tum.cit.aet.artemis.programming.domain.ProgrammingLanguage; | ||
|
|
||
| /** | ||
| * DTO for the endpoint | ||
| * {@link de.tum.cit.aet.artemis.programming.web.ProgrammingExerciseParticipationResource#getStudentParticipationByRepoName(String)} | ||
| * constructing a participation DTO including exercise and course information | ||
| */ | ||
| @JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
| public record RepoNameProgrammingStudentParticipationDTO(long id, ZonedDateTime individualDueDate, String participantName, String participantIdentifier, String repositoryUri, | ||
| String buildPlanId, String branch, RepoNameProgrammingExerciseDTO exercise) { | ||
|
|
||
| /** | ||
| * Converts a ProgrammingExerciseStudentParticipation into a dto for the endpoint | ||
| * {@link de.tum.cit.aet.artemis.programming.web.ProgrammingExerciseParticipationResource#getStudentParticipationByRepoName(String)}. | ||
| * | ||
| * @param participation to convert | ||
| * @return the converted DTO | ||
| */ | ||
| public static RepoNameProgrammingStudentParticipationDTO of(ProgrammingExerciseStudentParticipation participation) { | ||
| return Optional | ||
| .ofNullable(participation).map(p -> new RepoNameProgrammingStudentParticipationDTO(p.getId(), p.getIndividualDueDate(), p.getParticipantName(), | ||
| p.getParticipantIdentifier(), p.getRepositoryUri(), p.getBuildPlanId(), p.getBranch(), RepoNameProgrammingExerciseDTO.of(p.getProgrammingExercise()))) | ||
| .orElse(null); | ||
| } | ||
|
|
||
| @JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
| public record RepoNameProgrammingExerciseDTO(long id, String problemStatement, String title, String shortName, ZonedDateTime releaseDate, ZonedDateTime startDate, | ||
| ZonedDateTime dueDate, ZonedDateTime assessmentDueDate, Double maxPoints, Double bonusPoints, AssessmentType assessmentType, | ||
| boolean allowComplaintsForAutomaticAssessments, boolean allowFeedbackRequests, DifficultyLevel difficulty, ExerciseMode mode, | ||
| IncludedInOverallScore includedInOverallScore, ExerciseType exerciseType, ZonedDateTime exampleSolutionPublicationDate, RepoNameCourseDTO course, String projectKey, | ||
| ProgrammingLanguage programmingLanguage, Boolean showTestNamesToStudents) { | ||
|
|
||
| /** | ||
| * Converts a ProgrammingExercise into a dto for the endpoint | ||
| * {@link de.tum.cit.aet.artemis.programming.web.ProgrammingExerciseParticipationResource#getStudentParticipationByRepoName(String)}. | ||
| * | ||
| * @param exercise to convert | ||
| * @return the converted DTO | ||
| */ | ||
| public static RepoNameProgrammingExerciseDTO of(ProgrammingExercise exercise) { | ||
| return Optional.ofNullable(exercise) | ||
| .map(e -> new RepoNameProgrammingExerciseDTO(e.getId(), e.getProblemStatement(), e.getTitle(), e.getShortName(), e.getReleaseDate(), e.getStartDate(), | ||
| e.getDueDate(), e.getAssessmentDueDate(), e.getMaxPoints(), e.getBonusPoints(), e.getAssessmentType(), e.getAllowComplaintsForAutomaticAssessments(), | ||
| e.getAllowFeedbackRequests(), e.getDifficulty(), e.getMode(), e.getIncludedInOverallScore(), e.getExerciseType(), e.getExampleSolutionPublicationDate(), | ||
| RepoNameCourseDTO.of(e.getCourseViaExerciseGroupOrCourseMember()), e.getProjectKey(), e.getProgrammingLanguage(), e.getShowTestNamesToStudents())) | ||
| .orElse(null); | ||
| } | ||
| } | ||
|
|
||
| @JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
| public record RepoNameCourseDTO(long id, String title, String shortName) { | ||
|
|
||
| /** | ||
| * Converts a Course into a dto for the endpoint | ||
| * {@link de.tum.cit.aet.artemis.programming.web.ProgrammingExerciseParticipationResource#getStudentParticipationByRepoName(String)}. | ||
| * | ||
| * @param course to convert | ||
| * @return the converted DTO | ||
| */ | ||
| public static RepoNameCourseDTO of(Course course) { | ||
| return Optional.ofNullable(course).map(c -> new RepoNameCourseDTO(c.getId(), c.getTitle(), c.getShortName())).orElse(null); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.