Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 23 additions & 20 deletions src/GitHub.InlineReviews/Services/PullRequestSessionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ public virtual Task<PullRequestDetailModel> ReadPullRequestDetail(HostAddress ad
async Task<PullRequestDetailModel> ReadPullRequestDetailWithResolved(HostAddress address, string owner,
string name, int number, bool refresh)
{
var itemTypes = new[] { PullRequestTimelineItemsItemType.IssueComment, PullRequestTimelineItemsItemType.PullRequestCommit };

if (readPullRequestWithResolved == null)
{
Expand Down Expand Up @@ -384,22 +385,22 @@ async Task<PullRequestDetailModel> ReadPullRequestDetailWithResolved(HostAddress
AvatarUrl = review.Author.AvatarUrl(null)
}
}).ToList(),
Timeline = pr.Timeline(null, null, null, null, null).AllPages().Select(item => item.Switch<object>(when =>
when.Commit(commit => new CommitModel
Timeline = pr.TimelineItems(null, null, null, null, itemTypes, null, null).AllPages().Select(item => item.Switch<object>(when =>
when.PullRequestCommit(commit => new CommitModel
{
AbbreviatedOid = commit.AbbreviatedOid,
AbbreviatedOid = commit.Commit.AbbreviatedOid,
Author = new CommitActorModel
{
Name = commit.Author.Name,
Email = commit.Author.Email,
User = commit.Author.User != null ? new ActorModel
Name = commit.Commit.Author.Name,
Email = commit.Commit.Author.Email,
User = commit.Commit.Author.User != null ? new ActorModel
{
Login = commit.Author.User.Login,
AvatarUrl = commit.Author.User.AvatarUrl(null),
Login = commit.Commit.Author.User.Login,
AvatarUrl = commit.Commit.Author.User.AvatarUrl(null),
} : null
},
MessageHeadline = commit.MessageHeadline,
Oid = commit.Oid,
MessageHeadline = commit.Commit.MessageHeadline,
Oid = commit.Commit.Oid,
}).IssueComment(comment => new CommentModel
{
Author = new ActorModel
Expand Down Expand Up @@ -491,6 +492,8 @@ async Task<PullRequestDetailModel> ReadPullRequestDetailWithResolved(HostAddress
async Task<PullRequestDetailModel> ReadPullRequestDetailWithoutResolved(HostAddress address, string owner,
string name, int number, bool refresh)
{
var itemTypes = new[] { PullRequestTimelineItemsItemType.IssueComment, PullRequestTimelineItemsItemType.PullRequestCommit };

if (readPullRequestWithoutResolved == null)
{
readPullRequestWithoutResolved = new Query()
Expand Down Expand Up @@ -563,21 +566,21 @@ async Task<PullRequestDetailModel> ReadPullRequestDetailWithoutResolved(HostAddr
Url = comment.Url,
}).ToList(),
}).ToList(),
Timeline = pr.Timeline(null, null, null, null, null).AllPages().Select(item => item.Switch<object>(when =>
when.Commit(commit => new CommitModel
Timeline = pr.TimelineItems(null, null, null, null, itemTypes, null, null).AllPages().Select(item => item.Switch<object>(when =>
when.PullRequestCommit(commit => new CommitModel
{
AbbreviatedOid = commit.AbbreviatedOid,
AbbreviatedOid = commit.Commit.AbbreviatedOid,
Author = new CommitActorModel {
Name = commit.Author.Name,
Email = commit.Author.Email,
User = commit.Author.User != null ? new ActorModel
Name = commit.Commit.Author.Name,
Email = commit.Commit.Author.Email,
User = commit.Commit.Author.User != null ? new ActorModel
{
Login = commit.Author.User.Login,
AvatarUrl = commit.Author.User.AvatarUrl(null),
Login = commit.Commit.Author.User.Login,
AvatarUrl = commit.Commit.Author.User.AvatarUrl(null),
} : null
},
MessageHeadline = commit.MessageHeadline,
Oid = commit.Oid,
MessageHeadline = commit.Commit.MessageHeadline,
Oid = commit.Commit.Oid,
}).IssueComment(comment => new CommentModel
{
Author = new ActorModel
Expand Down