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

kdb set with validation #1164

Closed
Tracked by #4431
markus2330 opened this issue Dec 3, 2016 · 27 comments · May be fixed by #4907
Closed
Tracked by #4431

kdb set with validation #1164

markus2330 opened this issue Dec 3, 2016 · 27 comments · May be fixed by #4907
Assignees
Labels
Projects
Milestone

Comments

@markus2330
Copy link
Contributor

markus2330 commented Dec 3, 2016

kdb set: always do cascading set (for validation)

Current behavior

kdb set user:/test value

does not validate.

Expected behavior

kdb set user:/test value should validate (except if -f is used)

@markus2330 markus2330 added this to the 0.8.20 milestone Dec 3, 2016
@markus2330 markus2330 self-assigned this Dec 3, 2016
@markus2330 markus2330 removed their assignment Aug 2, 2017
@markus2330 markus2330 removed this from the 0.8.20 milestone Oct 13, 2017
@markus2330 markus2330 added this to the 0.9.0 milestone Jan 26, 2019
@kodebach
Copy link
Member

Other problems with kdb set are:

  • internal/** metadata is not removed
  • origvalue metadata is not removed (breaks all future kdb get, until it is removed)

@markus2330 markus2330 added this to To Do in 1.0 Nov 13, 2019
@markus2330 markus2330 moved this from To Do to Should Be Done in 1.0 Nov 14, 2019
@stale
Copy link

stale bot commented Sep 28, 2020

I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@stale stale bot added the stale label Sep 28, 2020
@markus2330 markus2330 removed the stale label Sep 29, 2020
@markus2330 markus2330 moved this from API to Semantics in 1.0 Oct 26, 2020
@stale
Copy link

stale bot commented Sep 29, 2021

I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@stale stale bot added stale and removed stale labels Sep 29, 2021
@markus2330
Copy link
Contributor Author

@atmaxinger can you check if this is still open?

@atmaxinger
Copy link
Contributor

atmaxinger commented Aug 8, 2022

Okay so I tested this issue against the current master

The setup:

kdb mount `pwd`/i1164/spec.ni spec:/i1164 ni
kdb meta-set spec:/i1164/port type unsigned_short
kdb meta-set spec:/i1164/port check/type unsigned_short
kdb set user:/i1164/port 123

kdb meta-get user:/i1164/port check/type correctly returns unsigned_short
kdb meta-get /i1164/port check/type correctly returns unsigned_short

kdb set user:/i1164/port abc --> does not validate, sets the value as string
kdb set -N user /i1164/port abc --> invalid option -- 'N'

@markus2330
Copy link
Contributor Author

Thank you for reproducing! That -N doesn't work anymore is fine (it was redundant).

But kdb set user:/i1164/port abc should do validation, this is very problematic, as this is the main way how values should be changed.

I updated the top-post.

@kodebach
Copy link
Member

kodebach commented Aug 8, 2022

The setup: [...]

If that's the full setup, it cannot work. Neither the type plugin nor the any plugin for meta:/port are mounted. You either need an extra spec-mount or a more direct mount command with extra plugins.

EDIT: But looking at the code in src/tools/kdb/set.cpp, there is no attempt to assure a cascading parent key AFAICT, so adding the plugins probably won't change anything.

@atmaxinger
Copy link
Contributor

If that's the full setup, it cannot work. Neither the type plugin nor the any plugin for meta:/port are mounted. You either need an extra spec-mount or a more direct mount command with extra plugins.

Yes that's the full setup. TBH I thougt it would need some plugins, but I followed this guide and there was no mentioning of extra mounting the namespace with the plugins. If this is the case, the documentation should be revised to include this information.

@markus2330 markus2330 assigned hannes99 and unassigned atmaxinger Aug 8, 2022
@kodebach
Copy link
Member

kodebach commented Aug 8, 2022

Stopped before or you skipped the essential spec-mount step. This infers the required plugins from the meta:/ keys and creates appropriate mountpoints.

@atmaxinger
Copy link
Contributor

Yes I skipped it, as the description

This specification mount makes sure that the paths where the concrete configuration should be (app.ni) are ready to fulfill our specification (spec.ni).

sounded like it was only necessary when mounting the configuration from a file. As Elektra is also usable without mounting specific files (i.e. elektrified applications), I didn't think this was necessary.

@kodebach
Copy link
Member

kodebach commented Aug 8, 2022

It's not about whether or not you are using a file. It's about the existence of a mountpoint. If you don't call kdb mount (indirectly also happens via kdb spec-mount), your config will be saved in the default mountpoints (assuming no other more specific mountpoint exists from something else). But plugins only work, if they are explicitly added to a mountpoint. The default moutpoints only contain the bare minimum (storage and resolver plugins).

hannes99 added a commit that referenced this issue May 19, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue May 19, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue May 19, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue May 30, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue May 30, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue May 31, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue May 31, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue May 31, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 1, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 1, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 1, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 1, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 1, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 2, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 8, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 8, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 8, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 8, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 9, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 9, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 10, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 11, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 13, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 14, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jul 5, 2023
... and (partial) fix #3742, fix #4028, fix #1164
Copy link

I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@github-actions github-actions bot added the stale label Feb 29, 2024
Copy link

I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 14, 2024
1.0 automation moved this from In Progress to Done Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
1.0
  
Done
Development

Successfully merging a pull request may close this issue.

5 participants