Skip to content
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

Double down on hooks, remove app plugin in favour of individual hooks for individual capabilities #12879

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

rtibbles
Copy link
Member

Goals

  • Separate out device integration from more specific app functionality integration
  • Allow app wrappers to initialize via configuration, rather than needing scripting to register against the previous app interface
  • Allow a single Kolibri instance to run in both 'app mode' and not 'app mode' depending on the browsing context rather than whether the app plugin is enabled - this will allow more flexible usage on Windows and Linux where there is a need to be both an app and a server.
  • Lean into Kolibri hooks for all configuration

Summary

  • Cleans up deprecated abstractproperty decorators
  • Adds a hook for adding plugins to the KolibriProcessBus
  • Adds a class property to KolibriHook to check if any hooks are registered against it
  • Deletes the app plugin and migrates all the capabilities registration to use KolibriHooks
  • Creates two device hooks for GetOSUser and CheckMeteredConnection
  • Creates a content hook for ShareFile
  • Updates capability checking to be done in individual SPAs rather than a global app capabilities utility
  • Reimplements the share file functionality that had been inadvertently removed in 0.15.x
  • Creates a new development plugin that enables all app functionality with dummy handlers, and logs the initialization URL on startup
  • Automatically runs with this plugin for development

References

Depends on #12874 to allow specifying an extra python path for the development plugin
Needed to support learningequality/kolibri-installer-android#197

Reviewer guidance

I feel like leaning into the hooks makes sense to have a single way to customize Kolibri - is there anything about this that makes this less obvious?

By separating out the specific functionality that is more 'app' versus 'device' oriented, it has made each implementation a little more bespoke - but it seems sensible to me that metered connection checking doesn't have to be exclusive to app mode - is the minor added fiddliness an issue?

With the addition of the server hooks, we could also turn ZeroConf integration into a plugin, which would allow us to turn it off slightly more elegantly - and in a swappable way so that on Android we can provide the multicast implementation via built in Android mechanisms. The other configuration that feels like could benefit from being pluggable is the restart hooks - should we push more into plugins/hooks rather than relying on options.py?

@github-actions github-actions bot added DEV: backend Python, databases, networking, filesystem... APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: Setup Wizard Re: Setup Wizard (facility import, superuser creation, settings, etc.) DEV: frontend DEV: tools Internal tooling for development labels Nov 25, 2024
@rtibbles rtibbles force-pushed the hooked_on_plugins branch 2 times, most recently from 8da072b to 3d53ffa Compare November 25, 2024 23:46
Copy link
Member

@bjester bjester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just posting some review-in-progress comments

docs/getting_started.rst Outdated Show resolved Hide resolved
integration_testing/development_plugin/kolibri_plugin.py Outdated Show resolved Hide resolved
kolibri/core/content/api.py Outdated Show resolved Hide resolved
kolibri/core/content/hooks.py Show resolved Hide resolved
@rtibbles rtibbles force-pushed the hooked_on_plugins branch 2 times, most recently from c1ec045 to f7b44a9 Compare December 19, 2024 21:56
@rtibbles
Copy link
Member Author

Updated, rebased, and force pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Device Re: Device App (content import/export, facility-syncing, user permissions, etc.) APP: Learn Re: Learn App (content, quizzes, lessons, etc.) APP: Setup Wizard Re: Setup Wizard (facility import, superuser creation, settings, etc.) DEV: backend Python, databases, networking, filesystem... DEV: frontend DEV: tools Internal tooling for development
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants