Send zero-value photon/serverless/continuous/development for pipelines#5806
Send zero-value photon/serverless/continuous/development for pipelines#5806denik wants to merge 3 commits into
Conversation
These optional boolean fields have meaningful false values, but the Go SDK omits them unless they are listed in ForceSendFields. As a result an explicit `photon = false` (or serverless/continuous/development) in the config was dropped from the create/update request and the platform applied its own default instead. Call SetForceSendFields for these fields in Create and Update so that a user-specified false value is sent to the platform. Co-authored-by: Denis Bilenko <denis.bilenko@databricks.com>
|
Tested with relevant acceptance test in DABs (databricks/cli#5462) On main test records buggy behaviour with terraform:With provider built from this branch test fails because requests now includes zero-valued fields: |
Co-authored-by: Denis Bilenko <denis.bilenko@databricks.com>
Co-authored-by: Denis Bilenko <denis.bilenko@databricks.com>
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
|
@denik I think that we attempted to do this before, but there are some things that should be taken into account. I.e., if we set |
There was a problem hiding this comment.
... set to
falseare sent in the create/update request if specified
Terraform is unable to determine whether those fields are specified by the user or not.
hashicorp/terraform-plugin-sdk#817
Using ForceSendFields for booleans causes the resource to send false on Updates even when not specified by the users, which causes server side errors or a resource which does not work as the user expects.
As Alex said, the solution is a full rewrite of the resource using the Terraform Plugin Framework.
Changes
These optional boolean fields have meaningful false values, but the Go SDK omits them unless they are listed in ForceSendFields. As a result an explicit
photon = false(or serverless/continuous/development) in the config was dropped from the create/update request and the platform applied its own default instead.Call SetForceSendFields for these fields in Create and Update so that a user-specified false value is sent to the platform.
Tests
Tested with DABs: #5806 (comment)
make testrun locallydocs/folderinternal/acceptanceNEXT_CHANGELOG.mdfile