fix: $ref structure preservation during intermediate progress updates #133
+364
−246
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
updateResourceUpdateFromProgressto skip property updates when progress hasn't finished successfullyProblem
During create operations with long-running cloud resources, the plugin returns intermediate progress updates with
OperationStatusInProgressand empty properties{}. When these empty properties were merged with user properties, arrays containing $ref structures (used for dependency tracking) were being wiped out.The self-cannibalization bug:
$refstructures in arrays (e.g.,disks[].source.$ref,networkInterfaces[].network.$ref)InProgressstatus and empty properties{}Successstatus and full properties$refstructures are already lost - they can never be recoveredSolution
Skip property updates entirely when the progress hasn't finished successfully. The fix adds an early return in resource update.
This ensures that:
OperationStatusSuccess$refstructures survive the entire create/update lifecycleTest scenario:
disksandnetworkInterfacesarrays with$refstructuresInProgressstatus) with empty properties {}$refstructures are still intact$refobjects$refstructures are preserved and$valuefields are correctly populated