Skip to content

feat: Adds support for security contact in mongodbatlas_organization resource & data sources #3263

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 7 commits into from
Apr 11, 2025

Conversation

maastha
Copy link
Collaborator

@maastha maastha commented Apr 8, 2025

Description

Adds support for security contact in mongodbatlas_organization resource & data sources

Link to any related issue(s): CLOUDP-286563

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@@ -38,42 +51,18 @@ func TestAccConfigRSOrganization_Basic(t *testing.T) {
Steps: []resource.TestStep{
{
Config: configBasic(orgOwnerID, name, description, roleName, false, nil),
Check: resource.ComposeAggregateTestCheckFunc(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

refactored checks into common functions

@maastha maastha marked this pull request as ready for review April 9, 2025 14:48
@maastha maastha requested review from a team as code owners April 9, 2025 14:48
Copy link
Contributor

github-actions bot commented Apr 9, 2025

APIx bot: a message has been sent to Docs Slack channel

@@ -0,0 +1,11 @@
```release-note:enhancement
resource/mongodbatlas_organization: Adds new `security_contact` attribute`
Copy link
Member

Choose a reason for hiding this comment

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

nit: 'new' is redundant and can be dropped in all notes. also there is a wrong tick at the end of all messages

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

RestrictEmployeeAccess: conversion.Pointer(false),
GenAIFeaturesEnabled: conversion.Pointer(true),
}
)

func TestAccConfigRSOrganization_Basic(t *testing.T) {
acc.SkipTestForCI(t) // affects the org
Copy link
Member

Choose a reason for hiding this comment

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

i guess it can't run in CI yet

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, it needs paying organizations to create new ones & dev is unstable when deleting orgs at this point as well

Copy link
Contributor

@carriecwk carriecwk left a comment

Choose a reason for hiding this comment

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

LGTM

"multi_factor_auth_required": strconv.FormatBool(*settings.MultiFactorAuthRequired),
"restrict_employee_access": strconv.FormatBool(*settings.RestrictEmployeeAccess),
"gen_ai_features_enabled": strconv.FormatBool(*settings.GenAIFeaturesEnabled),
"security_contact": settings.GetSecurityContact(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Surprises me a bit that we check the empty string "" and it works. Would expect it to be null in the state when it doesn't exist. 🤔 probably because it is SDKv2

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 my understanding is that it's due to SDKv2

Copy link
Collaborator

@EspenAlbert EspenAlbert left a comment

Choose a reason for hiding this comment

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

Great. Thank you for refactoring the test too!

@maastha maastha merged commit 7d59ab6 into master Apr 11, 2025
40 checks passed
@maastha maastha deleted the CLOUDP-286563-org-security-contact branch April 11, 2025 10:27
svc-apix-Bot added a commit that referenced this pull request Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants