-
Notifications
You must be signed in to change notification settings - Fork 629
Add doc warning for risky plugin names (related to #1694) #1722
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
base: master
Are you sure you want to change the base?
Conversation
|
If you intended to push code changes to this PR, you should adjust the title as it no longer only addresses documentation. |
| plugfiles = path.glob("**/*." + extension) | ||
|
|
||
| plugfiles = [] | ||
| for ext in ("plug", "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 unfortunately would break the usage in
errbot/errbot/plugin_manager.py
Lines 317 to 338 in 3c3af1a
| def _load_plugins(self) -> Dict[Path, str]: | |
| feedback = {} | |
| for path in self.plugin_places: | |
| self._load_plugins_generic( | |
| path, | |
| "plug", | |
| "errbot.plugins", | |
| BotPlugin, | |
| self.plugins, | |
| self.plugin_infos, | |
| feedback, | |
| ) | |
| self._load_plugins_generic( | |
| path, | |
| "flow", | |
| "errbot.flows", | |
| BotFlow, | |
| self.flows, | |
| self.flow_infos, | |
| feedback, | |
| ) | |
| return feedback |
plug and flow. This change, unfortunately does not address that and include a new one named plugin.
| @@ -0,0 +1,3 @@ | |||
| .. warning:: | |||
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 warning can be very useful for plugin developers.
This PR resolves Issue #1694 by adding a warning for plugin folders named lib, test, or utils. These names may cause plugin loading conflicts due to Python module resolution or backend-specific files (e.g., Slack's lib.py).
I reproduced the issue by creating a plugin in a lib/ folder, which failed to load silently. I added a log.warning(...) message in plugin_manager.py to alert developers early. I also added a documentation warning in docs/plugindevelopment.rst to guide plugin authors.
Let me know if you'd like anything adjusted.