-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] feat(github): add code for listing/reviewing/getting PRs on Github #308
base: main
Are you sure you want to change the base?
[DRAFT] feat(github): add code for listing/reviewing/getting PRs on Github #308
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick self-review / todos:
@@ -706,7 +709,7 @@ async function getIssue( | |||
"User-Agent": "github-mcp-server", | |||
}, | |||
} | |||
); | |||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: remove
@@ -299,7 +299,7 @@ export const GitHubPullRequestSchema = z.object({ | |||
locked: z.boolean(), | |||
title: z.string(), | |||
user: GitHubIssueAssigneeSchema, | |||
body: z.string(), | |||
body: z.string().nullable(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started noticing that body can be nullable across multiple schemas on LIST api requests for GitHub API. JFYI.
export const GetPullRequestDiffSchema = z.object({ | ||
owner: z.string().describe("Repository owner (username or organization)"), | ||
repo: z.string().describe("Repository name"), | ||
pull_number: z.number().describe("Pull request number"), | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not finished yet.
case "get_pull_request_diff": { | ||
const args = GetPullRequestDiffSchema.parse(request.params.arguments); | ||
const diff = await getPullRequestDiff(args.owner, args.repo, args.pull_number); | ||
return { toolResult: diff }; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not finished/tested yet.
export type ReviewPullRequest = z.infer<typeof ReviewPullRequestSchema>; | ||
export type SearchCode = z.infer<typeof SearchCodeSchema>; | ||
export type SearchIssues = z.infer<typeof SearchIssuesSchema>; | ||
export type SearchUsers = z.infer<typeof SearchUsersSchema>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: add line to the end
export type SearchCode = z.infer<typeof SearchCodeSchema>; | ||
export type SearchIssues = z.infer<typeof SearchIssuesSchema>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if those types are actually used, todo: verify
Thanks! Converting this to a draft to make its status clear. Please mark as "ready for review" when you'd like us to take a look! |
Description
Adding functionality to List, Review and Get info on Github PRs.
Pending adding functionality to get PR diffs(right now it's not returned). Will mark as ready once finishing that.
Server Details
github
tools
Motivation and Context
Thought of adding functionality to review and list PRs on private/public repos on Github.
How Has This Been Tested?
Verified manually via Claude Desktop.
Breaking Changes
None.
Types of changes
Checklist
Additional context
n/a