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

validation: should use LINE per default #2603

Open
markus2330 opened this Issue Apr 8, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@markus2330
Copy link
Contributor

markus2330 commented Apr 8, 2019

Steps to Reproduce the Problem

kdb mount validation.ecf /tests validation
kdb setmeta user/tests/hello check/validation "[0-9]*"
kdb vset user/tests/hello abc "[0-9]*"

Expected Result

Users expect that now only digits are allowed.

Actual Result

The regex will always match.

System Information

  • Elektra Version: master

Further Log Files and Output

@goJoWe16

This comment has been minimized.

Copy link
Contributor

goJoWe16 commented Apr 10, 2019

I would like to take over this issue as part of the course cm 2019.

@markus2330

This comment has been minimized.

Copy link
Contributor Author

markus2330 commented Apr 10, 2019

Thank you so much! This should be an easy fix but usability-wise it is very important. Someone now worked one week (with breaks) on a specification and did not find out why the validation checks never failed.

Please make sure that you also update the documentation everywhere. (doc/help/kdb-vset.md src/plugins/validation/README.md) and also describe the new behavior in the Compatibility section of doc/news/_preparation_next_release.md

@goJoWe16

This comment has been minimized.

Copy link
Contributor

goJoWe16 commented Apr 10, 2019

Steps to Reproduce the Problem

kdb mount validation.ecf /tests validation
kdb setmeta user/tests/hello "[0-9]*"

@markus2330 Just to make sure: Do you want to also skip the check/validation part before the regex part for usability or did you just forget it in your example?
Skipping the "check/validation/match LINE" part and making it default makes perfect sense for me

@markus2330

This comment has been minimized.

Copy link
Contributor Author

markus2330 commented Apr 10, 2019

Sorry, check/validation needs to be there. (It does not to be there in kdb vset). I updated the example.

The example in the man page of kdb vset is actually wrong, it already documents the behavior as it should be: "The value of this key must only consist of one more of the letter a".

But in kdb vset there is another problem: it does not work properly with cascading keys. Maybe you can simply reject cascading keys (starting with /) as invalid.

Skipping the "check/validation/match LINE" part and making it default makes perfect sense for me

Exactly this is what we want to achieve here. So if no "check/validation/match" is present, the validation plugin should assume LINE as default.

Please also describe what LINE, WORD or ANY means, that is currently not documented.

@goJoWe16

This comment has been minimized.

Copy link
Contributor

goJoWe16 commented Apr 10, 2019

Thank you for the clarification! I think I understand the expected behavior requested in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.