WasmEdge / docs

https://wasmedge.org/docs/
Apache License 2.0
17 stars 57 forks source link

Add best practices for plugin #191

Closed mhmohona closed 7 months ago

mhmohona commented 11 months ago

Explanation

Added best practice for plugins.

Related issue

https://github.com/WasmEdge/docs/issues/85

What type of PR is this

/kind documentation

Proposed Changes

alabulei1 commented 11 months ago

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:

  1. The patch assumes prior familiarity with the WasmEdge project and its repository structure. Some clarification and additional context may be needed to accommodate a wider range of users.
  2. Instructions for building and running tests assume a Unix-like environment and the use of the sudo command, which may not be valid for all users.
  3. The documentation lacks guidance on how to interpret test results or handle test failures.
  4. In some patches, there is a lack of code changes to demonstrate the implementation of best practices or the test guide.
  5. Instructions for creating a plugin in C/C++ have some inaccuracies and assumptions that may hinder understanding for users.
  6. Some sections of the documentation have been removed without adequately addressing the impact on users' understanding and usage.
  7. The patch adds a hyperlink that may not function correctly or may lead to an invalid file.

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.

Details

Commit 746f6985fb19edd559b15a08a0aa9fec25414380

Key changes:

Potential problems:

Commit 785cd6e2df378f485d13236f22f5a24699f862f2

Key changes:

Potential problems:

Commit 7ca91af314645c0668ceaa81a5cc25418406666e

Key changes in the patch:

Potential problems:

Commit 3c1f946fa6c4b6eab63a13732799da0cc4cb86bc

Key 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 a50b0138828f7b1e3462eebd46fbe542804b8cd4

Key changes in the patch:

  1. Added a new document test_plugin.md that provides guidance on writing tests for WasmEdge plugins.
  2. Updated the existing best_practice.md document with the new section on testing plugins and added a link to the test_plugin.md document.

Potential problems:

  1. It seems that the patch includes changes to multiple repositories, which may cause confusion and conflicts during the merge process. It would be better to separate the changes into separate commits or patches for each repository.
  2. The patch introduces a new document and updates an existing one, but it doesn't include any actual code changes or bug fixes. It would be useful to include actual code changes in the patch to demonstrate the implementation of the best practices and the test guide.

Commit feaeddd1caf0473eadbadff64fce1a67f3d1bacd

Key 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 7236393d1aafc1c067e251c308a4f83bce0b9636

Key changes:

Potential problems:

Commit 5ea06795e9c66d97902cd505542616b4680dc249

Key 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 807b3ecf16d04e920106f97cd1115c92f43d9e10

Key changes:

Potential problems:

Commit 8922c75fd97f37ac9a4be28fce1d39ff701490ca

Key changes:

Potential problems:

Commit df784aca328b8d466ed8f0d238553876e31fe144

Key changes in the patch:

  1. Removal of sections about checking for updates and verifying the installation of WasmEdge.
  2. Softening the statement about the need to update existing plugins, and adding a link to the WasmEdge API reference.
  3. Adding links to specific language guides for developing plugins in C, C++, and Rust.
  4. Removing the section about exporting SDKs for C/C++ and providing a Rust-specific SDK section.
  5. Adding an example Rust code for creating a Rust library that interfaces with the wasmedge-image plugin.
  6. Adjusting the formatting and structure of the document.

Potential problems:

  1. The removal of the sections about checking for updates and verifying the installation may prevent new developers from understanding how to stay up-to-date with the latest WasmEdge versions or how to ensure the correct installation.
  2. The softening of the statement about updating existing plugins may lead to outdated plugins that are not compatible with the latest WasmEdge version.
  3. The removal of the section about exporting SDKs for C/C++ may make it difficult for developers to understand how to distribute their plugins.
  4. The addition of the Rust-specific SDK section may introduce inconsistency and confusion since the other sections focus on C and C++.
  5. It's unclear whether the example Rust code provided is complete or if it requires additional code to function correctly.

Commit 1cd8779f80de6d49cf21a87e9fbf40aad8af9ec7

Key changes:

Potential problems:

Commit e7f91abddba1ae64c5ba049b8f0a4e45ef97e9b0

Key Changes:

Potential Problems:

Commit 8971f8c7daafae51feb3d0fbe0a3cbf28996859d

Key changes in the patch:

Potential problems:

Overall, the changes seem minor and there are no major issues.

Commit c5ac16e19d5d237c7d406f7280e2741217ca0fe3

Key changes in the patch:

  1. The title of the document has been changed to "Best Practice" instead of "Best Practices".
  2. The introduction sentence of the document has been modified to improve clarity and wording.
  3. The section on "Writing and Compiling the Plugin" has been completely rewritten to provide clearer instructions and examples.
  4. The section on "Error Handling and Input Validation" has been updated to provide better code examples and improve readability.
  5. The section on "Contributing to the WasmEdge Community" has been modified to include a link to the official WasmEdge repository.

Potential problems:

  1. The patch introduces a typo in the sentence "ensure the plugin is well purformed". It should be "ensure the plugin is well-performed".
  2. The code example in the "Writing and Compiling the Plugin" section is incorrect. It uses the language identifier ccp instead of cpp. This should be fixed.
  3. The code example in the "Error Handling and Input Validation" section uses the language identifier cpp instead of c. This should be fixed.
  4. In the last sentence, there is a minor typo. "successful and efficient plugin development process for WasmEdge" should be "successful and efficient plugin development process in WasmEdge".
alabulei1 commented 11 months ago

Generally, you don't provide details in this guide.

alabulei1 commented 10 months ago

Hi @mhmohona

Could you please check out the comments here?

alabulei1 commented 10 months ago

Hi @mhmohona ,

As we discussed many times before, the guide you're writing now is too general to provide practical details for developers.