Skip to content

CLOUDP-322615: Add support for autoscaling mode in setup commands #3949

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 12 commits into from
Jun 10, 2025

Conversation

blva
Copy link
Collaborator

@blva blva commented Jun 9, 2025

Proposed changes

Jira ticket: CLOUDP-322615

  • Adds autoscaling flag
  • Defaults to clusterWideScaling
  • Updates the watcher in setup to use the latest SDK
  • Throws an error if the --type local is defined together with --autoScalingMode
  • Adds int tests
  • Updates snapshots 🧘
  • Evergreen patch

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation in document requirements section listed in CONTRIBUTING.md (if appropriate)
  • I have addressed the @mongodb/docs-cloud-team comments (if appropriate)
  • I have updated test/README.md (if an e2e test has been added)
  • I have run make fmt and formatted my code

Further comments

@blva blva changed the title Cloudp 322615 2 CLOUDP-322615: Add support for autoscaling mode in setup Jun 9, 2025
@blva blva changed the title CLOUDP-322615: Add support for autoscaling mode in setup CLOUDP-322615: Add support for autoscaling mode in setup commands Jun 9, 2025
}

// newCluster creates a new cluster for the pinned API version.
func (opts *Opts) newCluster() *atlasClustersPinned.AdvancedClusterDescription {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is from cluster_setup.go, I updated it a bit to simplify but added unit tests to make sure it's behaving the same

@blva blva marked this pull request as ready for review June 9, 2025 16:54
@blva blva requested review from a team as code owners June 9, 2025 16:54
@github-actions github-actions bot added the need-doc-review Improvements or additions to documentation, will be reviewed by the docs team label Jun 9, 2025
Copy link
Contributor

github-actions bot commented Jun 9, 2025

APIx Bot :bowtie:: a message has been sent to Docs Slack channel 🚀.

return regionConfig
}

// getDiskSizeOverride returns the disk size override, which is only applicable for non-tenant clusters.
Copy link
Collaborator

Choose a reason for hiding this comment

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

DefaultDiskSizeGB contains values for TENANT, so this comment is not 100% correct.

var DefaultDiskSizeGB = map[string]map[string]float64{
	"TENANT": {
		"M2": 2,
		"M5": 5,
	},
	"AWS": {
		"M10":       10,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

gotcha, it's because based on the previous implementation, it only sets the disk size override if the provider is not tenant based on if opts.providerName() != tenant { , let me see how I can rephrase it!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated the comment, let me know if it's better, if not we can remove it or you can make a suggestion! thanks

// getDiskSizeOverride returns the disk size override, which is only applicable for non-tenant clusters.
func (opts *Opts) getDiskSizeOverride() *float64 {
if opts.providerName() != tenant {
diskSizeGB := defaultDiskSizeGB(opts.providerName(), opts.Tier)
Copy link
Collaborator

Choose a reason for hiding this comment

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

When you pass an incorrect combination to defaultDiskSizeGB the value returned is 0, shouldn't we check that the value !=0 before returning?

https://go.dev/play/p/mFYKv99R1VO

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes! good idea, and if it's zero we should also return nil, thank you 🙏

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated and added unit tests, thanks!

@blva blva requested a review from jeroenvervaeke June 10, 2025 10:27
@blva blva merged commit 8eea38d into CLOUDP-302696-clusters-iss-epic Jun 10, 2025
18 checks passed
@blva blva deleted the CLOUDP-322615-2 branch June 10, 2025 10:32
Copy link
Contributor

Coverage Report 📉

Branch Commit Coverage
CLOUDP-302696-clusters-iss-epic 9c7dd4e 25.3%
CLOUDP-322615-2 48b4aa3 25.2%
Difference -.1%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-doc-review Improvements or additions to documentation, will be reviewed by the docs team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants