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

Add missing output fields to Certificate resource. #6322

Conversation

pawel-grz-krawczyk
Copy link
Contributor

@pawel-grz-krawczyk pawel-grz-krawczyk commented Jul 25, 2022

Updated a couple of mistakes in fields descriptions. Changed type of
Certificate.Managed.State from String to Enum.

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)

certificatemanager: added `state`, `authorization_attempt_info` and `provisioning_issue` output fields to `google_certificate_manager_certificate`

Updated a couple of mistakes in fields descriptions. Changed type of
Certificate.Managed.State from String to Enum.
@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I've detected that you're a community contributor. @shuyama1, a repository maintainer, has been assigned to assist you and help review your changes.

❓ First time contributing? Click here for more details

Your assigned reviewer will help review your code by:

  • Ensuring it's backwards compatible, covers common error cases, etc.
  • Summarizing the change into a user-facing changelog note.
  • Passes tests, either our "VCR" suite, a set of presubmit tests, or with manual test runs.

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.


@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 ( 6 files changed, 450 insertions(+), 38 deletions(-))
Terraform Beta: Diff ( 6 files changed, 450 insertions(+), 38 deletions(-))
TF Validator: Diff ( 3 files changed, 118 insertions(+), 11 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2114
Passed tests 1884
Skipped tests: 226
Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests TestAccFirebaserulesRelease_BasicRelease|TestAccComputeInstance_soleTenantNodeAffinities|TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[view]

Tests failed during RECORDING mode:
TestAccComputeInstance_soleTenantNodeAffinities[view]
TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation[view]
TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view]

Please fix these to complete your PR
View the build log or the debug log for each test

@pawel-grz-krawczyk
Copy link
Contributor Author

These 3 test failures seems to be unrelated to the changes in this PR. Two of them have following error message:

Error: Error waiting to create CertificateAuthority: Error waiting for Creating CertificateAuthority: Error code 9, message: Tenancy unit reached the maximum number of tenant projects.

