Skip to content

Unknown set blocks with dynamic may have 0 elements#25662

Merged
jbardin merged 1 commit intomasterfrom
jbardin/dynamic-set-block
Aug 12, 2020
Merged

Unknown set blocks with dynamic may have 0 elements#25662
jbardin merged 1 commit intomasterfrom
jbardin/dynamic-set-block

Conversation

@jbardin
Copy link
Copy Markdown
Member

@jbardin jbardin commented Jul 23, 2020

The couldHaveUnknownBlockPlaceholder helper was added to detect when a
set block has a placeholder for an unknown number of values. This works
fine when the number increased from 1, but we were still attempting to
validate the unknown placeholder against the empty set when the final
count turned out to be 0.

Since we can't differentiate the unknown dynamic placeholder value from
an actual unknown number of set values, we have to skip that object's validation
altogether.

Fixes #25600
Fixes #22409 (same case but slightly different cause)

The couldHaveUnknownBlockPlaceholder helper was added to detect when a
set block has a placeholder for an unknown number of values. This worked
fine when the number increased from 1, but we were still attempting to
validate the unknown placeholder against the empty set when the final
count turned out to be 0.

Since we can't differentiate the unknown dynamic placeholder value from
an actual set value, we have to skip that object's validation
altogether.
@jbardin jbardin requested a review from a team July 23, 2020 19:52
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 23, 2020

Codecov Report

Merging #25662 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
plans/objchange/compatible.go 68.66% <100.00%> (ø)
terraform/node_resource_plan.go 91.80% <0.00%> (-1.64%) ⬇️
internal/providercache/dir.go 75.86% <0.00%> (+5.17%) ⬆️

@jbardin jbardin added this to the v0.13.1 milestone Jul 23, 2020
Copy link
Copy Markdown
Contributor

@mildwonkey mildwonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@jbardin jbardin merged commit c8ed0cc into master Aug 12, 2020
@jbardin jbardin deleted the jbardin/dynamic-set-block branch August 12, 2020 14:07
@ghost
Copy link
Copy Markdown

ghost commented Sep 12, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Sep 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

2 participants