fix: address review findings (#2206)

This commit is contained in:
Jinjing
2026-05-17 20:15:05 -07:00
committed by GitHub
parent 4634ffb4d3
commit e4a794ec68
20 changed files with 2244 additions and 193 deletions
+39
View File
@@ -62,6 +62,11 @@ const PullRequestChecks = PullRequest.extend({
headSha: OptionalString
})
const RerunPullRequestChecks = PullRequest.extend({
headSha: OptionalString,
failedOnly: z.boolean().optional()
})
const PullRequestFileContents = RepoSelector.extend({
prNumber: z.number().int().positive(),
path: requiredString('Missing file path'),
@@ -92,6 +97,18 @@ const MergePr = RepoSelector.extend({
method: z.enum(['merge', 'squash', 'rebase']).optional()
})
const UpdatePrState = RepoSelector.extend({
prNumber: z.number().int().positive(),
updates: z.object({
state: z.enum(['open', 'closed'])
})
})
const RequestPrReviewers = RepoSelector.extend({
prNumber: z.number().int().positive(),
reviewers: z.array(z.string()).min(1)
})
const CreateIssue = RepoSelector.extend({
title: requiredString('Missing title'),
body: z.string()
@@ -188,6 +205,7 @@ const SlugPullRequestUpdate = z.object({
repo: requiredString('Missing repo'),
number: z.number().int().positive(),
updates: z.object({
state: z.enum(['open', 'closed']).optional(),
title: OptionalString,
body: OptionalString
})
@@ -294,6 +312,15 @@ export const GITHUB_METHODS: RpcMethod[] = [
noCache: params.noCache
})
}),
defineMethod({
name: 'github.rerunPRChecks',
params: RerunPullRequestChecks,
handler: async (params, { runtime }) =>
runtime.rerunRepoPRChecks(params.repo, params.prNumber, {
headSha: params.headSha,
failedOnly: params.failedOnly
})
}),
defineMethod({
name: 'github.prComments',
params: PullRequest,
@@ -341,6 +368,18 @@ export const GITHUB_METHODS: RpcMethod[] = [
handler: async (params, { runtime }) =>
runtime.mergeRepoPR(params.repo, params.prNumber, params.method)
}),
defineMethod({
name: 'github.updatePRState',
params: UpdatePrState,
handler: async (params, { runtime }) =>
runtime.updateRepoPRState(params.repo, params.prNumber, params.updates)
}),
defineMethod({
name: 'github.requestPRReviewers',
params: RequestPrReviewers,
handler: async (params, { runtime }) =>
runtime.requestRepoPRReviewers(params.repo, params.prNumber, params.reviewers)
}),
defineMethod({
name: 'github.createIssue',
params: CreateIssue,