- Notifications
You must be signed in to change notification settings - Fork3k
Update mcp server with latest google/go-github API#1358
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
e7f625a toa6d80e1Compare0a402d8 tofc1471dComparea6d80e1 tofcf7fd5Comparefc1471d tofce10aeComparefcf7fd5 to5a4a278Compare5a4a278 to4d6a90aCompare4c97a67 tob1183b4Compareeac7899 to3e3ab15CompareThere 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.
Pull Request Overview
This pull request refactors GitHub Projects V2 API integration by migrating from manual HTTP request construction to using the go-github SDK's native client methods, and updates field ID handling to useint64 instead of strings.
- Introduces
RequiredBigIntandOptionalBigIntArrayParamhelper functions to handle large integer field/item IDs - Migrates multiple project-related functions to use go-github SDK methods (ListProjectFields, GetProjectField, ListProjectItems, AddProjectItem, DeleteProjectItem)
- Updates field ID representation from
[]stringto[]int64with comma-separated URL encoding
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| pkg/github/server.go | Adds helper functions for handling large integers (RequiredBigInt, OptionalBigIntArrayParam) and conversion utilities for string-to-int64 conversion |
| pkg/github/projects.go | Migrates project API calls to use go-github SDK methods, updates data structures to use int64 for IDs, and removes obsolete custom types now replaced by SDK types |
| pkg/github/projects_test.go | Updates test assertions to check for comma-separated field parameters instead of array-style parameters |
💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| } | ||
| projectItems:= []projectV2Item{} | ||
| varresp*github.Response | ||
| varprojectItems []*github.ProjectV2Item |
stephenotaloraNov 6, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Standardized field parameters has changed from array notation (fields[]=123&fields[]=456) to comma-separated format (fields=123,456,789).
Why this change was needed:
- The comma-separated format is handled natively by the
github.com/google/go-querystringlibrary using the,commatag option - Eliminates manual URL encoding complexity in our code
- Better aligns with Go's standard query parameter handling patterns
- Our tests in
projects_test.goconfirm the comma format works correctly:fieldParams == "123,456,789"
Technical details: ThefieldSelectionOptions struct now usesurl:"fields,omitempty,comma" which leverages go-querystring's built-in comma support rather than custom array parameter logic.
SeeListProjectItemsOptions struct
// ListProjectItemsOptions specifies optional parameters when listing project items.// Note: Pagination uses before/after cursor-style pagination similar to ListProjectsOptions.// "Fields" can be used to restrict which field values are returned (by their numeric IDs).typeListProjectItemsOptionsstruct {// Embed ListProjectsOptions to reuse pagination and query parameters.ListProjectsOptions// Fields restricts which field values are returned by numeric field IDs.Fields []int64`url:"fields,omitempty,comma"`}
I have also updated this internally to align the MCP server with the underlyinggoogle/go-github dependency since we're not quite ready to migrateGetProjectItem yet as per this PR's description.
| fieldParams:=q["fields"] | ||
| iflen(fieldParams)==3&&fieldParams[0]=="123"&&fieldParams[1]=="456"&&fieldParams[2]=="789" { | ||
| fieldParams:=q.Get("fields") | ||
| iffieldParams=="123,456,789" { |
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.
see thiscomment in relation to this change.
b1183b4 tofab59ebCompare0743dcb tofd09a4aCompare…of Update and Delete items
… underlying library implementation
fd09a4a to7cb55a6Compare
kerobbi left a comment
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.
Lgtm!
b68bec0 intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Towardshttps://github.com/github/memex/issues/20995
Depends on#1357
Overview
This PR updates the MCP server to utilize the latest
google/go-githubAPI for interacting with GitHub projects, more specifically the ability to perform CRUD operations introduced ingoogle/go-github@V77.Details
google/go-githublibrary, replacing previous implementations.Outstanding Work
The only toolsets that havenot yet been migrated to use
google/go-githubare:GetProjectItemandUpdateProjectItem.This is due to notable differences in parameter handling between the
google/go-githublibrary and GitHub's RESTful API. Specifically, the way parameters must be passed for these endpoints does not fully align with the current library's abstractions, making a straightforward migration infeasible.I am actively working to resolve these discrepancies and plan to make further adjustments within
google/go-githubto support these use cases.Update:
I have openedgoogle/go-github#3809 to resolve issues with
GetProjectItemandUpdateProjectItemthat came up during integration. The PR is ready for review and currently waiting on maintainers’ input.Next Steps
GetProjectItemandUpdateProjectItemby contributing necessary changes upstream.