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 field traffic.tag and traffic.url to Cloud Run #5772

Merged
merged 6 commits into from
May 4, 2022

Conversation

ybourgery
Copy link
Contributor

@ybourgery ybourgery commented Mar 2, 2022

Fixes hashicorp/terraform-provider-google#8654

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)

cloudrun: added `traffic.tag` and `traffic.url` fields to `google_cloud_run_service`

@modular-magician
Copy link
Collaborator

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

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@rileykarson, please review this PR or find an appropriate assignee.

@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 ( 2 files changed, 53 insertions(+))
Terraform Beta: Diff ( 2 files changed, 53 insertions(+))
TF Validator: Diff ( 3 files changed, 25 insertions(+), 3 deletions(-))

@rileykarson
Copy link
Member

Can you use the tag field in one of the preexisting tests?

@ybourgery
Copy link
Contributor Author

I added the tag field in one of the tests

@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 ( 3 files changed, 54 insertions(+))
Terraform Beta: Diff ( 3 files changed, 54 insertions(+))
TF Validator: Diff ( 3 files changed, 25 insertions(+), 3 deletions(-))

@george-oakling
Copy link

This one looks good!

@acazacu
Copy link

acazacu commented Apr 20, 2022

I was on my way to making this exact change, but then I discovered this PR 🎉. Making the tag field available in the google Terraform providers would significantly ease my life.

@rileykarson, insofar that I can see, the pipeline looks green. Is there anything missing in this PR so that it can be merged?

Edit: @ybourgery, this might be a silly suggestion, but maybe it this helps give this PR more attention and fast-track it to main. Your PR body is not correctly formatted and, because of this, the PR lists 4/5 tasks complete. I think you are missing a space between [x] and the word Searched. GitHub does not recognise that line as Task.

@rileykarson
Copy link
Member

Sorry! Lost email on my part, I'll fix the Magician message to provide a call-to-action. @ybourgery: Do you mind rebasing this? We've changed part of our CI, and it partially draws from the config at the merge base.

@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 ( 3 files changed, 54 insertions(+))
Terraform Beta: Diff ( 3 files changed, 54 insertions(+))
TF Validator: Diff ( 3 files changed, 25 insertions(+), 3 deletions(-))

@ybourgery
Copy link
Contributor Author

@rileykarson I did the rebase

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1988
Passed tests 1742
Skipped tests: 240
Failed tests: 6

Action taken

Triggering VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccOrganizationPolicy|TestAccServiceNetworkingPeeredDNSDomain_basic|TestAccFirebaserulesRelease_BasicRelease|TestAccCloudRunService_foregroundDeletion|TestAccCloudRunService_cloudRunServiceUpdate|TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccOrganizationPolicy[view]
TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic[view]
TestAccFirebaserulesRelease_BasicRelease[view]
TestAccServiceNetworkingPeeredDNSDomain_basic[view]

Tests failed during RECORDING mode:
TestAccCloudRunService_foregroundDeletion[view]
TestAccCloudRunService_cloudRunServiceUpdate[view]

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

@rileykarson
Copy link
Member

This seems to cause an issue when health checking for both tests affected by the changed config, here's the error:

Error: Error waiting to create Service: resource is in failed state "Ready:False", message: Cloud Run error: Internal error occurred while performing container health check.

  on terraform_plugin_test.tf line 2, in resource "google_cloud_run_service" "default":
   2: resource "google_cloud_run_service" "default" {

I'm not super familiar with Cloud Run configuration in-depth, but a read of https://cloud.google.com/run/docs/rollouts-rollbacks-traffic-migration#tags suggests that we probably need a second untagged traffic block, in order to receive traffic and pass the health check.

@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 ( 3 files changed, 54 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 3 files changed, 54 insertions(+), 1 deletion(-))
TF Validator: Diff ( 3 files changed, 25 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1995
Passed tests 1750
Skipped tests: 241
Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccCloudRunService_foregroundDeletion|TestAccCloudRunService_cloudRunServiceUpdate|TestAccServiceNetworkingPeeredDNSDomain_basic|TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic

@ybourgery
Copy link
Contributor Author

@rileykarson I think the issue was coming from the fact that the test was using the args field in the cloud run specification and when removing it the tests are passing when I run them locally.

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic[view]
TestAccServiceNetworkingPeeredDNSDomain_basic[view]
TestAccCloudRunService_foregroundDeletion[view]
TestAccCloudRunService_cloudRunServiceUpdate[view]

All tests passed
View the build log or the debug log for each test

@rileykarson
Copy link
Member

Cool! Thanks for figuring that out.

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.

Traffic tags and URLs removed from Cloud Run traffic definition
5 participants