-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/leaderboard-page
- Loading branch information
Showing
45 changed files
with
902 additions
and
178 deletions.
There are no files selected for viewing
This file contains 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 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 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
31 changes: 31 additions & 0 deletions
31
...in/java/de/tum/in/www1/hephaestus/codereview/comment/review/PullRequestReviewComment.java
This file contains 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,31 @@ | ||
package de.tum.in.www1.hephaestus.codereview.comment.review; | ||
|
||
import org.springframework.lang.NonNull; | ||
|
||
import de.tum.in.www1.hephaestus.codereview.base.Comment; | ||
import de.tum.in.www1.hephaestus.codereview.pullrequest.review.PullRequestReview; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.Table; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.ToString; | ||
|
||
@Entity | ||
@Table(name = "pull_request_review_comment") | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@ToString(callSuper = true) | ||
public class PullRequestReviewComment extends Comment { | ||
@ManyToOne(fetch = FetchType.EAGER) | ||
@JoinColumn(name = "review_id", referencedColumnName = "id") | ||
@ToString.Exclude | ||
private PullRequestReview review; | ||
|
||
@NonNull | ||
private String commit; | ||
} |
22 changes: 22 additions & 0 deletions
22
...e/tum/in/www1/hephaestus/codereview/comment/review/PullRequestReviewCommentConverter.java
This file contains 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,22 @@ | ||
package de.tum.in.www1.hephaestus.codereview.comment.review; | ||
|
||
import org.kohsuke.github.GHPullRequestReviewComment; | ||
import org.springframework.lang.NonNull; | ||
import org.springframework.stereotype.Component; | ||
|
||
import de.tum.in.www1.hephaestus.codereview.base.BaseGitServiceEntityConverter; | ||
|
||
@Component | ||
public class PullRequestReviewCommentConverter | ||
extends BaseGitServiceEntityConverter<GHPullRequestReviewComment, PullRequestReviewComment> { | ||
|
||
@Override | ||
public PullRequestReviewComment convert(@NonNull GHPullRequestReviewComment source) { | ||
PullRequestReviewComment comment = new PullRequestReviewComment(); | ||
convertBaseFields(source, comment); | ||
comment.setBody(source.getBody()); | ||
comment.setCommit(source.getCommitId()); | ||
return comment; | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
.../tum/in/www1/hephaestus/codereview/comment/review/PullRequestReviewCommentRepository.java
This file contains 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,7 @@ | ||
package de.tum.in.www1.hephaestus.codereview.comment.review; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface PullRequestReviewCommentRepository extends JpaRepository<PullRequestReviewComment, Long> { | ||
|
||
} |
This file contains 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 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 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 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 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
9 changes: 9 additions & 0 deletions
9
...r/src/main/java/de/tum/in/www1/hephaestus/codereview/repository/RepositoryRepository.java
This file contains 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 |
---|---|---|
@@ -1,10 +1,19 @@ | ||
package de.tum.in.www1.hephaestus.codereview.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
@org.springframework.stereotype.Repository | ||
public interface RepositoryRepository | ||
extends JpaRepository<Repository, Long> { | ||
|
||
Repository findByNameWithOwner(String nameWithOwner); | ||
|
||
@Query(""" | ||
SELECT r | ||
FROM Repository r | ||
JOIN FETCH r.pullRequests | ||
WHERE r.nameWithOwner = :nameWithOwner | ||
""") | ||
Repository findByNameWithOwnerWithEagerPullRequests(String nameWithOwner); | ||
} |
Oops, something went wrong.