Show GitHub PR reviewer names in task rows (#2309)

This commit is contained in:
Jinjing
2026-05-18 23:06:54 -07:00
committed by GitHub
parent 94f47c3e32
commit a6ca940d0f
16 changed files with 1257 additions and 369 deletions
+35 -5
View File
@@ -84,6 +84,7 @@ vi.mock('./rate-limit', () => ({
import {
getPRComments,
getPRForBranch,
getWorkItem,
getPullRequestPushTarget,
mergePR,
resolveReviewThread,
@@ -824,17 +825,46 @@ describe('getPRForBranch', () => {
remoteName: 'origin',
branchName: 'feature/test'
})
expect(ghExecFileAsyncMock).toHaveBeenNthCalledWith(
1,
['api', 'repos/fork/orca/pulls/1849'],
{ cwd: '/repo-root' }
)
expect(ghExecFileAsyncMock).toHaveBeenNthCalledWith(1, ['api', 'repos/fork/orca/pulls/1849'], {
cwd: '/repo-root'
})
expect(ghExecFileAsyncMock).toHaveBeenNthCalledWith(
2,
['api', 'repos/stablyai/orca/pulls/1849'],
{ cwd: '/repo-root' }
)
})
it('normalizes reviewer avatars from REST pull request payloads', async () => {
getOwnerRepoMock.mockResolvedValueOnce({ owner: 'acme', repo: 'widgets' })
ghExecFileAsyncMock.mockResolvedValueOnce({
stdout: JSON.stringify({
number: 42,
title: 'Review me',
state: 'open',
html_url: 'https://github.com/acme/widgets/pull/42',
labels: [],
updated_at: '2026-03-28T00:00:00Z',
user: { login: 'author' },
draft: false,
requested_reviewers: [
{
login: 'AmethystLiang',
avatar_url: 'https://avatars.githubusercontent.com/u/1?v=4'
}
]
})
})
await expect(getWorkItem('/repo-root', 42, 'pr')).resolves.toMatchObject({
reviewRequests: [
{
login: 'AmethystLiang',
avatarUrl: 'https://avatars.githubusercontent.com/u/1?v=4'
}
]
})
})
})
describe('GitHub GraphQL rate-limit guard', () => {