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
allow plugins to create diagnostic tools that are available via CLI and the web #7235
Comments
Related to / could maybe be included in scope of: #6726 |
So basically said you have a command, and you want to also have it available via UI with some input fields? #6726 is not really in scope |
@tsteur Not really. Making commands available via UI is a way to achieve this, but the idea is to make diagnostic tools (of which Piwik currently has few or none) which would normally be available only through commands available through the UI. In the UI, some extra information should be displayed, for example, getting debug logs and displaying them beside the tool output. This is mainly to reduce spurious support requests where users could potentially solve it themselves, and aid in debugging technically inept users who won't give us access to their servers. Which I think PRO does quite a bit. Sidenote: creating an API dedicated to creating diagnostic tools might encourage developers to include them in their plugins. Which might, again, hopefully reduce support requests in the long run. |
Would it make sense to maybe split some parts of the PiwikDebugger plugin in a separate plugin PiwikDiagnostics or so? Which would then do this? (in case PiwikDebugger already does something like this I'm not sure) |
Maybe, as long as we can include it in core in live production instances. I think most clients that are hard to debug won't actually install the plugin, even temporarily. At least, the one I recently dealt w/ seems unlikely to. |
to decide and prioritize this maybe you have some examples of such commands? in general I have the idea of improving the System Check to report such important things that could help us debug, but maybe im missing the advantage or other uses of diagnostic console commands? |
Here are the diagnostic tools I've added or will add to LoginLdap:
Some possibilities regarding Piwik:
etc. |
It would be easier to create diagnostic tools if Piwik core's subsystems were more modular. |
Now that #7646 is merged, should we close this or is there still something to do? |
I'm not sure the Diagnostic interface handles all the use cases in this ticket, eg, diagnostics can't be run through the UI outside of the SystemCheck page (some of the tools I have in mind shouldn't be run on that page, eg, testing an LDAP connection). |
OK I see, but for those use case do we need to standardize it? Plugin developers can create their own custom diagnostics if they need? |
I would say, yes. At least for core + supported plugins. This was added in response to a support call where the client did not know how to run a bash command, would not give us access to our servers, would not install plugins like PiwikDebugger on a staging server and after using Piwik since version 1.X, still did not know they should not modify global.ini.php. To support debugging these clients' installs, we'd need a very easy way for them to run these sorts of diagnostic tools. |
Maybe we are not talking about the same thing. I meant do we need to (e.g.) create an PHP interface they need to implement, do we need to write any helper class/API for plugin developers, etc? I don't see the point of that because the current system brings convenience to writing small diagnostics without having to write a page to display them and a cli command to run them. However for diagnostics that don't fit in this concept (e.g. those that need a whole page, or a whole separate command), then what's the point of writing anything in Piwik? Plugin developers will have to write a UI/command anyway. I don't see any gain for plugin developers as we couldn't imagine a page or CLI command that is generic enough for all diagnostics, and at the same time saves plugin developers some time. So what I'm saying is that in those cases we could let plugin developers write their own UI/CLI command. But maybe I'm wrong! I'm just not seeing it right now. E.g. could you illustrate what we could add into Piwik for those extended diagnostics? |
I was thinking of something similar to the plugin settings page, ie, each plugin has a section and the UI is auto-generated. So heavier diagnostics could be run when desired. |
Hi guys, could we close this RFC and create a follow up issue (if applicable?) |
@mnapoli If you don't see a reason to make tools like this easily accessible via web, feel free to close. It's not something I'd probably get to anyway. |
I'm not convinced right now but maybe I'm just not seeing it. Let's close and if the need appears we'll create a new issue with an example and we'll think of a solution |
To provide tools, both for us to diagnose user problems and for users to attempt to diagnose problems themselves, I think we should provide a method for users to easily create and expose diagnostic tools to their users.
I imagine that the diagnostic tools would be defined similarly to the way plugin settings are defined, by subclassing a base type and defining input metadata. Then Piwik would make the tool available both via CLI and via an admin page (needed since some users do not have the expertise or permissions needed to run CLI commands).
Running the CLI command would allow a user to use -vvv to get full debug output. The webpage should capture full debug output and display it to the user in the UI.
An example of diagnostic tools for the plugin LoginLdap:
An example of how a diagnostic tool might look like in code:
I might also be possible to just use commands and execute them via the browser if those commands implement a certain interface in addition to being a console command.
The text was updated successfully, but these errors were encountered: