Refactor: Split connection.go into focused, maintainable files#291
Merged
Refactor: Split connection.go into focused, maintainable files#291
Conversation
Deploying mcpproxy-docs with
|
| Latest commit: |
384cc31
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://40a87fa4.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://refactor-split-connection-fi.mcpproxy-docs.pages.dev |
Fixes #273 Split the massive 3,587-line connection.go into 7 focused, maintainable files: - connection.go (275 lines) - Main Connect() dispatcher, core types - connection_browser.go (95 lines) - Browser launching, GUI detection - connection_docker.go (145 lines) - Docker isolation setup and helpers - connection_stdio.go (451 lines) - Stdio transport and command building - connection_http.go (314 lines) - HTTP/SSE transports and auth strategies - connection_oauth.go (2,189 lines) - All OAuth flows and error handling - connection_lifecycle.go (243 lines) - Initialization and disconnect logic Key achievements: - 92% reduction in main file size (3,587 → 275 lines) - 100% test pass rate - All tests pass - No race conditions - go test -race passes - No linter errors - Clean code quality - No breaking changes - All public APIs preserved - No circular dependencies - Clean dependency flow Testing verified: - All unit tests pass (100+ tests) - Race detection clean - Linter passes - OAuth tests pass - No circular dependencies
2f2f00e to
384cc31
Compare
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 21580829458 --repo smart-mcp-proxy/mcpproxy-go
|
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.
Summary
Refactors the massive 3,587-line
connection.gofile into 7 focused, maintainable files, achieving a 92% reduction in the main file size while maintaining 100% test coverage and zero breaking changes.Fixes #273
Changes
File Structure
Key Improvements
Dependency Hierarchy
Testing
✅ All unit tests pass (100+ tests)
✅ Race detection clean (
go test -race)✅ Linter passes with no errors
✅ OAuth E2E tests pass
✅ No circular dependencies
Commits
Each phase of the extraction was committed separately for reviewability:
Review Notes
Clientstruct (inclient.go)