Skip to content

Commit

Permalink
Add column "review url" to list-review-statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
jheinzel committed Oct 16, 2023
1 parent 09d31bd commit 61e73cf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/TutorBot.Cli/Commands/ListReviewStatisticsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal class ListReviewStatisticsCommand : Command
private async Task HandleAsync(string assignmentName, string classroomName, string order, int? group, bool showAllReviewers)
{
var printer = new TablePrinter();
printer.AddRow("REVIEWER", "GR.", "OWNER", "#REVIEWS", "#COMMENTS", "#WORDS", "LASTREVIEWDATE");
printer.AddRow("REVIEWER", "GR.", "OWNER", "#REV.", "#COMM.", "#WORDS", "LASTREVIEWDATE", "REVIEW URL");

try
{
Expand Down Expand Up @@ -69,13 +69,19 @@ private async Task HandleAsync(string assignmentName, string classroomName, stri
var reviewerDisplayName = reviewer is null ? reviewerName : reviewer.FullName;
var reviewerGroup = reviewer is null ? "-" : reviewer.GroupNr.ToString();

var submission = assignment.Submissions.FirstOrDefault(s => s.Owner == owner);
var pullRequestUrl = submission is not null ?
$"{submission.RepositoryUrl}/pull/{Constants.FEEDBACK_PULLREQUEST_ID}" :
"-";

printer.AddRow(reviewerDisplayName,
reviewerGroup.PadLeft(3),
owner.FullName,
stats.NumReviews.ToString().PadLeft(8),
stats.NumComments.ToString().PadLeft(9),
stats.NumWords.ToString().PadLeft(6),
lastReviewDate);
lastReviewDate,
pullRequestUrl);
}
}

Expand Down

0 comments on commit 61e73cf

Please sign in to comment.