-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Handle custom decoders as part of setting fields in post_create #13520
base: main
Are you sure you want to change the base?
Handle custom decoders as part of setting fields in post_create #13520
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Following GoogleCloudPlatform#12939 this will trigger proper generation of post-create code
This comment was marked as outdated.
This comment was marked as outdated.
6edd784
to
75c78bb
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
Previously this didn't matter because it returns immediately, but we need to mark it as async to prevent trying to decode
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 1522 Click here to see the affected service packages
Action takenFound 11 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🔴 Tests failed during RECORDING mode: 🔴 Several tests terminated during RECORDING mode. 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
…tion that is shared with polling async post-create
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
This isn't working quite right - for example, a few Chronicle resources are no longer having their fields set on post_create after this change. |
#12939 started triggering generation of post-create code, but it missed adding support for decoders (which are already used by the equivalent code for pulling computed fields from operation responses.) I also added (harmless at the time) setting of fields for resources that use PollAsync on create.
Decoder support is necessary to properly handle some resources, like bigqueryanalyticshub_listing_subscription. In this specific case, we do end up just moving some code around from one custom code template to another; however, this may reduce the need for post_create custom code on other resources as well.
However, adding decoder support means that we need to stop running this code immediately after create for PollAsync resources (because the decoder returns
nil
until the resource exists). But we can't just remove setting of id format fields in post-create either, because some resources were relying on it from before #12939.Since the logic for doing the setting is the same regardless, I factored it out into a separate generated function that can get called in the appropriate part of Create whether it's not async or uses poll async.
(I think we should use the same function for setting id format fields on post-create for OpAsync as well - it's currently still relying on "identity" fields - but I'm leaving that for a separate PR.)
Part of hashicorp/terraform-provider-google#22214
Fixed hashicorp/terraform-provider-google#22239
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.