Skip to content

fix: add atlas instance size #172

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 3 commits into from
Apr 29, 2025
Merged

fix: add atlas instance size #172

merged 3 commits into from
Apr 29, 2025

Conversation

fmenezes
Copy link
Collaborator

@fmenezes fmenezes commented Apr 29, 2025

adds 2 columns to atlas-list-clusters and atlas-inspect-cluster

fixes #89

@fmenezes fmenezes marked this pull request as ready for review April 29, 2025 17:15
@Copilot Copilot AI review requested due to automatic review settings April 29, 2025 17:15
@fmenezes fmenezes requested a review from blva as a code owner April 29, 2025 17:15
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 updates the atlas cluster listing and inspection tools to include instance size information by adding two new columns and adjusting connection string logic.

  • In listClusters.ts, a new fallback for connection strings is added and instance size is derived from replication specs.
  • In inspectCluster.ts, the instance size is similarly extracted and the output format is updated to include cluster type and tier.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/tools/atlas/read/listClusters.ts Updated connection string logic; added instance size extraction and new output format
src/tools/atlas/read/inspectCluster.ts Added extraction of instance size and updated the output message format accordingly

Comment on lines 110 to 112
const clusterInstaceType = instanceSize == "M0" ? "FREE" : "DEDICATED";

return `${cluster.name} | ${clusterInstaceType} | ${clusterInstaceType == "DEDICATED" ? instanceSize : "N/A"} | ${cluster.stateName} | ${mongoDBVersion} | ${connectionString}`;
Copy link
Preview

Copilot AI Apr 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'clusterInstaceType' appears to be misspelled; consider renaming it to 'clusterInstanceType' for clarity.

Suggested change
const clusterInstaceType = instanceSize == "M0" ? "FREE" : "DEDICATED";
return `${cluster.name} | ${clusterInstaceType} | ${clusterInstaceType == "DEDICATED" ? instanceSize : "N/A"} | ${cluster.stateName} | ${mongoDBVersion} | ${connectionString}`;
const clusterInstanceType = instanceSize == "M0" ? "FREE" : "DEDICATED";
return `${cluster.name} | ${clusterInstanceType} | ${clusterInstanceType == "DEDICATED" ? instanceSize : "N/A"} | ${cluster.stateName} | ${mongoDBVersion} | ${connectionString}`;

Copilot uses AI. Check for mistakes.


const instanceSize = (regionConfigs.length <= 0 ? undefined : regionConfigs[0].instanceSize) || "UNKNOWN";

const clusterInstaceType = instanceSize == "M0" ? "FREE" : "DEDICATED";
Copy link
Preview

Copilot AI Apr 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'clusterInstaceType' appears to be misspelled; consider renaming it to 'clusterInstanceType' for clarity.

Suggested change
const clusterInstaceType = instanceSize == "M0" ? "FREE" : "DEDICATED";
const clusterInstanceType = instanceSize == "M0" ? "FREE" : "DEDICATED";

Copilot uses AI. Check for mistakes.

@fmenezes fmenezes merged commit 6bce4a3 into main Apr 29, 2025
16 checks passed
@fmenezes fmenezes deleted the fmenezes/add_instance_size branch April 29, 2025 20:47
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.

Include cluster size in the response of atlas-inspect-cluster
2 participants