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

Flow variable import and data type fixes #361

Conversation

patrickcping
Copy link
Contributor

@patrickcping patrickcping commented Aug 19, 2024

Changes

BREAKING CHANGE resource/davinci_flow: Reverted the ability to use flow exports with variable values removed. Variable values are required when importing flows using this provider.
BUG FIX resource/davinci_variable: Fixed panic crash when attempting to create a new flow variable that does not already exist.
BUG FIX resource/davinci_variable: Fixed "Error reading variable: json: cannot unmarshal object into Go struct field" error on all variables when a flow sets a flow variable value to an object type.
BUG FIX resource/davinci_flow: Resolve warnings that state that DaVinci JSON files contain unknown properties when using flow variable nodes.
resource/davinci_flow: Enhanced error messages that result from invalid flow formats.

SDK Update Needed

Requires github.com/samir-gandhi/davinci-client-go v0.5.0

Testing Shell Command

TF_ACC=1 go test -v -timeout 1200s -run ^TestAccResourceVariable_ github.com/pingidentity/terraform-provider-davinci/internal/service/davinci && \
TF_ACC=1 go test -v -timeout 1200s -run ^TestAccResourceFlow_ github.com/pingidentity/terraform-provider-davinci/internal/service/davinci

Testing Results

Expand Results
=== RUN   TestAccResourceVariable_RemovalDrift
=== PAUSE TestAccResourceVariable_RemovalDrift
=== RUN   TestAccResourceVariable_Full_CompanyContext_Clean
=== PAUSE TestAccResourceVariable_Full_CompanyContext_Clean
=== RUN   TestAccResourceVariable_Full_CompanyContext_WithBootstrap
=== PAUSE TestAccResourceVariable_Full_CompanyContext_WithBootstrap
=== RUN   TestAccResourceVariable_Full_FlowInstanceContext_Clean
=== PAUSE TestAccResourceVariable_Full_FlowInstanceContext_Clean
=== RUN   TestAccResourceVariable_Full_FlowInstanceContext_WithBootstrap
=== PAUSE TestAccResourceVariable_Full_FlowInstanceContext_WithBootstrap
=== RUN   TestAccResourceVariable_Full_UserContext_Clean
=== PAUSE TestAccResourceVariable_Full_UserContext_Clean
=== RUN   TestAccResourceVariable_Full_UserContext_WithBootstrap
=== PAUSE TestAccResourceVariable_Full_UserContext_WithBootstrap
=== RUN   TestAccResourceVariable_ChangeDataType
=== PAUSE TestAccResourceVariable_ChangeDataType
=== RUN   TestAccResourceVariable_Values_CompanyContext
=== PAUSE TestAccResourceVariable_Values_CompanyContext
=== RUN   TestAccResourceVariable_Values_FlowInstanceContext
=== PAUSE TestAccResourceVariable_Values_FlowInstanceContext
=== RUN   TestAccResourceVariable_Values_FlowContext
=== PAUSE TestAccResourceVariable_Values_FlowContext
=== RUN   TestAccResourceVariable_BadParameters
=== PAUSE TestAccResourceVariable_BadParameters
=== CONT  TestAccResourceVariable_RemovalDrift
=== CONT  TestAccResourceVariable_Full_UserContext_WithBootstrap
=== CONT  TestAccResourceVariable_Values_FlowInstanceContext
=== CONT  TestAccResourceVariable_BadParameters
=== CONT  TestAccResourceVariable_Values_FlowContext
=== CONT  TestAccResourceVariable_Full_FlowInstanceContext_Clean
=== CONT  TestAccResourceVariable_Values_CompanyContext
=== CONT  TestAccResourceVariable_Full_CompanyContext_WithBootstrap
=== CONT  TestAccResourceVariable_Full_CompanyContext_Clean
=== CONT  TestAccResourceVariable_Full_UserContext_Clean
=== CONT  TestAccResourceVariable_Full_FlowInstanceContext_WithBootstrap
=== CONT  TestAccResourceVariable_ChangeDataType
=== NAME  TestAccResourceVariable_RemovalDrift
    resource_variable_test.go:33: Skipping step 3/4 due to SkipFunc
    resource_variable_test.go:33: Skipping step 4/4 due to SkipFunc
