-
Notifications
You must be signed in to change notification settings - Fork 752
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
Do not include hooks from disabled modules into execution plan #3829
base: master
Are you sure you want to change the base?
Do not include hooks from disabled modules into execution plan #3829
Conversation
Closed / Reopened To Re-Trigger Build Actions |
Am I missing something, or is there no test that a disabled module is excluded from the built plans? I see tests to ensure disabled modules make it on the disabled module list, but no test was added or modified that would fail prior to this change, but pass now that the plans exclude disabled modules. |
Good point. I missed that. There is good test coverage on the generation of the disabled modules slice. |
Good catch, thanks, I'll look into adding one. |
To produce the test mentioned above by @hhhjort - we need a Dependency Injection mechanism to inject a test logger. |
Modifying a package global value is always a scary thing to see. We will want a more formal dependency injection mechanism, on the other hand that would greatly expand the scope of the PR. At least the global is only modified in the test. On the down side, go can run multiple tests in parallel, which could lead to the test failing when some other test logs a warning. I would assume the other PR you are thinking of would resolve this. @SyntaxNode , what do you think of this? |
Hi @hhhjort thanks for the comment. I've submitted a proposal: #4084 and a PoC PR: #4085 to illustrate the point. I think the lightweight DI mechanism would do for logger even though it is a global state. The alternative would be to use some DI framework of which Wire might be the most preferable as it is compile-time and uses code generation, while others use reflection. However I think the approach with |
Issue
Addresses #3748
How to reproduce
Here is a
pbs.yaml
config file to reproduce the problem described in the issue on the main branch:The server should be run with
Then on every request like
the server it should spit out
On the PR branch this does not happen.
Implementation Details
Disabled modules IDs are collected into the array
disabledModules
and passed down to the plan builder to be consulted when including hooks into the execution plan.