Skip to content

fix(search): replace placeholder data returns with Atlas SDK limitati…#4

Merged
d-teller merged 1 commit intomainfrom
fix/placeholders
Aug 31, 2025
Merged

fix(search): replace placeholder data returns with Atlas SDK limitati…#4
d-teller merged 1 commit intomainfrom
fix/placeholders

Conversation

@d-teller
Copy link
Contributor

…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

…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
@d-teller d-teller merged commit 58a5188 into main Aug 31, 2025
17 checks passed
@github-actions
Copy link

🎉 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants