-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Changed: Enhance DataLayer Plugin Registration System for Improved Third-Party Integration #17711
Changed: Enhance DataLayer Plugin Registration System for Improved Third-Party Integration #17711
Conversation
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
e222a57
to
f1fde29
Compare
Michael, you have an extraneous update to the |
@emlowe |
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.
Shouldn't the plugin files allow for the full PluginRemote
schema (albeit two items) so that these new plugins can provide custom headers such as for authentication?
Co-authored-by: Kyle Altendorf <[email protected]>
Added support for PluginRemote schema |
I think the only real question I have is using JSON for this additional plugin config, while the rest of the chia config is yaml. This was discussed earlier, I'm not sure about it tbh |
I've decided it's ok to allow JSON here for these files plugin files |
@emlowe went on vacation and then got busy when came back, revisiting this now |
3725d86
to
5f42fd2
Compare
Co-authored-by: Kyle Altendorf <[email protected]>
Kyle reminds me that all json files are also yaml files - so if you parse this file with the yaml parser instead of the json parser, you can use either style for the plugin and it shouldn't involve any other code changes. |
I swapped it over to using yaml loader instead of json loader |
Co-authored-by: Kyle Altendorf <[email protected]>
close and reopen for CI |
Purpose:
The current implementation of the DataLayer plugin system relies on direct modifications to the config.yaml file for plugin registration. This approach presents challenges for third-party applications developed atop DataLayer, particularly in terms of creating installers that need to register plugins. Currently, installers either alter config.yaml directly during installation or require users to manually register plugins. The former approach risks compromising the stability of Chia due to potential installer bugs, while the latter is notably user-unfriendly and sometimes unfeasible.
To address these issues, this Pull Request introduces a new mechanism for plugin management within the DataLayer framework. I propose the creation of dedicated plugin directories within the CHIA_ROOT/data_layer path. This structure enables third-party applications to install or uninstall DataLayer plugin files smoothly, without needing to interact directly with the config.yaml file.
Key Changes:
Plugin Directories: Establish designated directories within CHIA_ROOT/data_layer for DataLayer plugins, streamlining the installation and uninstallation process.
Reduced Direct Configuration Manipulation: Minimize the need for third-party installers to modify config.yaml directly, enhancing system stability and reliability.
Improved User Experience: Simplify the plugin installation process for end-users, removing the need for manual plugin registration.
This enhancement fosters a more robust and user-friendly ecosystem for DataLayer and its third-party integrations, ensuring a smoother experience for both developers and users.
Current Behavior:
Datalayer activates plugins only from config.yaml
New Behavior:
Datalayer will still activate plugins from config.yaml, but it will also look in the CHIA_ROOT/data_layer/plugins folder and activate plugins from .conf files that are located in that directory.
Testing Notes:
PR includes coverage for loading the conf files from the plugins folder