fix(search): replace placeholder data returns with Atlas SDK limitati…#4
Merged
fix(search): replace placeholder data returns with Atlas SDK limitati…#4
Conversation
…on errors Replace all placeholder data implementations in search service methods with proper error messages that inform users about Atlas Admin API limitations. **Changes Made:** - Modified `GetSearchAnalyzers()` to return error instead of placeholder data - Modified `GetSearchFacets()` to return error instead of placeholder data - Removed helper functions that contained placeholder implementations: - `extractAnalyzersFromDefinition()` - `extractFacetsFromDefinition()` - `analyzeIndexDefinition()` - Updated error messages to guide users to Atlas UI for unsupported features **Affected Methods:** - `GetSearchAnalyzers`: Returns error about SDK not exposing analyzer details - `GetSearchFacets`: Returns error about SDK not exposing facet details - `GetSearchMetrics`: Already properly returns limitation error (unchanged) - `AnalyzeSearchIndex`: Already properly returns limitation error (unchanged) - `ValidateSearchQuery`: Already properly returns limitation error (unchanged) **Error Message Pattern:** All errors now follow consistent format: 1. Structured logging with context (project_id, cluster_name, reason) 2. Clear error message explaining the Atlas SDK limitation 3. Guidance to use Atlas UI for the specific functionality **Files Modified:** - `internal/services/atlas/search.go`: Core service method changes (-84 lines) - `cmd/atlas/search/search.go`: Minor comment updates - `internal/output/advanced_search.go`: Retained placeholder handling for compatibility **Breaking Change:** No **Backward Compatibility:** Yes - methods still exist but now return informative errors This change prevents users from receiving misleading placeholder data and provides clear guidance on how to access these features through the Atlas UI. Refs: Atlas SDK limitation handling
|
🎉 This PR is included in version 3.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
d-teller
added a commit
that referenced
this pull request
Sep 4, 2025
…on errors (#4) Replace all placeholder data implementations in search service methods with proper error messages that inform users about Atlas Admin API limitations. **Changes Made:** - Modified `GetSearchAnalyzers()` to return error instead of placeholder data - Modified `GetSearchFacets()` to return error instead of placeholder data - Removed helper functions that contained placeholder implementations: - `extractAnalyzersFromDefinition()` - `extractFacetsFromDefinition()` - `analyzeIndexDefinition()` - Updated error messages to guide users to Atlas UI for unsupported features **Affected Methods:** - `GetSearchAnalyzers`: Returns error about SDK not exposing analyzer details - `GetSearchFacets`: Returns error about SDK not exposing facet details - `GetSearchMetrics`: Already properly returns limitation error (unchanged) - `AnalyzeSearchIndex`: Already properly returns limitation error (unchanged) - `ValidateSearchQuery`: Already properly returns limitation error (unchanged) **Error Message Pattern:** All errors now follow consistent format: 1. Structured logging with context (project_id, cluster_name, reason) 2. Clear error message explaining the Atlas SDK limitation 3. Guidance to use Atlas UI for the specific functionality **Files Modified:** - `internal/services/atlas/search.go`: Core service method changes (-84 lines) - `cmd/atlas/search/search.go`: Minor comment updates - `internal/output/advanced_search.go`: Retained placeholder handling for compatibility **Backward Compatibility:** Yes - methods still exist but now return informative errors This change prevents users from receiving misleading placeholder data and provides clear guidance on how to access these features through the Atlas UI. Refs: Atlas SDK limitation handling Co-authored-by: Danny Teller <danny.teller@tipalti.com>
d-teller
added a commit
that referenced
this pull request
Sep 4, 2025
#5) * fix(search): replace placeholder data returns with Atlas SDK limitation errors (#4) Replace all placeholder data implementations in search service methods with proper error messages that inform users about Atlas Admin API limitations. **Changes Made:** - Modified `GetSearchAnalyzers()` to return error instead of placeholder data - Modified `GetSearchFacets()` to return error instead of placeholder data - Removed helper functions that contained placeholder implementations: - `extractAnalyzersFromDefinition()` - `extractFacetsFromDefinition()` - `analyzeIndexDefinition()` - Updated error messages to guide users to Atlas UI for unsupported features **Affected Methods:** - `GetSearchAnalyzers`: Returns error about SDK not exposing analyzer details - `GetSearchFacets`: Returns error about SDK not exposing facet details - `GetSearchMetrics`: Already properly returns limitation error (unchanged) - `AnalyzeSearchIndex`: Already properly returns limitation error (unchanged) - `ValidateSearchQuery`: Already properly returns limitation error (unchanged) **Error Message Pattern:** All errors now follow consistent format: 1. Structured logging with context (project_id, cluster_name, reason) 2. Clear error message explaining the Atlas SDK limitation 3. Guidance to use Atlas UI for the specific functionality **Files Modified:** - `internal/services/atlas/search.go`: Core service method changes (-84 lines) - `cmd/atlas/search/search.go`: Minor comment updates - `internal/output/advanced_search.go`: Retained placeholder handling for compatibility **Backward Compatibility:** Yes - methods still exist but now return informative errors This change prevents users from receiving misleading placeholder data and provides clear guidance on how to access these features through the Atlas UI. Refs: Atlas SDK limitation handling Co-authored-by: Danny Teller <danny.teller@tipalti.com> * fix: go formatting --------- Co-authored-by: Danny Teller <danny.teller@tipalti.com>
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.
…on errors
Replace all placeholder data implementations in search service methods with proper error messages that inform users about Atlas Admin API limitations.
Changes Made:
GetSearchAnalyzers()to return error instead of placeholder dataGetSearchFacets()to return error instead of placeholder dataextractAnalyzersFromDefinition()extractFacetsFromDefinition()analyzeIndexDefinition()Affected Methods:
GetSearchAnalyzers: Returns error about SDK not exposing analyzer detailsGetSearchFacets: Returns error about SDK not exposing facet detailsGetSearchMetrics: Already properly returns limitation error (unchanged)AnalyzeSearchIndex: Already properly returns limitation error (unchanged)ValidateSearchQuery: Already properly returns limitation error (unchanged)Error Message Pattern:
All errors now follow consistent format:
Files Modified:
internal/services/atlas/search.go: Core service method changes (-84 lines)cmd/atlas/search/search.go: Minor comment updatesinternal/output/advanced_search.go: Retained placeholder handling for compatibilityBreaking Change: No
Backward Compatibility: Yes - methods still exist but now return informative errors
This change prevents users from receiving misleading placeholder data and provides clear guidance on how to access these features through the Atlas UI.
Refs: Atlas SDK limitation handling