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(aws_docdb_cluster): add allow_major_version_upgrade argument #94

Merged
merged 5 commits into from
Jun 29, 2024

Conversation

gmeligio
Copy link
Contributor

@gmeligio gmeligio commented May 12, 2024

what

This PR adds the argument allow_major_version_upgrade that was released in https://github.com/hashicorp/terraform-provider-aws/releases/tag/v5.21.0

It includes with the changes in the test framework from #100 .

why

When upgrading the engine_version to a new major version, allow_major_version_upgrade needs to be enabled for AWS to apply the upgrade.

references

@mergify mergify bot added the triage Needs triage label May 12, 2024
Copy link

mergify bot commented May 27, 2024

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@mergify mergify bot added the needs-cloudposse Needs Cloud Posse assistance label May 27, 2024
@gmeligio gmeligio force-pushed the allow_major_version_upgrade branch from 8522d59 to 3da873d Compare May 27, 2024 20:39
@gmeligio gmeligio marked this pull request as ready for review May 27, 2024 20:40
@gmeligio gmeligio requested review from a team as code owners May 27, 2024 20:40
@jamengual
Copy link

/terratest

@gmeligio
Copy link
Contributor Author

Thank you for reviewing this @jamengual . The terratest job finished OK. Is there something that I should do before the review continues?

@Nuru Nuru added the do not merge Do not merge this PR, doing so would cause problems label May 31, 2024
@Nuru
Copy link

Nuru commented May 31, 2024

@gmeligio Thank you for this PR.

We do not expect contributors such as yourself to do more than you have done. Unfortunately, the test framework in this module is too old to allow us to allow a new version to be released with it. Merging this PR will have to wait until a Cloud Posse engineer can migrate this to the current framework. This may take a while.

@Nuru Nuru added minor New features that do not break anything needs-test Needs testing and removed triage Needs triage labels May 31, 2024
Copy link

@Nuru Nuru left a comment

Choose a reason for hiding this comment

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

@cloudposse/engineering @goruha This module's test framework needs major updates before we can allow it to be merged.

@goruha
Copy link
Member

goruha commented May 31, 2024

/terratest

@gmeligio
Copy link
Contributor Author

gmeligio commented Jun 2, 2024

Thank you for the review. Let me know if the new testing methodology is in place in another CloudPosse module. I could help learning from that module and moving that forward here. I checked other CloudPosse modules that were recently updated before doing changes in the test folder but didn't notice any major difference with this one. It's great that you are thinking of updating it and taking the time to do so. Feel free to ping me @Nuru and @goruha if I can help.

I'm interested because I'm using the module and could contribute again soon. For example, I have the draft #95 and could have more to contribute.

@Nuru
Copy link

Nuru commented Jun 4, 2024

@gmeligio Thank you for the offer to update the tests. It's a big job and one that will take us a while to review, so please only do it if you are excited about the task. Here are my notes on what I would do, but they are shorthand and more needs to be done.

  • test/Makefile and test/src/Makefile need to be updated.
  • go.mod is at go version 1.14, should be updated to 1.21 and dependencies updated.
  • Test should be updated to use CopyTerraformFolderToTemp to allow for real parallel testing
  • Test for enabled=false should be added
  • strconv.Itoa(rand.Intn(100000)) should be replaced with strings.ToLower(random.UniqueId()) and randId replaced with randID

The general pattern of starting and cleaning up tests has changed, with the above noting some of the more detailed changes.

  • Dynamic subnets is a good, though perhaps overly complicated, example.
  • You can look at EKS workers, too, but it is not fully up to par.
  • Terraform example module gives you the basic idea of where we were a few years ago, and is cleaner and easier to understand.

If you are really ambitious, you can try reorganizing the code to accomplish the following objectives:

  • Move more boilerplate/support to a separate file that can be common to all our tests. Things like set up and cleanup and random ID and error handling and Kubernetes and AWS clients could all go in there. The idea being that we should be able to update that file to be the same in every repo as our test framework evolves, leaving the test function focused on providing inputs, validating outputs, and making any other checks they need to make.
  • Add an option to run the tests only as far as the plan phase and check the results. This would give us an option to test multiple versions of Terraform and OpenTofu for syntax and features without requiring us to go through all of the resource creation and cleanup each time.

I know the above is a lot to ask, so please do not feel any obligation to do it.

@gmeligio
Copy link
Contributor Author

gmeligio commented Jun 5, 2024

Thank you for the instructions @Nuru . Oddly enough, I was doing some of those bullet points by looking at EKS workers when testing the change and debugging why terraform init was failing. So, I think I know how to repeat those changes. I discarded those test updates 😅 after noticing the issue in the tests was with TF_CLI_ARGS_init to reduce the number of changes to review in the PR.

I'll find some time to move forward following your instructions.

@gmeligio
Copy link
Contributor Author

Hi, I created the intermediate #100 to update the test framework. I'll notify in slack too.

Copy link

mergify bot commented Jun 25, 2024

💥 This pull request now has conflicts. Could you fix it @gmeligio? 🙏

@mergify mergify bot added the conflict This PR has conflicts label Jun 25, 2024
@gmeligio gmeligio force-pushed the allow_major_version_upgrade branch from c7f1bd9 to e03cb58 Compare June 25, 2024 06:40
@mergify mergify bot removed the conflict This PR has conflicts label Jun 25, 2024
@gmeligio gmeligio requested a review from Nuru June 25, 2024 06:45
@Nuru
Copy link

Nuru commented Jun 29, 2024

/terratest

@Nuru Nuru removed do not merge Do not merge this PR, doing so would cause problems needs-test Needs testing needs-cloudposse Needs Cloud Posse assistance labels Jun 29, 2024
@Nuru Nuru enabled auto-merge (squash) June 29, 2024 06:44
@Nuru Nuru added the enhancement New feature or request label Jun 29, 2024
@Nuru Nuru merged commit d65451b into cloudposse:main Jun 29, 2024
41 of 49 checks passed
Copy link

These changes were released in v0.26.0.

@gmeligio gmeligio deleted the allow_major_version_upgrade branch July 8, 2024 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor New features that do not break anything
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants