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

Adds startup_probe field to google_cloud_run_service resource for beta #6532

Merged
merged 22 commits into from
Oct 10, 2022

Conversation

yanweiguo
Copy link
Member

@yanweiguo yanweiguo commented Sep 10, 2022

Part of hashicorp/terraform-provider-google#12532.

Adds startup_probe field to google_cloud_run_service resource for google beta provider.

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 field `startup_probe` to resource `google_cloud_run_service` (beta)

@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. @rileykarson, 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 ( 1 file changed, 70 insertions(+))
Terraform Beta: Diff ( 3 files changed, 624 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2171
Passed tests 1931
Skipped tests: 236
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_privatecaCertificateAuthoritySubordinateExample|TestAccComputeInstance_soleTenantNodeAffinities|TestAccCloudRunService_probes|TestAccCGCSnippet_eventarcWorkflowsExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[Debug log]
TestAccCloudRunService_probes[Debug log]
TestAccCGCSnippet_eventarcWorkflowsExample[Debug log]

Tests failed during RECORDING mode:
TestAccComputeInstance_soleTenantNodeAffinities[Error message] [Debug log]

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

@yanweiguo yanweiguo changed the title Adds startup_probe field to google_cloud_run_service resource. Adds startup_probe field to google_cloud_run_service resource for beta Sep 12, 2022
@yanweiguo
Copy link
Member Author

I don't think the failed test is relative to my changes.

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.

Made a first pass! I have a few more thoughts about what we want to test, but those are contingent on how we handle default values for the integer fields.

mmv1/products/cloudrun/api.yaml Show resolved Hide resolved
mmv1/products/cloudrun/api.yaml Show resolved Hide resolved
mmv1/products/cloudrun/api.yaml Show resolved Hide resolved
mmv1/products/cloudrun/api.yaml Show resolved Hide resolved
mmv1/products/cloudrun/terraform.yaml Show resolved Hide resolved
@rileykarson
Copy link
Member

I don't think the failed test is relative to my changes.

Yep, you're all good. Sorry for the noise!

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.

Looks like generation got blocked, that's a bug on our end. Details on how to resolve inline (along with some more implementation questions I was hoping to answer myself from the test logs post-generation. Sorry for the extra qs!)

mmv1/products/cloudrun/api.yaml Show resolved Hide resolved
mmv1/products/cloudrun/api.yaml Show resolved Hide resolved
mmv1/products/cloudrun/terraform.yaml Show resolved Hide resolved
mmv1/products/cloudrun/terraform.yaml Show resolved Hide resolved
default_from_api: true
spec.template.spec.containers.startupProbe.tcpSocket.port: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
spec.template.spec.containers.startupProbe.httpGet.path: !ruby/object:Overrides::Terraform::PropertyOverride
Copy link
Member

Choose a reason for hiding this comment

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

This indicates that the server will pick a non-fixed default for path when not provided. Is that correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

The rules are:

  • Not specified -> "/"
  • Empty string -> "/"
  • Other string -> keep the input

Copy link
Member

Choose a reason for hiding this comment

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

In that case, should we consider a client-side default_value or "/"? That means that if a user doesn't specify anything, they'll get "/" which is the same behaviour as the API.

default_from_api preserves values when the field is unset rather than resets to default, so it's generally undesirable if the default value is fixed.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried default_value = "/".

If I don't specify path, the test passed.

If I specify path="", the test failed due to

~ http_get {
        - path = "/" -> null

          # (3 unchanged blocks hidden)
      }

I think Terraform treats "" as an input, not unset.

@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 ( 1 file changed, 108 insertions(+))
Terraform Beta: Diff ( 4 files changed, 740 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2173
Passed tests 1929
Skipped tests: 238
Failed tests: 6

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccComputeInstance_soleTenantNodeAffinities|TestAccCloudRunService_cloudRunServiceProbesExample|TestAccCloudRunService_probes|TestAccComputeForwardingRule_update|TestAccCGCSnippet_eventarcWorkflowsExample|TestAccFirebaserulesRelease_BasicRelease

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccCloudRunService_probes[Debug log]
TestAccComputeForwardingRule_update[Debug log]
TestAccFirebaserulesRelease_BasicRelease[Debug log]

Tests failed during RECORDING mode:
TestAccComputeInstance_soleTenantNodeAffinities[Error message] [Debug log]
TestAccCloudRunService_cloudRunServiceProbesExample[Error message] [Debug log]
TestAccCGCSnippet_eventarcWorkflowsExample[Error message] [Debug log]

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

@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 ( 1 file changed, 108 insertions(+))
Terraform Beta: Diff ( 4 files changed, 740 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2173
Passed tests 1932
Skipped tests: 238
Failed tests: 3

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|TestAccCloudRunService_cloudRunServiceProbesExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]

Tests failed during RECORDING mode:
TestAccComputeInstance_soleTenantNodeAffinities[Error message] [Debug log]
TestAccCloudRunService_cloudRunServiceProbesExample[Error message] [Debug log]

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

@yanweiguo
Copy link
Member Author

For the failed run of TestAccCloudRunService_cloudRunServiceProbesExample, it is expected that run.googleapis.com/ingress is added by the API.

I'm not sure why other examples tests succeeded. Shall I update cloudRunGoogleProvidedAnnotations to make run.googleapis.com/ingress an allowed annotation? Shall I skip test for the example since its case is covered by other tests I added.

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Looks fine overall, had some follow-up questions on the meaning of empty name&value in the headers fields

description: |-
The header field name.
default_value: ""
send_empty_value: true
Copy link
Contributor

Choose a reason for hiding this comment

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

What does empty mean here? What I want to understand is why a user would want to specify empty rather than some value. Sending an empty header field doesn't make sense, so does empty have a special meaning to the API?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, empty header name doesn't make sense. I checked what GKE does and GKE doesn't allow empty. Our API needs a change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we wait on that change before releasing this then?

Copy link
Contributor

Choose a reason for hiding this comment

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

I have similar questions about the other value field next to this

Copy link
Member Author

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 need to wait since in Terraform side this field is required.

For header value, IIUC, empty is a valid http header value. Just verified GKE also supports empty value.

mmv1/products/cloudrun/terraform.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 ( 1 file changed, 114 insertions(+))
Terraform Beta: Diff ( 4 files changed, 821 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2209
Passed tests 1964
Skipped tests: 240
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
TestAccFirebaserulesRelease_BasicRelease|TestAccComputeInstance_soleTenantNodeAffinities|TestAccComputeForwardingRule_internalTcpUdpLbWithMigBackendExample|TestAccCloudRunService_probes|TestAccBigQueryDataTable_bigtable

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccComputeForwardingRule_internalTcpUdpLbWithMigBackendExample[Debug log]
TestAccCloudRunService_probes[Debug log]
TestAccBigQueryDataTable_bigtable[Debug log]

Tests failed during RECORDING mode:
TestAccComputeInstance_soleTenantNodeAffinities[Error message] [Debug log]

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

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Just one typo change, then should be good to go

mmv1/products/cloudrun/api.yaml Outdated Show resolved Hide resolved
@EricStG
Copy link

EricStG commented Oct 10, 2022

2 quick questions from an interested party:

  • Do you plan to add GRPC probes as well?
  • since tcpSocket and httpGet are exclusives, should they include a conflict property?

@slevenick
Copy link
Contributor

2 quick questions from an interested party:

  • Do you plan to add GRPC probes as well?
  • since tcpSocket and httpGet are exclusives, should they include a conflict property?

Yeah, if that's true they should either have conflicts_with or exactly_one_of on both.

@yanweiguo can you add that if it is appropriate? You can find examples of both in the code base, one thing to note is that you need to hard-code index 0 for nested objects due to how TF represents objects as lists in the underlying structure.

Co-authored-by: Sam Levenick <slevenick@google.com>
@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 ( 1 file changed, 114 insertions(+))
Terraform Beta: Diff ( 4 files changed, 821 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@yanweiguo
Copy link
Member Author

yanweiguo commented Oct 10, 2022

2 quick questions from an interested party:

Yes. Coming soon.

  • since tcpSocket and httpGet are exclusives, should they include a conflict property?

Added. PTAL

@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 ( 1 file changed, 114 insertions(+))
Terraform Beta: Diff ( 4 files changed, 823 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 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 ( 1 file changed, 114 insertions(+))
Terraform Beta: Diff ( 4 files changed, 823 insertions(+))
TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2210
Passed tests 1966
Skipped tests: 240
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|TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample|TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccFirebaserulesRelease_BasicRelease[Debug log]
TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample[Debug log]
TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample[Debug log]

Tests failed during RECORDING mode:
TestAccComputeInstance_soleTenantNodeAffinities[Error message] [Debug log]

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

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.

6 participants