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

Implementing COMMAND DOCS #678

Merged
merged 21 commits into from
Oct 7, 2024
Merged

Implementing COMMAND DOCS #678

merged 21 commits into from
Oct 7, 2024

Conversation

TalZaccai
Copy link
Contributor

@TalZaccai TalZaccai commented Sep 19, 2024

  • Added support for COMMAND DOCS command
    • All supported command docs are located in Garnet.server/Resp/RespCommandsDocs.json
  • Added support for specifying docs path in command registration using the REGISTERCS command
  • Added support for specifying command docs when registering command programatically
  • Updated CommandInfoUpdater tool to import existing RESP command docs and unify them with Garnet-specific command docs
    • All Garnet-specific command docs are located in CommandInfoUpdater/GarnetCommandsDocs.json
  • Updated RespCommandInfo to use "flattened-style" RespCommand enum for sub-commands
  • Fixed COMMAND INFO to return sub-command info when called with sub-command name
  • Added COMMAND DOCS tests & updated website docs

Examples:

  • Autocompletion of Garnet-specific commands:
    image
  • Autocompletion of custom commands (requires restarting the client for it to refresh the docs):
    image

@TalZaccai TalZaccai added the API label Sep 19, 2024
Copy link
Contributor

@badrishc badrishc left a comment

Choose a reason for hiding this comment

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

Please check the binary size compared to main, and if it looks reasonable, we can merge.

@TalZaccai
Copy link
Contributor Author

TalZaccai commented Oct 5, 2024

Please check the binary size compared to main, and if it looks reasonable, we can merge.

I've moved the json files to a separate dll that is being loaded (and unloaded) dynamically. The size of Garnet.server.dll is now down to 635KB. Let me know if you like the current solution. The loading & unloading of the assembly would happen at most twice (once for command info init & once for command docs init, on an as-needed basis) and is synchronized as to not cause any issues (Look at RespCommandDataCommon.cs for implementation)

Note: I packed and tested the nuget package locally and it works.

@badrishc
Copy link
Contributor

badrishc commented Oct 6, 2024

Please check the binary size compared to main, and if it looks reasonable, we can merge.

I've moved the json files to a separate dll that is being loaded (and unloaded) dynamically. The size of Garnet.server.dll is now down to 635KB. Let me know if you like the current solution. The loading & unloading of the assembly would happen at most twice (once for command info init & once for command docs init, on an as-needed basis) and is synchronized as to not cause any issues (Look at RespCommandDataCommon.cs for implementation)

Note: I packed and tested the nuget package locally and it works.

LGTM

@TalZaccai TalZaccai merged commit dd89054 into main Oct 7, 2024
18 checks passed
@TalZaccai TalZaccai deleted the talzacc/command_docs branch October 7, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants