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

google_os_config_os_policy_assignment #5481

Merged

Conversation

trodge
Copy link
Contributor

@trodge trodge commented Nov 23, 2021

Upgraded DCL and added overrides for osconfig os policy assignment.
Reworked AppendToBasePath override into BasePathReplacement.
Implemented serialization for map[string]string types.

fixes hashicorp/terraform-provider-google#10628

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

`google_os_config_os_policy_assignment`

@trodge trodge requested a review from nat-henderson November 23, 2021 22:12
@google-cla google-cla bot added the cla: yes label Nov 23, 2021
@trodge trodge force-pushed the osconfig-ospolicyassignment-dcl branch from 8207942 to 1a504bc Compare November 23, 2021 22:20
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 13 files changed, 4918 insertions(+), 11 deletions(-))
Terraform Beta: Diff ( 14 files changed, 4925 insertions(+), 14 deletions(-))

Copy link
Contributor

@nat-henderson nat-henderson left a comment

Choose a reason for hiding this comment

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

This looks fine to me with the exception of the design of the trait. Riley or Sam could overrule me on that point though - I don't feel super strongly about it.

details:
string: v1
string: 'client.Config.BasePath + "v1"'
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we want to be putting code in these files. I know it's not much code, but it's really worth avoiding in my opinion. Is that feasible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's feasible if we want to keep BasePathReplacement and AppendToBasePath as two separate traits. To me it seems cleaner to combine them into one, even if it means we have to do it like this.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 13 files changed, 4918 insertions(+), 11 deletions(-))
Terraform Beta: Diff ( 14 files changed, 4923 insertions(+), 14 deletions(-))

- type: REPLACE_IN_BASE_PATH
details:
old: v1beta
new: v1
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you! Yes, I think this is much better.

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

I haven't reviewed the PR here, I only took a look at the generated code. I'm seeing the v1 part drop from monitored project in the downstream, and I'm not sure I can see where that's getting added back somewhere else: modular-magician/terraform-provider-google-beta@auto-pr-5481-old..auto-pr-5481#diff-4453ffdcd0L94

@rileykarson
Copy link
Member

I think that's supported by the VCR failure, where we're making a different request than we did before:

------- Stdout: -------
=== RUN   TestAccMonitoringMonitoredProject_BasicMonitoredProject
=== PAUSE TestAccMonitoringMonitoredProject_BasicMonitoredProject
=== CONT  TestAccMonitoringMonitoredProject_BasicMonitoredProject
provider_test.go:278: Step 1/2 error: Error running apply: exit status 1
Error: Error creating MonitoredProject: failed to create a diff: failed to retrieve MonitoredProject resource: Get "https://monitoring.googleapis.com/locations/global/metricsScopes/ci-test-project-188019?alt=json": Requested interaction not found
on terraform_plugin_test.tf line 2, in resource "google_monitoring_monitored_project" "primary":
2: resource "google_monitoring_monitored_project" "primary" {
--- FAIL: TestAccMonitoringMonitoredProject_BasicMonitoredProject (24.90s)
FAIL

@nat-henderson nat-henderson self-requested a review December 1, 2021 18:12
@nat-henderson
Copy link
Contributor

Yep - you're right about that. I'll rereview when the tests are green.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 13 files changed, 4918 insertions(+), 11 deletions(-))
Terraform Beta: Diff ( 14 files changed, 4923 insertions(+), 14 deletions(-))

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 13 files changed, 4918 insertions(+), 11 deletions(-))
Terraform Beta: Diff ( 13 files changed, 4923 insertions(+), 11 deletions(-))

@nat-henderson
Copy link
Contributor

For some reason, it doesn't seem like re-running the failed VCR tests is running for you. I can't explain that, sorry! Hm, can you maybe run the failed tests on your machine locally? I don't suspect any of them are related, but you never know...

@trodge
Copy link
Contributor Author

trodge commented Dec 2, 2021

/gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 13 files changed, 4918 insertions(+), 11 deletions(-))
Terraform Beta: Diff ( 13 files changed, 4923 insertions(+), 11 deletions(-))

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 10 files changed, 4902 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 10 files changed, 4907 insertions(+), 5 deletions(-))

@trodge trodge force-pushed the osconfig-ospolicyassignment-dcl branch from 9494262 to 4896bd8 Compare December 2, 2021 21:19
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 10 files changed, 4902 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 10 files changed, 4907 insertions(+), 5 deletions(-))

@trodge trodge force-pushed the osconfig-ospolicyassignment-dcl branch from 4896bd8 to 5175583 Compare December 2, 2021 21:45
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 10 files changed, 4902 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 10 files changed, 4907 insertions(+), 5 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccApigeeEnvironmentIamBindingGenerated|TestAccApigeeEnvironmentIamMemberGenerated|TestAccApigeeEnvironmentIamPolicyGenerated|TestAccCloudFunctionsFunction_vpcConnector|TestAccComputeRegionNetworkEndpointGroup_regionNetworkEndpointGroupAppengineExample|TestAccServiceNetworkingPeeredDNSDomain_basic|TestAccOSConfigOSPolicyAssignment_FixedOsPolicyAssignment|TestAccOSConfigOSPolicyAssignment_PercentOsPolicyAssignment You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=227053

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccComputeRegionNetworkEndpointGroup_regionNetworkEndpointGroupAppengineExample|TestAccApigeeEnvironmentIamBindingGenerated|TestAccServiceNetworkingPeeredDNSDomain_basic|TestAccApigeeEnvironmentIamMemberGenerated|TestAccApigeeEnvironmentIamPolicyGenerated|TestAccCloudFunctionsFunction_vpcConnector Please fix these to complete your PR

@nat-henderson
Copy link
Contributor

Those are all problems with billing enablement and an internal API error. No need to change anything on those. Works fine for me.

Should we worry about the TF validator?

@nat-henderson
Copy link
Contributor

nope, don't need to worry about that one, known issue seems like.

@trodge trodge merged commit b7f1683 into GoogleCloudPlatform:master Dec 3, 2021
betsy-lichtenberg pushed a commit to betsy-lichtenberg/magic-modules that referenced this pull request Apr 25, 2022
* Upgraded DCL and added overrides for osconfig os policy assignment.

Reworked AppendToBasePath override into BasePathReplacement.
Implemented serialization for map[string]string types.

* Split ReplaceInBasePath and AppendToBasePath into two overrides.

* Re-added missing quotation marks.

* Fixed handling of append to base path override.
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.

Implement google_os_config_os_policy_assignment resource.
4 participants