-
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
Add support for Cloud Deploy resources #5710
Add support for Cloud Deploy resources #5710
Conversation
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. @slevenick, please review this PR or find an appropriate assignee. |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 12 files changed, 2100 insertions(+), 2 deletions(-)) |
bump |
mmv1/products/clouddeploy/api.yaml
Outdated
description: | | ||
The timestamp of when the Target was last updated in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. | ||
- !ruby/object:Api::Type::String | ||
name: 'etag' |
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.
Is this needed for any particular reason? We tend to avoid adding etag
and some of these other output-only fields if they aren't needed for other resources that depend on this. Similarly, updateTime & createTime can be removed
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.
Were these needed?
default_from_api: true | ||
Target: !ruby/object:Overrides::Terraform::ResourceOverride | ||
autogen_async: true | ||
id_format: '{{name}}' |
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.
Is name
the right format? This is the short-form, so won't be able to identify the full resource during import?
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.
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.
On a side note, I'm not a fan of something_Id as name is the consistent resource name in most resources. The API uses name as selflink but an identical value can be read with the id attribute.
Precedent: #4951
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.
So, having this id_format ends up with the following code to set the ID of the resource:
// Store the ID now
id, err := replaceVars(d, config, "{{name}}")
if err != nil {
return fmt.Errorf("Error constructing id: %s", err)
}
d.SetId(id)
I don't believe this is right, because it doesn't represent the full resource. The ID format should be projects/{{project}}/locations/{{region}}/deliveryPipelines/{{name}}
so that we can reference this value from other resources within a config (if needed)
Co-authored-by: upodroid <cy@borg.dev>
9968530
to
c67424c
Compare
Ready for review. I'll take another pass at DeliveryPipeline in a separate PR. My assumptions around Target weren't true but docs are non-existant and the UI can't be used to patch the resource. The API docs also doesn't make it clear which fields are required,immutable, etc |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 13 files changed, 2232 insertions(+), 2 deletions(-)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccCloudDeployTarget_update|TestAccCloudDeployTarget_cloudDeployTargetExample|TestAccCloudDeployDeliveryPipeline_cloudDeployDeliveryPipelineExample|TestAccServiceNetworkingPeeredDNSDomain_basic |
Tests passed during RECORDING mode: Tests failed during RECORDING mode: Please fix these to complete your PR |
- !ruby/object:Api::Type::String | ||
name: 'targetId' | ||
required: true | ||
input: true |
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.
These are unnecessary as the whole resource is input: true
default_from_api: true | ||
Target: !ruby/object:Overrides::Terraform::ResourceOverride | ||
autogen_async: true | ||
id_format: '{{name}}' |
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.
So, having this id_format ends up with the following code to set the ID of the resource:
// Store the ID now
id, err := replaceVars(d, config, "{{name}}")
if err != nil {
return fmt.Errorf("Error constructing id: %s", err)
}
d.SetId(id)
I don't believe this is right, because it doesn't represent the full resource. The ID format should be projects/{{project}}/locations/{{region}}/deliveryPipelines/{{name}}
so that we can reference this value from other resources within a config (if needed)
mmv1/products/clouddeploy/api.yaml
Outdated
description: | | ||
The timestamp of when the Target was last updated in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. | ||
- !ruby/object:Api::Type::String | ||
name: 'etag' |
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.
Were these needed?
/gcbrun I enabled the API so the tests should actually run |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 13 files changed, 2232 insertions(+), 2 deletions(-)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccServiceNetworkingPeeredDNSDomain_basic|TestAccCloudDeployTarget_update|TestAccCloudDeployTarget_cloudDeployTargetExample|TestAccCloudDeployDeliveryPipeline_cloudDeployDeliveryPipelineExample|TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic |
Tests passed during RECORDING mode: Tests failed during RECORDING mode: Please fix these to complete your PR |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 13 files changed, 2237 insertions(+), 2 deletions(-)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccFirebaserulesRelease_BasicRelease|TestAccComputeForwardingRule_update|TestAccCloudDeployTarget_update|TestAccCloudDeployTarget_cloudDeployTargetFullExample|TestAccCloudDeployTarget_cloudDeployTargetExample|TestAccCloudDeployDeliveryPipeline_cloudDeployDeliveryPipelineExample |
Tests passed during RECORDING mode: Tests failed during RECORDING mode: Please fix these to complete your PR |
/gcbrun API should be enabled this time! |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 13 files changed, 2237 insertions(+), 2 deletions(-)) |
Tests analyticsTotal tests: Action takenTriggering VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccServiceNetworkingPeeredDNSDomain_basic|TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic|TestAccCloudDeployDeliveryPipeline_cloudDeployDeliveryPipelineExample|TestAccCloudDeployTarget_update|TestAccCloudDeployTarget_cloudDeployTargetFullExample|TestAccCloudDeployTarget_cloudDeployTargetExample |
Tests passed during RECORDING mode: 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.
Thanks!
No problem, I like the new CI process. Did the team work out how to give "trusted" community contributors permissions to view that bucket? |
Unfortunately not yet, but the feedback process should be much faster now! |
This reverts commit e379f06.
)" (GoogleCloudPlatform#5968) This reverts commit e379f06.
* add cloud deploy resources Co-authored-by: upodroid <cy@borg.dev> * add new test * apply suggestions from sam * remove custom flattener * fix import id, add new tests and fix bad rebase
)" (GoogleCloudPlatform#5968) This reverts commit e379f06.
Fixes: hashicorp/terraform-provider-google#11063
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)