magic-modules icon indicating copy to clipboard operation
magic-modules copied to clipboard

Add new sample for Cloud Run custom domain mapping

Open rogerthatdev opened this issue 3 years ago • 9 comments

To contribute to the following: https://cloud.google.com/run/docs/mapping-custom-domains

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

  • [X] 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_cloud_run_service: add sample for cloud run custom domain mapping

rogerthatdev avatar Jul 20 '22 22:07 rogerthatdev

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

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

:question: 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 avatar Jul 20 '22 22:07 modular-magician

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

Diff report:

Terraform Beta: Diff ( 1 file changed, 57 insertions(+)) TF OiCS: Diff ( 4 files changed, 128 insertions(+)) TF Cloud Doc Samples: Diff ( 1 file changed, 31 insertions(+))

modular-magician avatar Jul 20 '22 22:07 modular-magician

Tests analytics

Total tests: 2112 Passed tests 1882 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 TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccComputeInstance_soleTenantNodeAffinities|TestAccCloudRunService_cloudrunCustomDomainMappingExample

modular-magician avatar Jul 20 '22 23:07 modular-magician

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

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

modular-magician avatar Jul 20 '22 23:07 modular-magician

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

Diff report:

Terraform GA: Diff ( 1 file changed, 52 deletions(-)) Terraform Beta: Diff ( 1 file changed, 58 insertions(+), 1 deletion(-)) TF Validator: Diff ( 4 files changed, 3 insertions(+), 119 deletions(-)) TF OiCS: Diff ( 4 files changed, 128 insertions(+)) TF Cloud Doc Samples: Diff ( 1 file changed, 31 insertions(+))

modular-magician avatar Jul 25 '22 19:07 modular-magician

Tests analytics

Total tests: 2119 Passed tests 1888 Skipped tests: 226 Failed tests: 5

Action taken

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

modular-magician avatar Jul 25 '22 19:07 modular-magician

Tests passed during RECORDING mode: TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[view] TestAccPrivatecaCertificateAuthority_subordinateCaActivatedByFirstPartyIssuerOnCreation[view] TestAccFirebaserulesRelease_BasicRelease[view]

Tests failed during RECORDING mode: TestAccCloudRunService_cloudrunCustomDomainMappingExample[view] TestAccComputeInstance_soleTenantNodeAffinities[view]

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

modular-magician avatar Jul 25 '22 20:07 modular-magician

It looks like the test is failing due to the domain mapping not being verified: Error checking ownership for domain tf-test-verified-domainyigz9u2yn2: Invalid Link in request: source { domain_name { hostname: "tf-test-verified-domainyigz9u2yn2" } }

It looks like the hostname is specified in the wrong format?

slevenick avatar Jul 25 '22 20:07 slevenick

Regardless of the format, I think that the domain used for this field needs to be a domain that's been verified owned by the organization. Is there a test verified domain that can be used for this field?

rogerthatdev avatar Aug 01 '22 18:08 rogerthatdev

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

Diff report:

Terraform Beta: Diff ( 1 file changed, 57 insertions(+)) TF OiCS: Diff ( 4 files changed, 128 insertions(+)) TF Cloud Doc Samples: Diff ( 1 file changed, 31 insertions(+))

modular-magician avatar Aug 30 '22 21:08 modular-magician

Tests analytics

Total tests: 2152 Passed tests 1910 Skipped tests: 233 Failed tests: 9

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccComputeInstance_soleTenantNodeAffinities|TestAccCloudRunService_cloudrunCustomDomainMappingExample|TestAccCGCSnippet_eventarcWorkflowsExample|TestAccCloudRunService_cloudRunServiceStaticOutboundExample|TestAccFirebaserulesRelease_BasicRelease|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccSqlDatabaseInstance_SqlServerAuditConfig

modular-magician avatar Aug 30 '22 22:08 modular-magician

Tests passed during RECORDING mode: TestAccFirebaserulesRelease_BasicRelease[Debug log]

Tests failed during RECORDING mode: TestAccSqlDatabaseInstance_withPrivateNetwork_withAllocatedIpRange[Error message] [Debug log] TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[Error message] [Debug log] TestAccComputeInstance_soleTenantNodeAffinities[Error message] [Debug log] TestAccCloudRunService_cloudrunCustomDomainMappingExample[Error message] [Debug log] TestAccCGCSnippet_eventarcWorkflowsExample[Error message] [Debug log] TestAccCloudRunService_cloudRunServiceStaticOutboundExample[Error message] [Debug log] TestAccComputeGlobalForwardingRule_internalLoadBalancing[Error message] [Debug log] TestAccSqlDatabaseInstance_SqlServerAuditConfig[Error message] [Debug log]

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

modular-magician avatar Aug 30 '22 22:08 modular-magician

It looks like the test is failing due to the domain mapping not being verified: Error checking ownership for domain tf-test-verified-domainyigz9u2yn2: Invalid Link in request: source { domain_name { hostname: "tf-test-verified-domainyigz9u2yn2" } }

It looks like the hostname is specified in the wrong format?

Could you confirm whether the hostname is the wrong format or if it cannot verify that it's a verified domain? When I run the Terraform myself it won't work unless I provide it a verified domain of my organization.

rogerthatdev avatar Aug 30 '22 22:08 rogerthatdev

You may be able to use ORG_DOMAIN via getTestOrgDomainFromEnv in the test. I would guess that is a verified domain, but I don't have much experience using it.

It can be used like this: https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/products/iap/terraform.yaml#L203

slevenick avatar Sep 01 '22 18:09 slevenick

@rogerthatdev I believe you are already aware, but MM no longer generates CGC samples. Closing here to avoid confusion.

c2thorn avatar Sep 02 '22 19:09 c2thorn