Conversation
…eadability: - Separate concerns into helper functions (e.g., `resolveContextAndClient`, `buildPodLogOptions`, `readPodLogStream`). - Simplify `GetPodLogs`, `ListPods`, and `convertPodToK8sPodDetail` methods. - Modularize container port/resource handling and endpoint processing for cleaner code.
…y introducing helper functions `forwardMatchesSearch` and `forwardMatchesFilters`.
…owSizeMsg`, `handleKeyMsg`, and `handleMouseMsg` helper methods.
…troducing helper functions `calculateServiceStatus`, `matchesSearch`, and `serviceMatchesFilters`.
…methods `handleFilterKeyMsg`, `handleNormalKeyMsg`, and `handleMouseMsg`.
…oducing reusable comparison helper functions.
…er functions `buildConnectionInfoFromService`, `findServiceInState`, and `searchServicesByName`.
…thods `handlePodAddedEvent`, `handlePodStatusChangedEvent`, `handleServiceRemovedEvent`, and utility functions `buildForwardKey` and `parseStatusString`.
…determinePodStatusString`, `sortAndLimitEvents`, and `convertEventsToK8sEvents` helper functions.
- Includes tests for `buildPortMappings`, `setupPodAddedSubscription`, `waitForPodAdded`, `checkPodForwarded`, `determinePodStatusString`, `sortAndLimitEvents`, and `convertEventsToK8sEvents`.
…r function for modularity
…iceHostname` helper function.
…eMCPServiceStatus` helper function.
- Includes tests for `buildConnectionInfoFromService`, `findServiceInState`, `searchServicesByName`, and `calculateMCPServiceStatus`.
…ming, modularization of state access, and improved function naming.
…ks, improving clarity around unused parameters.
…nderscores, and improve consistency with helper functions.
…s and test helpers, and ensure consistent error handling in HTTP responses.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #369 +/- ##
==========================================
+ Coverage 80.48% 81.07% +0.59%
==========================================
Files 70 70
Lines 12620 12662 +42
==========================================
+ Hits 10157 10266 +109
+ Misses 2050 1992 -58
+ Partials 413 404 -9
🚀 New features to boost your workflow:
|
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.
Fix all GoLand default lint warnings to ensure code passes IDE lint checks that most maintainers use. This includes:
Focus,EventType,MouseButton)__ =for intentionally ignored errors in test HTTP handlershandlePodStatusChangedhelper to keep functions under thresholdType of Change
Related Issues
Fixes # (GoLand lint compliance)
Testing
go test ./...locallyChecklist
go fmt,go vet)Screenshots/Logs (if applicable)
Before
After
Changes Summary
Switch Statement Fixes
pkg/fwdtui/ui.go:152EventTypecasespkg/fwdtui/ui.go:789,818FocusDetailcasepkg/fwdtui/components/services.go:184MouseButtoncasesdefault:for external typeUnused Parameter Fixes
pkg/fwdmcp/tools.goctx, req->_, _pkg/fwdmcp/prompts.goctx->_pkg/fwdmcp/resources.goctx->_pkg/fwdmcp/tools.goinput struct{}->_ struct{}Test File Fixes
pkg/fwdmcp/tools_test.go_, added_ =for json.Encode errorsComplexity Fix
handlePodStatusChanged()helper fromhandleEventForStore()to reduce cyclomatic complexity from 16 to under 15Config Update
.golangci.yml: Added targeted test file exclusion forunused-parameter(standard practice for interface mocks)