--- PASS: TestAccResourceVariable_RemovalDrift (129.15s)
--- PASS: TestAccResourceVariable_BadParameters (182.83s)
--- PASS: TestAccResourceVariable_ChangeDataType (217.14s)
=== NAME  TestAccResourceVariable_Full_FlowInstanceContext_Clean
    resource_variable_test.go:288: Skipping step 6/8 due to SkipFunc
=== NAME  TestAccResourceVariable_Full_CompanyContext_Clean
    resource_variable_test.go:164: Skipping step 6/12 due to SkipFunc
=== NAME  TestAccResourceVariable_Full_UserContext_WithBootstrap
    resource_variable_test.go:392: Skipping step 6/8 due to SkipFunc
=== NAME  TestAccResourceVariable_Full_CompanyContext_WithBootstrap
    resource_variable_test.go:164: Skipping step 6/12 due to SkipFunc
=== NAME  TestAccResourceVariable_Full_FlowInstanceContext_WithBootstrap
    resource_variable_test.go:288: Skipping step 6/8 due to SkipFunc
=== NAME  TestAccResourceVariable_Full_UserContext_Clean
    resource_variable_test.go:392: Skipping step 6/8 due to SkipFunc
--- PASS: TestAccResourceVariable_Full_FlowInstanceContext_Clean (393.62s)
--- PASS: TestAccResourceVariable_Full_FlowInstanceContext_WithBootstrap (398.56s)
--- PASS: TestAccResourceVariable_Full_UserContext_WithBootstrap (399.20s)
--- PASS: TestAccResourceVariable_Full_UserContext_Clean (401.04s)
--- PASS: TestAccResourceVariable_Full_CompanyContext_Clean (465.52s)
--- PASS: TestAccResourceVariable_Full_CompanyContext_WithBootstrap (469.95s)
--- PASS: TestAccResourceVariable_Values_CompanyContext (513.62s)
--- PASS: TestAccResourceVariable_Values_FlowContext (515.57s)
--- PASS: TestAccResourceVariable_Values_FlowInstanceContext (520.83s)
PASS
ok      github.com/pingidentity/terraform-provider-davinci/internal/service/davinci     522.163s
=== RUN   TestAccResourceFlow_RemovalDrift
=== PAUSE TestAccResourceFlow_RemovalDrift
=== RUN   TestAccResourceFlow_Basic_Clean
=== PAUSE TestAccResourceFlow_Basic_Clean
=== RUN   TestAccResourceFlow_Basic_WithBootstrap
=== PAUSE TestAccResourceFlow_Basic_WithBootstrap
=== RUN   TestAccResourceFlow_ConnectionSubflowLinks_WithMappingIDs_Clean
=== PAUSE TestAccResourceFlow_ConnectionSubflowLinks_WithMappingIDs_Clean
=== RUN   TestAccResourceFlow_ConnectionSubflowLinks_WithMappingIDs_WithBootstrap
=== PAUSE TestAccResourceFlow_ConnectionSubflowLinks_WithMappingIDs_WithBootstrap
=== RUN   TestAccResourceFlow_ConnectionSubflowLinks_WithoutMappingIDs_Clean
=== PAUSE TestAccResourceFlow_ConnectionSubflowLinks_WithoutMappingIDs_Clean
=== RUN   TestAccResourceFlow_ConnectionSubflowLinks_WithoutMappingIDs_WithBootstrap
=== PAUSE TestAccResourceFlow_ConnectionSubflowLinks_WithoutMappingIDs_WithBootstrap
=== RUN   TestAccResourceFlow_ComputeDifferences_ModifySettings
=== PAUSE TestAccResourceFlow_ComputeDifferences_ModifySettings
=== RUN   TestAccResourceFlow_ComputeDifferences_CompanyId
=== PAUSE TestAccResourceFlow_ComputeDifferences_CompanyId
=== RUN   TestAccResourceFlow_ComputeDifferences_Version
=== PAUSE TestAccResourceFlow_ComputeDifferences_Version
=== RUN   TestAccResourceFlow_ComputeDifferences_Description
=== PAUSE TestAccResourceFlow_ComputeDifferences_Description
=== RUN   TestAccResourceFlow_ComputeDifferences_AdditionalProperties
=== PAUSE TestAccResourceFlow_ComputeDifferences_AdditionalProperties
=== RUN   TestAccResourceFlow_ComputeDifferences_NewNode
=== PAUSE TestAccResourceFlow_ComputeDifferences_NewNode
=== RUN   TestAccResourceFlow_UnknownFlowString
=== PAUSE TestAccResourceFlow_UnknownFlowString
=== RUN   TestAccResourceFlow_BrokenFlow
=== PAUSE TestAccResourceFlow_BrokenFlow
=== RUN   TestAccResourceFlow_Variables_Clean
=== PAUSE TestAccResourceFlow_Variables_Clean
=== RUN   TestAccResourceFlow_Variables_WithBootstrap
=== PAUSE TestAccResourceFlow_Variables_WithBootstrap
=== RUN   TestAccResourceFlow_Variables_Invalid
=== PAUSE TestAccResourceFlow_Variables_Invalid
=== RUN   TestAccResourceFlow_Variables_Overridden_Clean
=== PAUSE TestAccResourceFlow_Variables_Overridden_Clean
=== RUN   TestAccResourceFlow_Variables_Overridden_WithBootstrap
=== PAUSE TestAccResourceFlow_Variables_Overridden_WithBootstrap
=== RUN   TestAccResourceFlow_BadParameters
=== PAUSE TestAccResourceFlow_BadParameters
=== CONT  TestAccResourceFlow_RemovalDrift
=== CONT  TestAccResourceFlow_ComputeDifferences_AdditionalProperties
=== CONT  TestAccResourceFlow_ConnectionSubflowLinks_WithoutMappingIDs_WithBootstrap
=== CONT  TestAccResourceFlow_Variables_WithBootstrap
=== CONT  TestAccResourceFlow_Variables_Overridden_WithBootstrap
=== CONT  TestAccResourceFlow_ComputeDifferences_NewNode
=== CONT  TestAccResourceFlow_Variables_Overridden_Clean
=== CONT  TestAccResourceFlow_ConnectionSubflowLinks_WithMappingIDs_WithBootstrap
=== CONT  TestAccResourceFlow_Variables_Clean
=== CONT  TestAccResourceFlow_BadParameters
=== CONT  TestAccResourceFlow_Variables_Invalid
=== CONT  TestAccResourceFlow_ComputeDifferences_Version
=== NAME  TestAccResourceFlow_Variables_Overridden_WithBootstrap
    resource_flow_test.go:1239: Skipping test with bootstrap config: https://github.com/pingidentity/terraform-provider-davinci/issues/266