and the third:

  | Error: Error waiting for starting instance: Instance could not be scheduled due to no matching node with property compatibility.
  | 
  | Explanation:
  | The matching node(s) <tf-test-nodegroup-aylek6rlyi-fwsd> are not in READY status.
  | 
  | Potential fix:
  | - Please consider waiting for the matching node(s) to become READY.
  | - Please consider deleting and recreating the node or contacting Google Cloud Support, in case it is taking several minutes for the node to become READY.
  | 
  | 
  |   with google_compute_instance.foobar,
  |   on terraform_plugin_test.tf line 7, in resource "google_compute_instance" "foobar":
  |    7: resource "google_compute_instance" "foobar" {

@shuyama1
Copy link
Member

These 3 test failures seems to be unrelated to the changes in this PR. Two of them have following error message:

Error: Error waiting to create CertificateAuthority: Error waiting for Creating CertificateAuthority: Error code 9, message: Tenancy unit reached the maximum number of tenant projects.

and the third:

  | Error: Error waiting for starting instance: Instance could not be scheduled due to no matching node with property compatibility.
  | 
  | Explanation:
  | The matching node(s) <tf-test-nodegroup-aylek6rlyi-fwsd> are not in READY status.
  | 
  | Potential fix:
  | - Please consider waiting for the matching node(s) to become READY.
  | - Please consider deleting and recreating the node or contacting Google Cloud Support, in case it is taking several minutes for the node to become READY.
  | 
  | 
  |   with google_compute_instance.foobar,
  |   on terraform_plugin_test.tf line 7, in resource "" "foobar":
  |    7: resource "google_compute_instance" "foobar" {

Thanks for making the changes! The failed tests are unrelated to this PR. Don't worry about those. Sorry for the noise.
Got a question about changing the type from String to Enum. Is there any particular reason that we want to change the type to Enum? Are there any issues caused by setting Certificate.Managed.State as String?
We tend to convert Enum type to String in our codebase as to avoid any further modification to the field when API add new values in the future.

@pawel-grz-krawczyk
Copy link
Contributor Author

pawel-grz-krawczyk commented Jul 25, 2022

Is there any particular reason that we want to change the type to Enum? Are there any issues caused by setting Certificate.Managed.State as String?
We tend to convert Enum type to String in our codebase as to avoid any further modification to the field when API add new values in the future.

There are no issues with the type being String. I just saw a couple of Enums in the api.yaml and noticed that this one field is the only exception. I will revert it back to String

I could also change other Enums to String in this file. In that case I assume that description field for such String type would contains only general description, without details about specific "enum" types. E.g.:

                  Reason for provisioning failures.

                  The reason is undefined.

                  Certificate provisioning failed due to an issue with one or more of
                  the domains on the certificate.
                  For details of which domains failed, consult the
                  `authorization_attempt_info` field.

                  Exceeded Certificate Authority quotas or internal rate limits of the
                  system. Provisioning may take longer to complete.

Would change to:

                  Reason for provisioning failures.

Is that correct?

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.

Thanks for adding the fields and updating the documentation!
Just left some review comments and also it would nice if we could change all enum type to string. Thanks!

mmv1/products/certificatemanager/api.yaml Outdated Show resolved Hide resolved
mmv1/products/certificatemanager/api.yaml Outdated Show resolved Hide resolved
@shuyama1
Copy link
Member

shuyama1 commented Aug 1, 2022

/gcbrun

mmv1/products/certificatemanager/api.yaml Outdated Show resolved Hide resolved
mmv1/products/certificatemanager/api.yaml Outdated Show resolved Hide resolved
mmv1/products/certificatemanager/api.yaml Outdated Show resolved Hide resolved
@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 ( 8 files changed, 305 insertions(+), 59 deletions(-))
Terraform Beta: Diff ( 8 files changed, 305 insertions(+), 59 deletions(-))
TF Validator: Diff ( 3 files changed, 118 insertions(+), 11 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2121
Passed tests 1884
Skipped tests: 226
Failed tests: 11

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests TestAccVPCAccessConnector_cloudrunVPCAccessConnectorExample|TestAccSqlUser_mysqlDisabled|TestAccFirebaserulesRelease_BasicRelease|TestAccComputeRouterNat_withNatIpsAndDrainNatIps|TestAccComputeInstance_soleTenantNodeAffinities|TestAccCloudRunService_cloudRunServiceStaticOutboundExample|TestAccCGCSnippet_eventarcWorkflowsExample|TestAccActiveDirectoryDomain_update|TestAccActiveDirectoryDomain_activeDirectoryDomainBasicExample|TestAccActiveDirectoryPeering_activeDirectoryPeeringBasicExample|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccComputeRouterNat_withNatIpsAndDrainNatIps[view]
TestAccVPCAccessConnector_cloudrunVPCAccessConnectorExample[view]
TestAccSqlUser_mysqlDisabled[view]
TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view]
TestAccFirebaserulesRelease_BasicRelease[view]
TestAccCGCSnippet_eventarcWorkflowsExample[view]

Tests failed during RECORDING mode:
TestAccActiveDirectoryDomain_activeDirectoryDomainBasicExample[view]
TestAccComputeInstance_soleTenantNodeAffinities[view]
TestAccCloudRunService_cloudRunServiceStaticOutboundExample[view]
TestAccActiveDirectoryPeering_activeDirectoryPeeringBasicExample[view]
TestAccActiveDirectoryDomain_update[view]

Please fix these to complete your PR
View the build log or the debug log for each test

@pawel-grz-krawczyk
Copy link
Contributor Author

Failed tests seem unrelated to these changes:

  • timeouts / deadline exceeded
  • missing resource - RESOURCE_NOT_READY error (compute API, instance resource)
  • bad request error - looks suspicious but unrelated, logs:
  | Error creating Service: googleapi: Error 400: metadata.annotations: Annotation 'run.googleapis.com/vpc-access-connector' is not supported on resources of kind 'Service'. Supported kinds are: Revision, Execution
  | Details:
  | [
  |   {
  |     "@type": "type.googleapis.com/google.rpc.BadRequest",
  |     "fieldViolations": [
  |       {
  |         "description": "Annotation 'run.googleapis.com/vpc-access-connector' is not supported on resources of kind 'Service'. Supported kinds are: Revision, Execution",
  |         "field": "metadata.annotations"
  |       }
  |     ]
  |   }
  | ]
  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants