-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add best practices for plugin #191
Conversation
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
Hello, I am a code review bot on flows.network. Here are my reviews of code commits in this PR. Overall Summary: The majority of the changes in the GitHub Pull Request are straightforward additions and improvements to the plugin documentation, without introducing any potential problems or errors. However, there are a few noteworthy findings:
Apart from these findings, the changes provide valuable guidance on best practices for developing, testing, securing, and publishing WasmEdge plugins. The documentation improvements enhance clarity and readability overall. DetailsCommit 746f6985fb19edd559b15a08a0aa9fec25414380Key changes:
Potential problems:
Commit 785cd6e2df378f485d13236f22f5a24699f862f2Key changes:
Potential problems:
Commit 7ca91af314645c0668ceaa81a5cc25418406666eKey changes in the patch:
Potential problems:
Commit 3c1f946fa6c4b6eab63a13732799da0cc4cb86bcKey changes in the patch:
Potential problems:
Overall, the patch provides valuable information on testing a WasmEdge plugin but could benefit from additional context and clarification to accommodate a wider range of users. Commit a50b0138828f7b1e3462eebd46fbe542804b8cd4Key changes in the patch:
Potential problems:
Commit feaeddd1caf0473eadbadff64fce1a67f3d1bacdKey changes in the patch:
Potential problems:
Overall, the patch provides a basic starting point for creating a plugin but lacks important details and guidance on key aspects such as purpose, registration, and testing. Commit 7236393d1aafc1c067e251c308a4f83bce0b9636Key changes:
Potential problems:
Commit 5ea06795e9c66d97902cd505542616b4680dc249Key changes:
Potential problems:
Overall, the changes provide valuable information on best practices for developing and publishing WasmEdge plugins, including security considerations. The addition of the new sections improves the documentation for plugin developers. Commit 807b3ecf16d04e920106f97cd1115c92f43d9e10Key changes:
Potential problems:
Commit 8922c75fd97f37ac9a4be28fce1d39ff701490caKey changes:
Potential problems:
Commit df784aca328b8d466ed8f0d238553876e31fe144Key changes in the patch:
Potential problems:
Commit 1cd8779f80de6d49cf21a87e9fbf40aad8af9ec7Key changes:
Potential problems:
Commit e7f91abddba1ae64c5ba049b8f0a4e45ef97e9b0Key Changes:
Potential Problems:
Commit 8971f8c7daafae51feb3d0fbe0a3cbf28996859dKey changes in the patch:
Potential problems:
Overall, the changes seem minor and there are no major issues. Commit c5ac16e19d5d237c7d406f7280e2741217ca0fe3Key changes in the patch:
Potential problems:
|
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
5. **Testing the Plugin:** | ||
Testing is a crucial step in the development process to ensure that the plugin behaves as expected. There are various testing techniques such as unit testing, integration testing, and fuzz testing that can be used. Unit testing involves testing individual functions or units of code, integration testing involves testing the interaction between the plugin and the Wasm program, and fuzz testing involves generating random input to the plugin to test its robustness and resilience. | ||
|
||
6. **Publishing the Plugin:** |
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.
This is too general. Can you describe more details?
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.
@alabulei1 do you think this section is okay now?
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.
You provide some details, which is good. But I don't think it's ok. As I discussed with you on Discord, can you please take the wasm-image
plugin as an example?
Generally, you don't provide details in this guide. |
Hi @mhmohona Could you please check out the comments here? |
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
|
||
## Writing and Compiling the Plugin | ||
|
||
To create a plugin, you need to define a function in C or C++, and declare it with the `extern "C"` keyword to ensure that the function is exported using C-compatible naming conventions. Then, compile the function as a shared library. |
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.
Please provide some code sample.
|
||
## Registering the Plugin with WasmEdge Runtime | ||
|
||
After compiling the shared library, you need to register the function with the WasmEdge runtime. |
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.
How to register the function? Please provide some details
|
||
By following these steps, you can effectively run tests for the `wasmedge-image` plugin or any other WasmEdge plugin. Also if you want to develop your own tests follow [Writing Tests for WasmEdge Plugins](test_plugin.md) for details. | ||
|
||
## Publishing the Plugin |
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.
How to publish? If i want to contribute my code to the WasmEdge repo, what should I do?
Hi @mhmohona , As we discussed many times before, the guide you're writing now is too general to provide practical details for developers. |
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
Signed-off-by: Mahfuza Humayra Mohona <[email protected]>
Explanation
Added best practice for plugins.
Related issue
#85
What type of PR is this
/kind documentation
Proposed Changes