Skip to content

Commit 54636ee

Browse files
authored
@githubpr doesn't know PR assignees (#7356)
Fixes #7349
1 parent e287ca8 commit 54636ee

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/lm/tools/fetchIssueTool.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import * as vscode from 'vscode';
88
import { InMemFileChange } from '../../common/file';
9+
import { isTeam } from '../../github/interface';
910
import { PullRequestModel } from '../../github/pullRequestModel';
1011
import { RepoToolBase } from './toolsUtils';
1112

@@ -32,6 +33,9 @@ export interface FetchIssueResult {
3233
owner?: string;
3334
repo?: string;
3435
fileChanges?: FileChange[];
36+
author?: string;
37+
assignees?: string[];
38+
reviewers?: string[];
3539
}
3640

3741
export class FetchIssueTool extends RepoToolBase<FetchIssueToolParameters> {
@@ -52,7 +56,10 @@ export class FetchIssueTool extends RepoToolBase<FetchIssueToolParameters> {
5256
repo: name,
5357
title: issueOrPullRequest.title,
5458
body: issueOrPullRequest.body,
55-
comments: issueOrPullRequest.item.comments?.map(c => ({ body: c.body, author: c.author.login })) ?? []
59+
comments: issueOrPullRequest.item.comments?.map(c => ({ body: c.body, author: c.author.login })) ?? [],
60+
author: issueOrPullRequest.author?.login,
61+
assignees: issueOrPullRequest.assignees?.map(a => a.login),
62+
reviewers: issueOrPullRequest instanceof PullRequestModel ? issueOrPullRequest.reviewers?.map(r => isTeam(r) ? r.name : r.login).filter((login): login is string => !!login) : undefined
5663
};
5764
if (issueOrPullRequest instanceof PullRequestModel && issueOrPullRequest.isResolved()) {
5865
const fileChanges = await issueOrPullRequest.getFileChangesInfo();

0 commit comments

Comments
 (0)