Reproduce PF nested set value crossing - #3572
Draft
corymhall wants to merge 1 commit into
Draft
Conversation
Summary: - allow PF create cross-tests to provide explicit Pulumi input order - add a create parity test for optional computed fields in nested sets Rationale: - deriving Pulumi input from cty.SetVal canonicalizes the set and masks the config-to-plan ordering bug - the red test captures the Datadog SpansMetric value crossing without provider-specific API behavior Tests: - go test ./pkg/pf/tests/internal/cross-tests -count=1 - make test RUN_TEST_CMD='./pkg/pf/tests -run ^TestPFCreateSetNestedBlockPreservesElementCorrelation$ -count=1' (fails as intended: Pulumi crosses stream/tier onto service/status)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3572 +/- ##
==========================================
- Coverage 70.49% 70.48% -0.02%
==========================================
Files 358 358
Lines 39484 39484
==========================================
- Hits 27834 27830 -4
- Misses 9703 9705 +2
- Partials 1947 1949 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pulumi can cross nested
Optional+Computedvalues between elements of a Plugin FrameworkSetNestedBlockduring create. In the DatadogSpansMetriccase, this silently assigns explicittag_namevalues to the wronggroup_bypaths.The proposed state canonicalizes the set, while the PF config keeps the Pulumi source-array order. The Plugin Framework walks planned set elements but obtains each config element by the same numeric index. When a nested attribute plan modifier runs, it can therefore read a value from one config element and write it into another planned element.
This draft adds a focused Terraform/Pulumi create cross-test. The existing helper derives Pulumi input from
cty.SetVal, which canonicalizes the set and masks the bug. The new option lets the test preserve the original Pulumi input order.The test currently fails as intended:
A later change can use this test to verify the runtime fix. This PR does not propose that fix yet.
Downstream: pulumi/pulumi-datadog#1249
Validation:
go test ./pkg/pf/tests/internal/cross-tests -count=1passes.make test RUN_TEST_CMD='./pkg/pf/tests -run ^TestPFCreateSetNestedBlockPreservesElementCorrelation$ -count=1'fails at the plan comparison as intended. Pulumi assignsstreamtoserviceandtiertostatus.