Skip to content

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

Merged
merged 5 commits into from
May 7, 2025

Conversation

fmenezes
Copy link
Collaborator

@fmenezes fmenezes commented Apr 30, 2025

fixes #165

@fmenezes fmenezes changed the title fmenezes/add flex clusters feat: support flex clusters to atlas tools Apr 30, 2025
@fmenezes fmenezes force-pushed the fmenezes/add_flex_clusters branch from ceba258 to 6b0d393 Compare May 2, 2025 10:15
@fmenezes fmenezes marked this pull request as ready for review May 2, 2025 13:18
@Copilot Copilot AI review requested due to automatic review settings May 2, 2025 13:18
@fmenezes fmenezes requested a review from a team as a code owner May 2, 2025 13:18
Copy link
Contributor

@Copilot Copilot AI left a 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

@nirinchev nirinchev requested a review from blva May 7, 2025 10:41
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]
Copy link
Collaborator

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

@fmenezes fmenezes merged commit ec590e8 into main May 7, 2025
17 checks passed
@fmenezes fmenezes deleted the fmenezes/add_flex_clusters branch May 7, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: atlas-list-clusters and atlas-inspect-cluster does not work well with flex clusters
2 participants