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

Report Schema Error when Data Values Overlay Fails #344

Closed
cari-lynn opened this issue Apr 7, 2021 · 2 comments
Closed

Report Schema Error when Data Values Overlay Fails #344

cari-lynn opened this issue Apr 7, 2021 · 2 comments
Labels
bug This issue describes a defect or unexpected behavior discussion This issue is not a bug or feature and a conversation is needed to find an appropriate resolution

Comments

@cari-lynn
Copy link
Contributor

cari-lynn commented Apr 7, 2021

Why / Context

Previously, there was some work done to report a schema error for when an overlay fails to overlay a data value onto a schema document, but the work was moved to this issue. Because of this, we have some tests that do not pass and are being skipped. Currently, instead of a schema error, we see an overlay error message.

Narrative:
As a configuration author
I want see a helpful error message when my data values file does not conform to my schema
so that I can easily find where the offending items are in my document and fix it


🟢 Report a Schema Error when Overlaying fails

Given I have a schema
And a data value that is not in my schema
When I run ytt that includes that schema and data value
Then I see a error that my data value did not conform to my schema

#@schema/match data_values=True
---
db_conn:
  port: 0
#@ load("@ytt:overlay", "overlay")
#@data/values
---
db_conn:
  #@overlay/match by=overlay.subset({"key_doesnt_exist": True})
  new_key: i should not be here
#! template.yml
#@ load("@ytt:data", "data")
---
db_conn: #@ data.values.db_conn

Then the result of ytt -f schema.yml -f dv.yml -f template.yml --enable-experiment-schema is:

data_values.yml:4 | new_key: i should not be here
                  |
                  | UNEXPECTED KEY - the key of this item was not found in the schema's corresponding map:
                  |      found: new_key
                  |   expected: (a key defined in map) (by schema.yml:3)
                  |   (hint: declare data values in schema and override them in a data values document)```
@aaronshurley aaronshurley added the bug This issue describes a defect or unexpected behavior label Apr 12, 2021
This was referenced Apr 15, 2021
@pivotaljohn
Copy link
Contributor

With the rise of the "Plain YAML as Data Values" (#381) feature comes an approach to providing Data Values that is designed to not result in overlay errors.

When that method becomes the primary way to supply data values, this work becomes far less valuable.

For that reason, we've decided to at least defer this work until later: moved to #323 for this reason.

@pivotaljohn pivotaljohn added the discussion This issue is not a bug or feature and a conversation is needed to find an appropriate resolution label May 28, 2021
@pivotaljohn
Copy link
Contributor

We've recently clarified further the criteria for each pipeline in our backlog.
The probability that this bug will become "won't fix" has increased to the point it shouldn't be considered "carvel accepted" any longer.

For these reasons, moving to "New Issues".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect or unexpected behavior discussion This issue is not a bug or feature and a conversation is needed to find an appropriate resolution
Projects
None yet
Development

No branches or pull requests

3 participants