Skip to content

INTMDB-433: make sure failed Terraform run rolls back properly #1264

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 10 commits into from
Jul 1, 2023

Conversation

martinstibbe
Copy link
Contributor

@martinstibbe martinstibbe commented Jun 21, 2023

Description

INTMDB-433: make sure failed Terraform run rolls back properly

Please include a summary of the fix/feature/change, including any relevant motivation and context.

Link to any related issue(s):
#700
https://jira.mongodb.org/browse/INTMDB-433

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.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contribution guidelines
  • 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

Further comments

@martinstibbe martinstibbe marked this pull request as ready for review June 22, 2023 02:29
@martinstibbe martinstibbe requested a review from a team as a code owner June 22, 2023 02:29
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.

There is one failing test that looks legit 9692262381?pr=1264#step:4:148

Comment on lines 235 to 238
_, errd := conn.Projects.Delete(ctx, project.ID)
if errd != nil {
return diag.Errorf(errorProjectDelete, project.ID, errd)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why can't we use deleteProject() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified create to use this function in all delete project requests so that it uses function with timeout

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

Copy link
Contributor

@Zuhairahmed Zuhairahmed left a comment

Choose a reason for hiding this comment

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

@martinstibbe can you confirm that no change is required to resource_mongodbatlas_project_test.go?

@martinstibbe
Copy link
Contributor Author

@martinstibbe can you confirm that no change is required to resource_mongodbatlas_project_test.go?

resource_mongodbatlas_project_test.go no changes needed just deletes project if it fails to create all the additional attached pieces during create i.e. teams/api keys

@martinstibbe martinstibbe merged commit 98f36d4 into master Jul 1, 2023
@martinstibbe martinstibbe deleted the INTMDB-433 branch July 1, 2023 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants