-
Notifications
You must be signed in to change notification settings - Fork 961
Make all ACL categories explicit in JSON files #2887
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
Make all ACL categories explicit in JSON files #2887
Conversation
Signed-off-by: Daniil Kashapov <[email protected]>
Signed-off-by: Daniil Kashapov <[email protected]>
|
|
Replication fail in module API tests are strange, I was unable to reproduce them locally with or without ASAN, will try to understand from crash report. |
|
The CI failure is because of #2886. |
Signed-off-by: Daniil Kashapov <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #2887 +/- ##
============================================
- Coverage 72.44% 72.40% -0.05%
============================================
Files 128 128
Lines 70487 70477 -10
============================================
- Hits 51066 51028 -38
- Misses 19421 19449 +28
🚀 New features to boost your workflow:
|
…-acl-categories Signed-off-by: Daniil Kashapov <[email protected]>
zuiderkwast
left a comment
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.
OK, explicit is better than implicit. It looks good in general. The actual change is not huge if we ignore the generated JSON changes.
Have you checked that the ACL categories are the same before/after this change? For example comparing the reply of COMMAND?
How is this change affecting commands defined using ValkeyModule_CreateCommand? Do they use implicit ACL rules?
Signed-off-by: Daniil Kashapov <[email protected]>
|
@zuiderkwast Thank you for feedback! Applied review recommendations, PTAL
Yes, no changes in COMMAND output.
Current module code does not assume anything about ACL categories for new commands, so no need to handle implicit, we set implicit categories only for commands from JSON files. |
Great!
OK, good. It makes things easier.
I believe you're right. I read the code and I couldn't see any code path from the module code to implicit ACL categories. No, let's not add any validation for modules. It might break existing modules. Let's keep the scope of this PR small and without breaking changes. |
|
@zuiderkwast so I triple checked everything by locally reverting |
Yes, I think so too. I wanted to compare the output of for c in $(./valkey-cli command list) ; do
diff <(./valkey-cli -p 11111 command info "$c") \
<(./valkey-cli command info "$c") || echo "MISMATCH: $c"
doneThis chows mismatch for CLUSTER, CLIENT, ACL, FUNCTION. Then, I tried to just sort the output line by line before comparing. Then everything matches: for c in $(./valkey-cli command list) ; do
diff <(./valkey-cli -p 11111 command info "$c"|sort) \
<(./valkey-cli command info "$c"|sort) || echo "MISMATCH: $c"
doneSo it's safe to say that this PR does not change the ACL categories of any command. |
|
Thank you! I had to use some frankenstein regexes to handle COMMAND's not sorted reply, your check is definitely more clever xD |
Resolves valkey-io#417 --------- Signed-off-by: Daniil Kashapov <[email protected]>
### Description As of valkey-io/valkey#2887 all ACL categories are explicit and we don't need to assume anything about them. ### Current behaviour (All ACL categories that were implicit are duplicated): <img width="1039" height="822" alt="Screenshot 2025-12-03 at 15 37 50" src="https://github.com/user-attachments/assets/088e5113-d1ef-4bd8-93b2-4e25da3c45c8" /> ### New behaviour (No duplicates): <img width="1066" height="808" alt="Screenshot 2025-12-03 at 15 37 35" src="https://github.com/user-attachments/assets/9f2fa00d-c0fd-4975-988e-011dcdbaad3c" /> ### Check List - [x] Commits are signed per the DCO using `--signoff` By submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License. Signed-off-by: Daniil Kashapov <[email protected]>
Deleting logic that is now not needed as of valkey-io/valkey#2887, although everything worked correctly because `set()` was used. Signed-off-by: Daniil Kashapov <[email protected]>
Resolves #417
Script used for updating JSON files will be added as a separate comment.