Skip to content

Conversation

@austinvalle
Copy link
Member

@austinvalle austinvalle commented Mar 17, 2025

Closes #450

Previously, we only checked the AfterUnknown section of the JSON plan when asserting if a value was unknown, this can lead to a confusing error messages when the path is correct, but a known value was present instead, resulting in a "path not found" error.

It looks like previously there was some logic for handling known values, but that only applied to nested/collection paths looking for unknown values (as well as the error message didn't include the actual value).


This PR improves the error messaging for all of the unknown value checks by looking for a known value at the same path. If it can't find a value in either, then the error message will stay the same.

@austinvalle austinvalle added the enhancement New feature or request label Mar 17, 2025
@austinvalle austinvalle added this to the v1.12.0 milestone Mar 17, 2025
@austinvalle austinvalle requested a review from a team as a code owner March 17, 2025 23:03
@austinvalle austinvalle added bug Something isn't working and removed enhancement New feature or request labels Mar 17, 2025
@austinvalle austinvalle force-pushed the av/unknown-error-msg branch from c84133d to 184cdcd Compare March 18, 2025 14:40
@austinvalle austinvalle merged commit b0b505e into main Mar 18, 2025
38 checks passed
@austinvalle austinvalle deleted the av/unknown-error-msg branch March 18, 2025 16:10
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The error message for plancheck.ExpectUnknownValue is misleading when value is known

2 participants