-
Notifications
You must be signed in to change notification settings - Fork 11
feat: support flex clusters to atlas tools #182
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
Conversation
ceba258
to
6b0d393
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for flex clusters in atlas tools by updating the cluster API calls, merging flex and traditional cluster data in the lists, and updating the filtering of operations.
- Merges flex clusters with traditional clusters in the listClusters tool
- Updates inspectCluster and connectCluster to use the new inspectCluster helper
- Adds new API client methods and updates the OpenAPI filter script for flex cluster operations
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/tools/atlas/read/listClusters.ts | Updates cluster table formatting to include flex cluster data |
src/tools/atlas/read/inspectCluster.ts | Modifies cluster inspection to use the new inspectCluster function |
src/tools/atlas/metadata/connectCluster.ts | Updates connection string extraction with the new cluster format |
src/common/atlas/cluster.ts | Adds helper functions for formatting both cluster types and inspection |
src/common/atlas/apiClient.ts | Implements API methods for flex cluster operations |
scripts/filter.ts | Adds allowed operations for flex clusters |
Co-authored-by: Copilot <[email protected]>
return `${cluster.name} | ${clusterInstanceType} | ${clusterInstanceType == "DEDICATED" ? instanceSize : "N/A"} | ${cluster.stateName} | ${mongoDBVersion} | ${connectionString}`; | ||
const formattedClusters = clusters?.results?.map((cluster) => formatCluster(cluster)) || []; | ||
const formattedFlexClusters = flexClusters?.results?.map((cluster) => formatFlexCluster(cluster)) || []; | ||
const rows = [...formattedClusters, ...formattedFlexClusters] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] could be nice to extend tests to validate the formatting of the clsuters here, can be a follow-up
fixes #165