Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

return array value evaluation diagnostics #113

Merged
merged 1 commit into from
Jun 17, 2019
Merged

return array value evaluation diagnostics #113

merged 1 commit into from
Jun 17, 2019

Conversation

notnoop
Copy link
Contributor

@notnoop notnoop commented Jun 17, 2019

Fix a bug where diagnostics found when evaluating array individual
elements are ignored, resulting in suppressed errors.

Nomad observed this issue in hashicorp/nomad#5694.

Fix a bug where diagnostics found when evaluating array individual
elements are ignored, resulting in suppressed errors.

Nomad observed this issue in hashicorp/nomad#5694.
@codecov-io
Copy link

codecov-io commented Jun 17, 2019

Codecov Report

Merging #113 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #113      +/-   ##
==========================================
+ Coverage   68.69%   68.75%   +0.05%     
==========================================
  Files          98       98              
  Lines       10299    10301       +2     
==========================================
+ Hits         7075     7082       +7     
+ Misses       2897     2894       -3     
+ Partials      327      325       -2
Impacted Files Coverage Δ
hcl/json/structure.go 68.44% <100%> (+1.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 318e80e...8a68b3e. Read the comment docs.

Copy link
Contributor

@apparentlymart apparentlymart left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks 🎉

@notnoop notnoop merged commit 4fba5e1 into master Jun 17, 2019
@notnoop notnoop deleted the b-array-diags branch June 17, 2019 16:00
notnoop pushed a commit to hashicorp/nomad that referenced this pull request Jun 17, 2019
This upgrades hcl2 library dependency to pick up
hashicorp/hcl2#113 .

Prior to this change, parsing and decoding array attributes containing
invalid errors (e.g. references to unknown variables) are silently
dropped, with `cty.Unknown` being assigned to the bad element.  Rather
than showing a type/meaningful error from hcl2, we get a very decrypted
error message from msgpack layer trying to handle `cty.unknown`.

This ensures that we propagate diagnostics correctly and report
meaningful errors to users.

Fixes #5694
Fixes #5680
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants