Skip to content

[pull] main from github:main #81

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

Merged
merged 1 commit into from
Jul 17, 2025
Merged

[pull] main from github:main #81

merged 1 commit into from
Jul 17, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented Jul 17, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

* fix: Add SHA to get_file_contents while preserving MCP behavior (#595)

Enhance get_file_contents to include SHA information without changing
the existing MCP server response format.

Changes:
- Add Contents API call to retrieve SHA before fetching raw content
- Include SHA in resourceURI (repo://owner/repo/sha/{SHA}/contents/path)
- Add SHA to success messages
- Update tests to verify SHA inclusion
- Maintain original behavior: text files return raw text, binaries return base64

This preserves backward compatibility while providing SHA information
for better file versioning support.

Closes #595

* fix: Improve error handling for Contents API response

Ensure response body is properly closed even when an error occurs by moving
the defer statement before the error check. This prevents potential resource
leaks when the Contents API returns an error with a non-nil response.

Changes:
- Move defer respContents.Body.Close() before error checking
- Rename errContents to err for consistency
- Add nil check for respContents before attempting to close body

This follows Go best practices for handling HTTP responses and prevents
potential goroutine/memory leaks.

* revert changes to resource URI

* use GraphQL API to get file SHA

* refactor: mock GQL client instead of getFileSHA function to follow conventions

* lint

* revert GraphQL

---------

Co-authored-by: LuluBeatson <lulubeatson@github.com>
@pull pull bot locked and limited conversation to collaborators Jul 17, 2025
@pull pull bot added the ⤵️ pull label Jul 17, 2025
@pull pull bot merged commit 0568187 into codingwatching:main Jul 17, 2025
6 of 7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant