Skip to content

validator: check for undefined fields - #2334

Merged
aluzzardi merged 1 commit into
dagger:mainfrom
aluzzardi:undefined-fields
May 2, 2022
Merged

aluzzardi merged 1 commit into
dagger:mainfrom
aluzzardi:undefined-fields

Conversation

@aluzzardi

@aluzzardi aluzzardi commented Apr 27, 2022 •

Copy link
Copy Markdown
Contributor

Fixes #493

@shykes

shykes commented Apr 27, 2022

Copy link
Copy Markdown
Contributor

omg

@aluzzardi
aluzzardi force-pushed the undefined-fields branch 2 times, most recently from e298716 to fda0608 Compare April 27, 2022 19:51
@aluzzardi

Copy link
Copy Markdown
Contributor Author

Had a couple of test failures but they were actually legitimate (tests were broken in the first place). Fixed and everything seem to work.

@aluzzardi
aluzzardi requested review from helderco and jlongtine April 27, 2022 20:08
@aluzzardi
aluzzardi marked this pull request as ready for review April 27, 2022 20:08
@aluzzardi
aluzzardi requested review from a team and jpadams as code owners April 27, 2022 20:08
@helderco

helderco commented Apr 27, 2022 •

Copy link
Copy Markdown
Contributor

I'm going to put this to the test tomorrow with the open issues tracked in #493. Looks awesome, btw. Major pain potentially solved.

@aluzzardi
aluzzardi force-pushed the undefined-fields branch 2 times, most recently from 9f385cc to 102c42b Compare April 28, 2022 20:08
@aluzzardi

Copy link
Copy Markdown
Contributor Author

Pushed an update:

Trying something ... for #2334, I think I can achieve the same just by checking BottomKind rather than inspecting the error string of Value.Err()
Need to do more tests. Entirely new method, just passively checking for v.Kind() == cue.BottomKind and returning v.Error()

/cc @helderco @jlongtine

@aluzzardi
aluzzardi requested a review from shykes as a code owner April 29, 2022 01:44
@aluzzardi
aluzzardi marked this pull request as draft April 29, 2022 01:44
@aluzzardi

Copy link
Copy Markdown
Contributor Author

@jlongtine @helderco In the end because of false positives, I'm limiting BottomKind errors to "undefined field"

@aluzzardi
aluzzardi force-pushed the undefined-fields branch 2 times, most recently from b3cc2d6 to fd3b2c1 Compare April 29, 2022 23:38
@aluzzardi
aluzzardi marked this pull request as ready for review April 29, 2022 23:38
@aluzzardi

Copy link
Copy Markdown
Contributor Author

This is ready to go!

@aluzzardi

aluzzardi commented Apr 29, 2022 •

Copy link
Copy Markdown
Contributor Author

@helderco I'm not going to close #493 yet because I'm not 100% all the problems are fixed

EDIT: Just saw your #493 (comment) So this will, in fact, close #493 🎉

@aluzzardi
aluzzardi force-pushed the undefined-fields branch 2 times, most recently from 2cd040b to 07bcdd4 Compare April 30, 2022 01:12
Fixes #493

Signed-off-by: Andrea Luzzardi <[email protected]>
@aluzzardi
aluzzardi force-pushed the undefined-fields branch from 07bcdd4 to 034b263 Compare May 2, 2022 19:09

@helderco helderco left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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.

Some cue errors are not caught before running

3 participants