Repository navigation
Plugins installation improvements - #8503
Conversation
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8503 +/- ##
==========================================
- Coverage 84.61% 84.45% -0.17%
==========================================
Files 1178 1179 +1
Lines 53582 53693 +111
Branches 2026 2029 +3
==========================================
+ Hits 45341 45349 +8
- Misses 7718 7823 +105
+ Partials 523 521 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
- Use file hash to determine if it should be reloaded
|
@wolflu05 I have refactored this (again) - a much simpler approach now which ensures that the plugins get installed into all running containers as appropriate |
|
Thanks, that looks promising, I'd like to take a closer look and test it myself, but that can take me some days... |
|
Let me know when you've had a chance to test it. This is one of the final outstanding Issues for 0.17.0 |
|
@matmair if you have a chance to cast your eye over this I'd appreciate it :) |
| if not settings.DOCKER: | ||
| # Check an install run | ||
| response = registry.install_plugin_file() | ||
| self.assertEqual(response, 'first_run') | ||
|
|
||
| # Set dynamic setting to True and rerun to launch install | ||
| InvenTreeSetting.set_setting('PLUGIN_ON_STARTUP', True, self.user) | ||
| registry.reload_plugins(full_reload=True) | ||
|
|
||
| # Check that there was another run | ||
| response = registry.install_plugin_file() | ||
| self.assertEqual(response, True) | ||
| registry.reload_plugins(full_reload=True, collect=True) | ||
| self.assertGreater(len(settings.PLUGIN_FILE_HASH), 0) |
There was a problem hiding this comment.
Q: Does this test ensure that the installation actually runs with this setup?
|
@SchrodingersGat I might be blind but where exactly is the offloading happening? Maybe I am too tired but I seem to miss that change in the diff |
Co-authored-by: Matthias Mair <[email protected]>
When you activate a plugin, the collection of static files is offloaded to the background worker: For this to succeed, the background worker needs to have the same set of plugins installed! |
This reverts commit bf84c81.
…e into plugins-install
|
Ah now I found the link, the check_for_migrations function is doing the installing |
|
Sorry, I had no time yet, I was planning to test this on the weekend. But if anything pops up then, I'll just reply here. |
|
Sorry @wolflu05 got my wires crossed. LMK if you find anything |


Summary
This PR improves plugin loading and install to ensure that the plugins are properly synced between different running containers, e.g. when running under docker. Ensures that the required system packages are installed before collecting plugins.
Installation Process
plugins.txtplugins.txt- sees it has changed - and installs the new plugin