Add mobile Tasks parity (#2452)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinwoo Hong
2026-05-21 20:26:07 -07:00
committed by GitHub
co-authored by Orca
parent 3efc669bd4
commit b1973657ea
123 changed files with 26492 additions and 1461 deletions
@@ -300,6 +300,34 @@ describe('github RPC methods', () => {
expect(response).toMatchObject({ ok: true, result: true })
})
it('updates PR metadata on the runtime server', async () => {
const runtime = {
getRuntimeId: () => 'test-runtime',
updateRepoPRDetails: vi.fn().mockResolvedValue({ ok: true })
} as unknown as OrcaRuntimeService
const dispatcher = new RpcDispatcher({ runtime, methods: GITHUB_METHODS })
const response = await dispatcher.dispatch(
makeRequest('github.updatePR', {
repo: 'repo-1',
prNumber: 7,
updates: { title: 'New title', body: 'Updated body' },
prRepo: { owner: 'acme', repo: 'widgets' }
})
)
expect(runtime.updateRepoPRDetails).toHaveBeenCalledWith(
'repo-1',
7,
{ title: 'New title', body: 'Updated body' },
{
owner: 'acme',
repo: 'widgets'
}
)
expect(response).toMatchObject({ ok: true, result: { ok: true } })
})
it('merges PRs on the runtime server', async () => {
const runtime = {
getRuntimeId: () => 'test-runtime',
@@ -323,6 +351,35 @@ describe('github RPC methods', () => {
expect(response).toMatchObject({ ok: true, result: { ok: true } })
})
it('routes PR reviewer mutations on the runtime server', async () => {
const runtime = {
getRuntimeId: () => 'test-runtime',
requestRepoPRReviewers: vi.fn().mockResolvedValue({ ok: true }),
removeRepoPRReviewers: vi.fn().mockResolvedValue({ ok: true })
} as unknown as OrcaRuntimeService
const dispatcher = new RpcDispatcher({ runtime, methods: GITHUB_METHODS })
const requestResponse = await dispatcher.dispatch(
makeRequest('github.requestPRReviewers', {
repo: 'repo-1',
prNumber: 7,
reviewers: ['octo']
})
)
const removeResponse = await dispatcher.dispatch(
makeRequest('github.removePRReviewers', {
repo: 'repo-1',
prNumber: 7,
reviewers: ['octo']
})
)
expect(runtime.requestRepoPRReviewers).toHaveBeenCalledWith('repo-1', 7, ['octo'])
expect(runtime.removeRepoPRReviewers).toHaveBeenCalledWith('repo-1', 7, ['octo'])
expect(requestResponse).toMatchObject({ ok: true, result: { ok: true } })
expect(removeResponse).toMatchObject({ ok: true, result: { ok: true } })
})
it('updates PR state on the runtime server', async () => {
const runtime = {
getRuntimeId: () => 'test-runtime',