use better raw file handling and return resources#505
Merged
SamMorrowDrums merged 1 commit intomainfrom Jun 12, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 | New raw 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 | Updated GetFileContents tool to fetch via raw client and return resource results. |
| pkg/github/tools.go, pkg/github/server_test.go | Injected getRawClient into default toolset and server tests. |
| internal/ghmcp/server.go | Configured rawURL in API host and getRawClient 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
SemanticSearchRequesttype 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.EncodeToStringbut theencoding/base64package is not imported; addimport "encoding/base64".
Blob: base64.StdEncoding.EncodeToString(content),
f868c85 to
36f33e9
Compare
This was referenced Jun 12, 2025
tonytrg
previously approved these changes
Jun 12, 2025
ca05920 to
61a760f
Compare
61a760f to
fcdbf3e
Compare
tonytrg
approved these changes
Jun 12, 2025
|
@SamMorrowDrums |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.