-
Notifications
You must be signed in to change notification settings - Fork 54
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
Documentation of PCP check process flows in all scenarios #597
Comments
Gathering some proposals for solving the remaining 3 bugs:
@swissspidy LMKWYT or if you have any questions regarding those ideas. |
As just brought up by @felixarntz, we will also need to include any dependencies of the plugin being tested. |
AFAICT it is always relevant, even when not specifying When initializing early, we need to manually load any plugins depending on PCP. Question is, where do we do that? |
I think the only reason that The actual checks that are run are only retrieved later when plugins are already loaded, so with #608 implemented it should no longer be a problem. I think a better solution than loading all relevant plugins early (which has lots of other potential side effects/risks), I think we should rather change the logic to be aware that this is running too early for plugins to be loaded. For example:
|
Perfect! |
I have updated the process workflows doc based on how everything behaves now. With the additional fixes made, it's a lot more consistent - still different due to the different implications between AJAX and CLI, but far better than before. Please have a look. The most important revision is obviously the tables, which especially for the CLI workflow has now been simplified. Additionally, I've added two paragraphs on top about the most important differences, as a high-level summary:
With this being in a decent state now, let's discuss what we want to do with this? Should we move the doc over to a Markdown file in e.g. a |
A Markdown file with Mermaid diagrams would be great! |
The process flows in the different scenarios in which PCP can be used are quite complex to understand, most notably when runtime checks are involved. The complexities for runtime checks mostly stem from the fact that part of the functionality needs to be initialized very early, before plugins are loaded, which is achieved by temporarily placing an
object-cache.php
drop-in (if possible).This issue is about documenting those flows to help contributors better understand these flows and potentially uncover current bugs.
Since I was heavily involved in the architecture of the plugin and making runtime checks possible in safe way, I went over the code in depth again (which was also very helpful to refresh my memory!) and documented the current flows individually. For now, I put it all in this public document, for easy discussion via contextual comments: https://docs.google.com/document/d/1wDGZBwWB2WAxfbHE3lygIzQFK8IssCa5apOyaBolukQ/edit
Please request comment access if you'd like to leave comments.
Note that I did encounter some problems while documenting the flows, particularly about supporting checks added via other plugins ("addon checks"). I added comments on the doc for all of those problems. I would like to use this documentation issue also as an opportunity to discuss solutions to those problems.
For reference, listing the problems found here (roughly ordered by severity):
Force_Single_Plugin_Preparation
prevents plugins other than PCP and the checked plugin from being active when any runtime checks are included, preventing addon checks to work in that context. See doc comment. and Improveactive_plugins
filter #608 for a PR that fixes this.Abstract_Check_Runner::get_checks_to_run()
is called before plugins are loaded when initialized early, just to determine whether runtime checks are included or not. This means addon checks will not be considered, even though they may include the only runtime check requested. See doc comment. and Allow runtime initialization even when only addon checks are requested #612 for a PR that fixes this.But first and foremost: Please review the doc if you're interested, and leave questions wherever something may still be unclear.
The text was updated successfully, but these errors were encountered: