Skip to content
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

feat: Adds new organization settings parameters #879

Merged
merged 15 commits into from
Jan 26, 2024

Conversation

maastha
Copy link
Collaborator

@maastha maastha commented Jan 19, 2024

Proposed changes

This PR adds support for new setting params in the organization resource:
PATCH Update Settings for One Organization - https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/updateOrganizationSettings 

This PR also adds a new version of the Atlas SDK client.

Jira ticket: https://jira.mongodb.org/browse/CLOUDP-221421

Link to any related issue(s):

Type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as
    expected)
  • This change requires a documentation update

Manual QA performed:

  • cfn invoke for each of CRUDL/cfn test
  • Updated resource in example
  • Published to AWS private registry
  • Used the template in example to create and update a stack in AWS
  • Deleted stack to ensure resources are deleted
  • Created multiple resources in same stack
  • Validated in Atlas UI
  • Included screenshots

Required Checklist:

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • For CFN Resources: I have released by changes in the private registry and proved by change
    works in Atlas

Further comments

image

image image


build:
cfn generate
env GOOS=$(goos) CGO_ENABLED=$(cgo) GOARCH=$(goarch) go build -ldflags="$(ldXflags)" -tags="$(tags)" -o bin/handler cmd/main.go
env GOOS=$(goos) CGO_ENABLED=$(cgo) GOARCH=$(goarch) go build -ldflags="$(ldXflags)" -tags="$(tags)" -o bin/bootstrap cmd/main.go
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updating to work with new cfn cli go plugin versions as per aws-cloudformation/cloudformation-cli#1053 (comment)
Related PR #881

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

undoing this change for now as this resulted in errors when trying to submit resource to private registry and manually creating a stack. This is being addressed in #881

Config *Config
Atlas *mongodbatlas.Client
AtlasV2 *atlasSDK.APIClient
AtlasSDKLatest *adminLatest.APIClient
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

adding new version of SDK to avoid breaking changes

@maastha maastha marked this pull request as ready for review January 24, 2024 14:45
@maastha maastha requested a review from a team as a code owner January 24, 2024 14:45
@maastha maastha changed the title feat: adds new organization settings parameters feat: Adds new organization settings parameters Jan 24, 2024
Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -19,6 +19,7 @@ require (
github.com/tidwall/pretty v1.2.1
go.mongodb.org/atlas v0.36.0
go.mongodb.org/atlas-sdk/v20231115002 v20231115002.1.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we remove this SDK version?

Suggested change
go.mongodb.org/atlas-sdk/v20231115002 v20231115002.1.0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since the new SDK has breaking changes, for now we need to keep both versions


return sdkV2, nil
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to update the examples to add new fields?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point! will add

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

lantoli
lantoli previously approved these changes Jan 24, 2024
@maastha maastha dismissed stale reviews from lantoli and andreaangiolillo via 6061afc January 26, 2024 13:02
@maastha maastha added this pull request to the merge queue Jan 26, 2024
Merged via the queue into master with commit 804c2cc Jan 26, 2024
41 checks passed
@maastha maastha deleted the CLOUDP-221421-organization-new-params branch January 26, 2024 14:58
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.

None yet

3 participants