- Notifications
You must be signed in to change notification settings - Fork1.1k
use better raw file handling and return resources#505
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
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.
Pull Request Overview
This PR refactors file handling by introducing a dedicated raw content client and updating existing resource and tool handlers to return structured text or blob resources. It also updates the server bootstrap, default toolset configuration, mocks, and tests to support the new raw client, and adds missing third-party LICENSE files and updated license listings.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
third-party/*/LICENSE | Added missing LICENSE files for vendored third-party dependencies. |
third-party-licenses.{windows,linux,darwin}.md | Updated markdown lists to include new BSD-3-Clause dependencies. |
pkg/raw/raw.go, pkg/raw/raw_mock.go, pkg/raw/raw_test.go | Newraw package: client adapter, mocks, and tests for raw API. |
pkg/github/repository_resource.go, pkg/github/repository_resource_test.go | Updated resource handler to use raw client and return resources. |
pkg/github/repositories.go, pkg/github/repositories_test.go | UpdatedGetFileContents tool to fetch via raw client and return resource results. |
pkg/github/tools.go, pkg/github/server_test.go | InjectedgetRawClient into default toolset and server tests. |
internal/ghmcp/server.go | ConfiguredrawURL in API host andgetRawClient in server setup. |
pkg/github/helper_test.go | New test helpers for extracting text and blob resources. |
Comments suppressed due to low confidence (2)
pkg/raw/raw.go:22
- The
SemanticSearchRequest
type is unrelated to raw file handling and is unused; consider removing it to keep the package focused.
type SemanticSearchRequest struct {
pkg/github/repository_resource.go:176
- The code uses
base64.StdEncoding.EncodeToString
but theencoding/base64
package is not imported; addimport "encoding/base64"
.
Blob: base64.StdEncoding.EncodeToString(content),
Uh oh!
There was an error while loading.Please reload this page.
3e32f75
intomainUh oh!
There was an error while loading.Please reload this page.
ko1ynnky commentedJun 12, 2025
@SamMorrowDrums |
Uh oh!
There was an error while loading.Please reload this page.
Closes#372
This PR attempts to address some initially poor choices for how do handle files and resources.
#497
CC@ko1ynnky I decided to go a bit further and getting very good results now. Thanks for the encouragement.