-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Adding ServiceConnectionPolicies resource in NetworkConnectivity. #8273
Adding ServiceConnectionPolicies resource in NetworkConnectivity. #8273
Conversation
… to fix the test scenario for policy
Hello! I am a robot who works on Magic Modules PRs. I've detected that you're a community contributor. @roaks3, a repository maintainer, has been assigned to assist you and help review your changes. ❓ First time contributing? Click here for more detailsYour assigned reviewer will help review your code by:
You can help make sure that review is quick by running local tests and ensuring they're passing in between each push you make to your PR's branch. Also, try to leave a comment with each push you make, as pushes generally don't generate emails. If your reviewer doesn't get back to you within a week after your most recent change, please feel free to leave a comment on the issue asking them to take a look! In the absence of a dedicated review dashboard most maintainers manage their pending reviews through email, and those will sometimes get lost in their inbox. |
Hi, @roaks3 I have two questions about this PR Another one, the resource It's a draft, I need to fix the test scenario for one resource and validate some points. |
Hi @roaks3, just opened the PR to review. But I need some help with the serviceClass resource. |
Hi @diogoEsteves42 , this repo (used for GA and beta providers) requires that APIs be public. If Could you confirm that the API you need is not currently public? Any other information you can provide would also help (like if you have engaged with a TAM). |
…t, need to evaluate" This reverts commit 4240e1d.
Hi @roaks3 , thanks for the answer. The last information that I have about Can I kind of mock this resource? Use it with a static value with an env_var? Because the appreciate any help |
...hird_party/terraform/tests/resource_network_connectivity_service_connection_policies_test.go
Show resolved
Hide resolved
Hi @roaks3 I've just made a simple update in the code, but I haven't removed the service class yet. One question: If it's not possible I'll update the PR and then we can follow the review. |
Hey @diogoEsteves42 , since the API is currently marked as Pre-GA, and uses an allowlist, it would not be something we can add to either of the public providers. However, I can follow up with the team internally to verify that those assumptions are correct. |
Hi @roaks3 another person is facing the same situation with some feature or resource not being public and he mentions something about releasing it in another way (inside google). I will remove the serviceClass and update the tests, I'll @ you when it's ready. |
@roaks3 I've updated the PR, ready to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a first pass and had a few comments on the yaml. Will wait to see what comes back from the tests before continuing review. Thanks for the contribution!
mmv1/products/networkconnectivity/ServiceConnectionPolicies.yaml
Outdated
Show resolved
Hide resolved
mmv1/products/networkconnectivity/ServiceConnectionPolicies.yaml
Outdated
Show resolved
Hide resolved
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 13 files changed, 1321 insertions(+), 3 deletions(-)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: Please add acceptance tests which include these fields. |
Tests analyticsTotal tests: Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccNetworkConnectivityServiceConnectionPolicy_networkConnectivityPolicyBasicExample|TestAccNetworkConnectivityServiceConnectionPolicy_update|TestAccComputeFirewallPolicyRule_multipleRules|TestAccContainerAwsNodePool_BetaBasicHandWritten |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 14 files changed, 1287 insertions(+), 23 deletions(-)) |
Tests analyticsTotal tests: Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccNetworkConnectivityServiceConnectionPolicy_networkConnectivityPolicyBasicExample|TestAccNetworkConnectivityServiceConnectionPolicy_update |
Rerun these tests in REPLAYING mode to catch issues
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I would just like to make sure the network
field is in a good place so that we don't need to make changes later.
description: | | ||
Free-text description of the resource. | ||
- !ruby/object:Api::Type::String | ||
name: 'network' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that's strange. Could you provide any more info on that? I think we should be able to configure this property in a way that works.
Alternatively, you could submit it with the immutable: true
and then I can see the failure in the logs in VCR.
network = google_compute_network.producer_net.id | ||
} | ||
|
||
resource "google_compute_subnetwork" "producer_subnet1" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: You should be able to remove this subnet because it isn't being used in this config. I don't think it will be faster, but a little cleaner to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, removed.
auto_create_subnetworks = false | ||
} | ||
|
||
resource "google_compute_subnetwork" "producer_subnet" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Similarly, you should be able to remove this subnet because it isn't being used in this config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, removed.
…etwork as immutable
@roaks3 let's see the test fails. another point it's that we don't have the update method for the CLI |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 14 files changed, 1264 insertions(+), 23 deletions(-)) |
Tests analyticsTotal tests: Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccNetworkConnectivityServiceConnectionPolicy_update|TestAccContainerAwsNodePool_BetaBasicHandWritten |
|
Looking at the error, it does appear that I think this will fix the issue with updates, while allowing |
Owww, that works, really glad that you helped me @roaks3 Thanks again, without your help I would spend much more time on this. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 14 files changed, 1274 insertions(+), 23 deletions(-)) |
Tests analyticsTotal tests: Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccNetworkConnectivityServiceConnectionPolicy_update |
Rerun these tests in REPLAYING mode to catch issues$\textcolor{green}{\textsf{All tests passed!}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for working through all the feedback.
I also tweaked the release note to remove the service class resource.
…ogleCloudPlatform#8273) * adding both resources, basic test for serviceClass it's working, need to fix the test scenario for policy * fix the test scenario and the service class resource properties * adding a testing update, just adding the labels for the resource * added the resource service connection map, and it's basic test, need to evaluate * Revert "added the resource service connection map, and it's basic test, need to evaluate" This reverts commit 4240e1d. * removing the service class in one test scenario and using a static value * fix a typo * removing serviceClass and fix the tests * removing ga tag and updatinga etag for fingerprint type * updating the code, to remove the static value from the docs, need to test * adding a file to tpgtools override at product level * adding function to help with env var, but the patch on tests it's failing * adding the variable to be used in the docs * fixing the test, the network field cannot be immutable * removing the env_var service class and adding a static value * updating the value used from tests and documentation * removing unused resources for docs and tests * fix typos, not used variables and run the fmt * adding description to the basic test * fixed yaml variable override * removing unused resources for tests, and making the test fails with network as immutable * adding encoder to help network field be immutable and be sent on patch method
…ogleCloudPlatform#8273) * adding both resources, basic test for serviceClass it's working, need to fix the test scenario for policy * fix the test scenario and the service class resource properties * adding a testing update, just adding the labels for the resource * added the resource service connection map, and it's basic test, need to evaluate * Revert "added the resource service connection map, and it's basic test, need to evaluate" This reverts commit 4240e1d. * removing the service class in one test scenario and using a static value * fix a typo * removing serviceClass and fix the tests * removing ga tag and updatinga etag for fingerprint type * updating the code, to remove the static value from the docs, need to test * adding a file to tpgtools override at product level * adding function to help with env var, but the patch on tests it's failing * adding the variable to be used in the docs * fixing the test, the network field cannot be immutable * removing the env_var service class and adding a static value * updating the value used from tests and documentation * removing unused resources for docs and tests * fix typos, not used variables and run the fmt * adding description to the basic test * fixed yaml variable override * removing unused resources for tests, and making the test fails with network as immutable * adding encoder to help network field be immutable and be sent on patch method
…ogleCloudPlatform#8273) * adding both resources, basic test for serviceClass it's working, need to fix the test scenario for policy * fix the test scenario and the service class resource properties * adding a testing update, just adding the labels for the resource * added the resource service connection map, and it's basic test, need to evaluate * Revert "added the resource service connection map, and it's basic test, need to evaluate" This reverts commit 4240e1d. * removing the service class in one test scenario and using a static value * fix a typo * removing serviceClass and fix the tests * removing ga tag and updatinga etag for fingerprint type * updating the code, to remove the static value from the docs, need to test * adding a file to tpgtools override at product level * adding function to help with env var, but the patch on tests it's failing * adding the variable to be used in the docs * fixing the test, the network field cannot be immutable * removing the env_var service class and adding a static value * updating the value used from tests and documentation * removing unused resources for docs and tests * fix typos, not used variables and run the fmt * adding description to the basic test * fixed yaml variable override * removing unused resources for tests, and making the test fails with network as immutable * adding encoder to help network field be immutable and be sent on patch method
…ogleCloudPlatform#8273) * adding both resources, basic test for serviceClass it's working, need to fix the test scenario for policy * fix the test scenario and the service class resource properties * adding a testing update, just adding the labels for the resource * added the resource service connection map, and it's basic test, need to evaluate * Revert "added the resource service connection map, and it's basic test, need to evaluate" This reverts commit 4240e1d. * removing the service class in one test scenario and using a static value * fix a typo * removing serviceClass and fix the tests * removing ga tag and updatinga etag for fingerprint type * updating the code, to remove the static value from the docs, need to test * adding a file to tpgtools override at product level * adding function to help with env var, but the patch on tests it's failing * adding the variable to be used in the docs * fixing the test, the network field cannot be immutable * removing the env_var service class and adding a static value * updating the value used from tests and documentation * removing unused resources for docs and tests * fix typos, not used variables and run the fmt * adding description to the basic test * fixed yaml variable override * removing unused resources for tests, and making the test fails with network as immutable * adding encoder to help network field be immutable and be sent on patch method
Adding two new resources in TPG.
Service Connection Policy requires a Service Class
https://cloud.google.com/vpc/docs/about-service-connection-policies
We can find information about the resources in the explorer file
https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest
This PR solves: hashicorp/terraform-provider-google#15051
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
in the generated providers to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)