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

Fixes https://github.com/hashicorp/terraform-cdk/issues/3695 https://github.com/hashicorp/terraform-provider-google/issues/15456 #11401

Conversation

eahrend
Copy link

@eahrend eahrend commented Aug 8, 2024

When creating terraform compliant JSON, the IP Allocation policy block in the composer resource will incorrectly state that all attributes are required.

This PR removes the ConfigMode of the ip_allocation_policy, and removes the atleastoneof fields from the elements in the ip_allocation_policy field. This brings it more in line with the container engine resource, and has the benefit of allowing terraform compliant JSON to work the same as HCL

Release Note Template for Downstream PRs (will be copied)

composer: removed ConfigMode: SchemaConfigModeAttr ip_allocation_policy and AtLeastOneOf fields from ip_allocation_policy sub fields

Signed-off-by: Erik Ahrend <kire317@gmail.com>
@github-actions github-actions bot requested a review from shuyama1 August 8, 2024 18:58
Copy link

github-actions bot commented Aug 8, 2024

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@shuyama1, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 8, 2024
@eahrend
Copy link
Author

eahrend commented Aug 8, 2024

Ran tests locally that confirm the existing terraform configurations still work, so this shouldn't break any existing terraform code. Also built a local version of the provider and confirmed the terraform compliant JSON that was failing before is working as intended.

@modular-magician modular-magician added service/composer and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Aug 9, 2024
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 1 file changed, 4 insertions(+), 10 deletions(-))
google-beta provider: Diff ( 1 file changed, 4 insertions(+), 10 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_composer_environment (112 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_composer_environment" "primary" {
  config {
    node_config {
      ip_allocation_policy {
        cluster_secondary_range_name  = # value needed
        services_secondary_range_name = # value needed
      }
    }
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 51
Passed tests: 51
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • composer

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

Add tests for named alias ranges
for ip allocation policy

Signed-off-by: Erik Ahrend <kire317@gmail.com>
@eahrend
Copy link
Author

eahrend commented Aug 9, 2024

Added test case with named alias ranges for ip_allocation_policy

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Aug 9, 2024
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 95 insertions(+), 10 deletions(-))
google-beta provider: Diff ( 2 files changed, 95 insertions(+), 10 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 52
Passed tests: 51
Skipped tests: 0
Affected tests: 1

Click here to see the affected service packages
  • composer

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComposerEnvironmentComposer2_privateWithRangeNames

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComposerEnvironmentComposer2_privateWithRangeNames[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

@eahrend
Copy link
Author

eahrend commented Aug 12, 2024

@shuyama1 can I get a review on this please?

Copy link

@shuyama1 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@eahrend
Copy link
Author

eahrend commented Aug 14, 2024

@shuyama1 apologies if this is coming off rude or pestering, just a small reminder if I can get a review on this

@shuyama1
Copy link
Member

@shuyama1 apologies if this is coming off rude or pestering, just a small reminder if I can get a review on this

Apologies for the delay on the reviews, and thank you for the reminder. I'm working through my review list today and will get to this PR shortly.

Copy link

@GoogleCloudPlatform/terraform-team @shuyama1 This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Sorry for the late review. Left some comments and I'll also need to look into the issue a bit.

@@ -338,39 +338,34 @@ func ResourceComposerEnvironment() *schema.Resource {
Optional: true,
Computed: true,
ForceNew: true,
ConfigMode: schema.SchemaConfigModeAttr,
Copy link
Member

Choose a reason for hiding this comment

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

I'll need to double check if removing it will be a breaking check.

Copy link
Author

Choose a reason for hiding this comment

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

No worries, I ran some of the existing tests as well when doing a bit of local development and at least confirmed from my end that the tests were still valid before creating this PR

Copy link
Member

Choose a reason for hiding this comment

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

Removing SchemaConfigModeAttr is indeed a breaking change and can't be included in a minor release. We're currently at phase of working on 6.0.0 major release, and SchemaConfigModeAttr will be removed from all the resources. This work has already been done and 6.0.0 should be out in the next few weeks.

Copy link
Author

Choose a reason for hiding this comment

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

Oh nice, hopefully it will fix this. We can keep this open and once 6.0.0 drops I'll re-test this.

@eahrend
Copy link
Author

eahrend commented Aug 16, 2024

@shuyama1 no worries on the late review, saw the github outage on wednesday and figured that would impact the ETA for this to get reviewed.

@github-actions github-actions bot requested a review from shuyama1 August 16, 2024 15:16
@eahrend
Copy link
Author

eahrend commented Aug 20, 2024

@shuyama1 just checking in on this

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

@shuyama1 just checking in on this

Thanks for the ping. I just replied in #11401 (comment). Let's wait until the 6.0.0 is out to continue with the following work/ evaluate if further changes are needed, as I wonder if 6.0.0 will resolve your issues.

@eahrend
Copy link
Author

eahrend commented Aug 21, 2024

@shuyama1 any chance we can keep this open or prevent the stale bot from closing this until 6.0.0 drops or should I just keep a comment open until it does?

@shuyama1
Copy link
Member

@shuyama1 any chance we can keep this open or prevent the stale bot from closing this until 6.0.0 drops or should I just keep a comment open until it does?

Sorry for the noise!
Sure, I added the label to disable the reminders from the bot and I'll also convert this PR to draft, but feel free to convert it back you'd like to continue working on it. Thank you!

@shuyama1 shuyama1 marked this pull request as draft August 22, 2024 17:32
@eahrend eahrend closed this Sep 4, 2024
@eahrend eahrend deleted the fix-composer-ip-allocation-policy branch September 11, 2024 22:19
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.

3 participants