--- SKIP: TestAccResourceFlow_Variables_Overridden_WithBootstrap (0.02s)
=== NAME  TestAccResourceFlow_Variables_WithBootstrap
    resource_flow_test.go:1001: Skipping test with bootstrap config: https://github.com/pingidentity/terraform-provider-davinci/issues/266
--- SKIP: TestAccResourceFlow_Variables_WithBootstrap (0.02s)
=== CONT  TestAccResourceFlow_UnknownFlowString
=== CONT  TestAccResourceFlow_ComputeDifferences_ModifySettings
=== CONT  TestAccResourceFlow_ConnectionSubflowLinks_WithMappingIDs_Clean
=== CONT  TestAccResourceFlow_ConnectionSubflowLinks_WithoutMappingIDs_Clean
=== CONT  TestAccResourceFlow_BrokenFlow
=== CONT  TestAccResourceFlow_ComputeDifferences_CompanyId
=== NAME  TestAccResourceFlow_ConnectionSubflowLinks_WithMappingIDs_WithBootstrap
    resource_flow_test.go:323: Skipping test with bootstrap config: https://github.com/pingidentity/terraform-provider-davinci/issues/266
--- SKIP: TestAccResourceFlow_ConnectionSubflowLinks_WithMappingIDs_WithBootstrap (0.01s)
=== CONT  TestAccResourceFlow_ComputeDifferences_Description
--- PASS: TestAccResourceFlow_Variables_Invalid (26.98s)
=== CONT  TestAccResourceFlow_Basic_WithBootstrap
    resource_flow_test.go:178: Skipping test with bootstrap config: https://github.com/pingidentity/terraform-provider-davinci/issues/266
