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

Terraform Provider Development Program #27

Closed
8 of 9 tasks
cgriggs01 opened this issue Jul 12, 2018 · 10 comments
Closed
8 of 9 tasks

Terraform Provider Development Program #27

cgriggs01 opened this issue Jul 12, 2018 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@cgriggs01
Copy link

cgriggs01 commented Jul 12, 2018

Hi All! 👋

I have opened this PR for the purpose of preparing the MongoDB Atlas Terraform provider for review and release into the official Terraform ecosystem. The following list are items that should be addressed before moving on tot the technical review and release portion of the program.

  • File naming conventions: the resource files in the provider must follow the strict naming convention with the prefix resource_mongodbatlas_ follow by the resource name ie container.go This is the same for datasources, which are already correct.

  • Each resource and data source must have a corresponding test file with the postfix _test.go. Our goal for all provider is to have at lease 50% code coverage across the acceptance test. To learn more about Terraform provider acceptance testing, we recently published some new testing documentation on the subject.

  • The project resource's delete method should be completed or removed.

  • The container resource's methods delete and update should be implemented

  • The ip_whitelist resource method update should be implemented or removed

  • The vpc_peering_connection resource's method update should be implemented or removed

  • There are two additional bash scripts that are used during the release process. changelog-links.sh and gogetcookie.sh. Can you please add these to the scripts/ directory.

  • You will need to update you .travis.yaml file to align with the terraform provider std travis config

  • There are two targets website and website-test that must be added to the GNUmakefile. You can find the necessary change in this PR.

Once these are complete we can start testing the provider against a MongoDB Atlas env, after the tests pass we will start the technical review with one of our Terraform Engineers.

Please let me know if you have any questions.

Best,
Chris

@akshaykarle
Copy link
Owner

Hey @cgriggs01 thanks for taking the time to put this list together. I've been busy the last few weeks but I do have some time finally so I will start looking at these soon. Will keep you update as I work through them :)

@akshaykarle akshaykarle self-assigned this Jul 27, 2018
akshaykarle added a commit that referenced this issue Jul 27, 2018
the resource files in the provider must follow the strict naming convention with the prefix resource_mongodbatlas_ follow by the resource name ie container.go This is the same for datasources, which are already correct.
akshaykarle added a commit that referenced this issue Jul 27, 2018
also update travis.yml to run gogetcookie.sh
@akshaykarle
Copy link
Owner

@cgriggs01 when I tried to remove the unimplemented delete methods on project and container, the provider test gives me the following error:

--- FAIL: TestProvider (0.00s)
	provider_test.go:11: err: 2 error(s) occurred:

		* resource mongodbatlas_project: Delete must be implemented
		* resource mongodbatlas_container: Delete must be implemented
FAIL

The MongoDB Atlas API doesn't provide methods to delete a Container or a Project so I'm unable to implement these methods. How should I proceed? Just leave those methods unimplemented for now?

@akshaykarle akshaykarle added enhancement New feature or request waiting-response labels Jul 27, 2018
@dpiddockcmp
Copy link
Contributor

Hi @akshaykarle. I just deleted an empty Project using the API documented here: https://docs.atlas.mongodb.com/reference/api/project-delete-one/

@akshaykarle
Copy link
Owner

Yup @dpiddockcmp, planning to add that soon to the provider :)

@cgriggs01
Copy link
Author

cgriggs01 commented Nov 7, 2018

Hey ya'll,

I am having some issues running the acceptance tests against my MongoDB Atlas account, nd consistantly getting this error on most of the tests:

=== RUN   TestAccMongodbatlasDataSource_Project
--- FAIL: TestAccMongodbatlasDataSource_Project (1.15s)
    <autogenerated>:1: Step 0 error: Error refreshing: 1 error(s) occurred:

        * data.mongodbatlas_project.test: 1 error(s) occurred:

        * data.mongodbatlas_project.test: data.mongodbatlas_project.test: Error reading MongoDB Project with name test: MongoDB Atlas: 401 The current user is not in the group, or the group does not exist.

Any thoughts on how to fix this?

@akshaykarle
Copy link
Owner

hey @cgriggs01 i invited you to the test project just now. Can you accept my invitation and try running the tests again please?

@cgriggs01
Copy link
Author

Ok, I accepted the invite.

But am still getting those errors. I beleive its because the acceptance tests are calling projectName := "test" while the name of the project on the test account is `Terraform Test Project 0'. Should those be the same project name or am I totally wrong?

Let me know. Thanks!

@holms
Copy link

holms commented Dec 4, 2018

Silently cheering for getting this provider to official registry

@cgriggs01
Copy link
Author

Hey @akshaykarle

  • When running the acceptance tests. We’re still running into a few failed tests. The first two, there seems to been an error when destroying the test resource cluster. The third failed test looks to be an error with provisioning in US_EAST_1, is there another region that this should be tested in?
=== RUN   TestAccMongodbatlasCluster_basic
--- FAIL: TestAccMongodbatlasCluster_basic (1187.13s)
    testing.go:599: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.

        Error: Check failed: Cluster "5c3792fc79358e2124a76e47" still exists

        State: <no state>
=== RUN   TestMongodbatlasCluster_importBasic
--- FAIL: TestMongodbatlasCluster_importBasic (511.79s)
    testing.go:599: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.

        Error: Check failed: Cluster "5c37979fc56c989c8c692778" still exists

        State: <no state>
=== RUN   TestAccMongodbatlasContainer_basic
--- FAIL: TestAccMongodbatlasContainer_basic (1.57s)
    testing.go:538: Step 0 error: Error applying: 1 error(s) occurred:

        * mongodbatlas_container.test: 1 error(s) occurred:

        * mongodbatlas_container.test: Error creating MongoDB Container: MongoDB Atlas: 409 Cannot modify in use containers. Resources already exist in US_EAST_1. Creating resources in US_EAST_1 is not supported..
  • The datasource for container and resources for alert configuration and VPC peering connection do not have corresponding tests. Do you plan to add these test files?

Although the items above should be address before provider official release, I’m going to move this provider into the queue to be review by one of our Terraform ecosystem engineers. You’ll be the 3rd integration in the queue so it will be a few weeks before an engineer is available to review.

Let me know if you have any questions about those.

@akshaykarle
Copy link
Owner

Closing this one since we have #68 which covers what is remaining on this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants