Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn on missing variables #17

Merged
merged 4 commits into from
Dec 2, 2022
Merged

Warn on missing variables #17

merged 4 commits into from
Dec 2, 2022

Conversation

aparlato
Copy link
Contributor

@aparlato aparlato commented Dec 1, 2022

Closes #13

We already had some validation checking for undefined values, but it happened after we ran mergeOverrides which was unintentionally cleaning up these values by cloning layers using JSON.parse(JSON.stringify()).

Since we still want to validate the fully built layer, this PR:

  • switches to using lodash's cloneDeep method for cloning the object to maintain undefined values
  • adds an example scenario where we expect a warning for a missing property value
  • adds a test to confirm mergeOverrides does not remove undefined values

Noting here that we are not explicitly warning that a variable is missing, but that a property value is undefined (which would usually be due to a missing variable). This can be easily inferred from the message to get to the root of the problem.

Copy link
Contributor

@ebrelsford ebrelsford left a comment

Choose a reason for hiding this comment

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

Looks great, mind updating the CHANGELOG while you're at it?

@aparlato aparlato merged commit e64c6f4 into main Dec 2, 2022
@aparlato aparlato deleted the variable-warn branch December 2, 2022 15:33
@aparlato aparlato mentioned this pull request Dec 8, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alert user when a variable is not found
2 participants