--- SKIP: TestAccResourceFlow_Basic_WithBootstrap (0.01s)
=== CONT  TestAccResourceFlow_Basic_Clean
--- PASS: TestAccResourceFlow_BrokenFlow (228.43s)
=== NAME  TestAccResourceFlow_RemovalDrift
    resource_flow_test.go:39: Skipping step 3/4 due to SkipFunc
    resource_flow_test.go:39: Skipping step 4/4 due to SkipFunc
--- PASS: TestAccResourceFlow_UnknownFlowString (281.30s)
--- PASS: TestAccResourceFlow_RemovalDrift (292.52s)
=== NAME  TestAccResourceFlow_Variables_Clean
    resource_flow_test.go:995: Skipping step 2/4 due to SkipFunc
=== NAME  TestAccResourceFlow_Variables_Overridden_Clean
    resource_flow_test.go:1233: Skipping step 2/4 due to SkipFunc
--- PASS: TestAccResourceFlow_BadParameters (306.57s)
--- PASS: TestAccResourceFlow_ComputeDifferences_Version (324.10s)
--- PASS: TestAccResourceFlow_ComputeDifferences_AdditionalProperties (324.16s)
--- PASS: TestAccResourceFlow_ComputeDifferences_NewNode (325.42s)
--- PASS: TestAccResourceFlow_ComputeDifferences_CompanyId (328.33s)
--- PASS: TestAccResourceFlow_ComputeDifferences_ModifySettings (329.03s)
--- PASS: TestAccResourceFlow_ComputeDifferences_Description (329.91s)
--- PASS: TestAccResourceFlow_Variables_Clean (414.79s)
--- PASS: TestAccResourceFlow_Variables_Overridden_Clean (425.59s)
--- PASS: TestAccResourceFlow_ConnectionSubflowLinks_WithMappingIDs_Clean (592.64s)
--- PASS: TestAccResourceFlow_Basic_Clean (565.68s)
--- PASS: TestAccResourceFlow_ConnectionSubflowLinks_WithoutMappingIDs_Clean (594.24s)
--- PASS: TestAccResourceFlow_ConnectionSubflowLinks_WithoutMappingIDs_WithBootstrap (962.20s)
PASS
ok      github.com/pingidentity/terraform-provider-davinci/internal/service/davinci     963.251s

@patrickcping patrickcping added type/bug Something isn't working status/blocked/upstream-sdk The issue/PR is blocked by an upstream SDK labels Aug 19, 2024
@patrickcping patrickcping added this to the v0.4.1 milestone Aug 19, 2024
@patrickcping patrickcping self-assigned this Aug 19, 2024
@patrickcping patrickcping added the status/blocked/upstream-api The issue/PR is blocked by an upstream API label Aug 20, 2024
@patrickcping patrickcping added breaking change A PR or issue identified as needing a breaking change and removed status/blocked/upstream-api The issue/PR is blocked by an upstream API labels Aug 20, 2024
@patrickcping patrickcping removed the status/blocked/upstream-sdk The issue/PR is blocked by an upstream SDK label Aug 20, 2024
@patrickcping patrickcping marked this pull request as ready for review August 20, 2024 18:56
@patrickcping patrickcping requested review from a team and samir-gandhi as code owners August 20, 2024 18:56
@patrickcping patrickcping merged commit 0b7885f into main Aug 20, 2024
13 checks passed
@patrickcping patrickcping deleted the 360-error-reading-variable-json-cannot-unmarshal-object-into-go-struct-field branch August 20, 2024 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change A PR or issue identified as needing a breaking change type/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Error reading variable: json: cannot unmarshal object into Go struct field"
1 participant