-
Notifications
You must be signed in to change notification settings - Fork 17
Fix schema: config:spack:packages
is a required entry
#247
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
base: main
Are you sure you want to change the base?
Conversation
Now I see that maybe this has not been enforced because of back-compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @albestro. I think I initially had it required when the entry was its own top-level entry. I think I lost the required property when moving it under spack
.
Now I see that maybe this has not been enforced because of back-compatibility.
That was certainly not a conscious choice...
But in the future, we might opt for having official repos as defaults.
I'm in principle in favour of this, but I also like just keeping everything explicit. I don't feel strongly about either option.
for unevaluatedProperties feature
63c6f23
to
134b70d
Compare
I'm an absolute newbie with JSON schemas, but I took the chance to learn a bit about them to trying improving the Main changes:
I quickly tested the new schema against https://github.com/eth-cscs/alps-uenv/tree/main and eth-cscs/alps-uenv#224, and it didn't report any problem. At the moment no test has been added for trivially wrong configs (e.g. missing This PR would shift the error detection towards the schema validation phase instead of raising a python exception. On one side, I'm not sure how much nicer it is to get a strange json validation error message compared to a failure in python code, on the other side if previous statement leans towards python errors then one might ask why we have json schemas. Maybe it is preferrable to have "loose" schemas like they are now, but it sounds like a strange choice. In any case, this PR could just be an interesting (for me) experiment, and we can even drop it if it's not the path we'd like to pursue (or try to cherry-pick a couple of easy things, e.g. required Looking forward to your comments. |
A look at validation error messagesCurrent solution in this PR does not really give useful error messages. I had a quick look at error messages of production version, which might give nicer error messages in some cases, but it's way more loose on many constraints. name: "test"
version: 1
spack: Gives
But apparently it has more information in it that could be helpful
or
|
config:spack:packages
is a required entry but the schema has not been updated to reflect that.The "minimal" required entry for
config.yaml
isFor this PR the easiest way was also the one that made most sense to me.
But in the future, we might opt for having official repos as defaults.