Add a module for creating and managing integrations with other services.
Review Request #7947 — Created Feb. 6, 2016 and submitted — Latest diff uploaded
Modern web applications often need to integrate with other services, such as chat services. Each generally needs to be able to support any number of user-provided configurations, efficiently. This change adds a framework for more easily producing these integrations. Consuming applications just need to set up some classes and URLs, and will then be able to define integrations or, if they support extensions, will allow others to define integrations. A single integration can have any number of configurations, which applications can choose to bind to users, organizations, or anything else they choose. Configurations can be enabled or disabled, can have a name, and can have arbitrary settings configured. Integrations are instantiated when registered, but their logic and state are only initialized once there's one or more enabled configurations in the database for that integration. This allows a large number of integrations to be registered, without them having to take up any processing time unless used. An integration will generally listen to signals or other events, and may want to register into parts of the application. This overlaps a great deal with the needs of extensions, and so they've been written to be hook owners, allowing the user of ExtensionHooks. Like an extension, these hooks are bound to the lifecycle of an integration instance. There are built-in views available for listing all integrations (and their configurations), and creating/editing/deleting configurations. These can be used in the administration UI, or in other pages, depending on the needs of the application. To facilitate this, there are base classes for the views and there are administration-specific subclasses. Djblets just provides the foundation for integrations. Consuming applications are expected to subclass some of the classes to provide additional information, such as an instance of an IntegrationManager or additional configuration data.
Unit tests pass.
Modified rbslack to use integrations, and tested that they work.
Verified manually that integrations are only enabled when there are
enabled configurations, and that this state is recomputed properly when
enabling/disabling/creating/deleting integrations.Read through the docs and checked links.