feat: setup configuration-ui plugin registry#2886
Conversation
|
Wouldn't it be better to define the properties of the field like this: This has at least the following benefits:
I do see your point, I wouldn't say it's scattered, sorting of the fields is not something needed or relevant, the order of the fields in the connection form follows a natural order starting with Name, ending with Rate Limit.
I see the point, and we can certainly evolve the configuration to let validation rules be defined here but it's not needed right now. Instead of |
I think so. |
|
No matter how to do it, it looks like we must use one config to control all the logic. I think #2862 「delete ProviderIcons and ProviderFormPlaceholders and replace them with one config ProviderConfigMap. (integrationsData will refactor in future)」 and 「replace some switch(provider.id)/[xxx,yyy].includes(provider.id)/[jira,github] with more common code.」 are necessary. Why you hate it so much? |
You go through all the trouble of introducing another foreign |
I thought about this as well, and I agree to a certain extent and may re-configure the json files to be this way. The JSON schema is still being evaluated and worked on. For now it's easier on the user to edit 3 separate objects than 1 config object with 2nd level keys for everything. Additionally, it let's me construct the existing Variable Configurations without having to reduce the object configuration and transform it again into the structure I need. |
|
A Plugin does not need to be responsible for determining it's own Connection Fields at this time with regards to them being dynamically created, it should be following a standard convention so Each Plugin has to satisfy the current Connection model defined by the backend. The plugin can have dynamic control (enabled state, required state etc) over the standard connection fields that exist currently, which is what this configuration is intended for. Based on a plugin's authentication type that also is a main factor as to what main fields are required for the connection. In the future the plugin can perhaps have more control and custom rendering options for the field. This is something to be discussed in more detail. |
|
It's the first PR and ProviderConfigMap can be replaced with JSON or API requests at any time. In addition, my two PRS may not be merged. But please don't create PR so big. It's an open-source project. |
|
|
@likyh @tk103331 I'll be making more commits as I continue ideating on the Plugin Registry concept. In the mean time, I'm fine with both of you contributing thoughts & ideas to this effort, that are hopefully inline with this strategy. @tk103331 Feel free to comment on more suggestions/questions or issues for the Plugin Schema as it's being developed, some option configurations can be for a future need as well. The important thing is to get an essential schema for the short-term without overcomplicating it. You will also be able to add commits if you are wanting to contribute. @likyh When I'm done with a few more commits, I'll tag you to adapt some of your valid refactor changes from your closed PR, such as the Dynamic Menu from new $Integrations var. There are also areas of the |
Draft
DraftDraft
|
@e2corporation Sorry, I didn't see what you edited in my reply two days ago.
What I mean is to spread the multiple information (name, label, placeholder) of a field to be defined in multiple places instead of using only one object.
Yes, the name |
f8e9dce to
74d68a2
Compare
|
Is this PR will continue now? |
I will be refreshing this soon, ideally other refactor PRs need to be completed or halted while I get this initial version of dynamic config ready. |
e176241 to
573911a
Compare
4988aa0 to
51a9d3a
Compare
287be2f to
07ff743
Compare
e49c9ba to
1203474
Compare
|
@likyh @mintsweet All notable code review feedback items have been resolved, any additional cleanups will be deferred to a subsequent PR. |
🆘 Config-UI / Plugin Registry (Phase I)
@hooks/useIntegrations.jsxPluginand other related Data Models@store/integrations-context.jsx)RefactorIntegrations Data Dependencies on@data/Providers.js&@data/integrations.jsxRefactorTransformations Manager Hook (Setup Default Transformations in Plugin Registry)FixBuild Menu Configuration DynamicallyFixBuild All Connection Sources DynamicallyFixBuild Data Sources Connection List DynamicallyFeatUse Higher Order Component (HOC) Pattern for Transformation Settings LoadChoreUpdate Config-UIREADME.mdChoreCode Cleanups & LintingTESTData Connections WorkflowTESTBlueprints WorkflowDescription
This PR creates a Plugin Registry on Configuration-UI as outlined on #2882. The new Integrations Manager Hook now provides a Dynamic API Configuration for Data Providers that replaces the static configuration formerly defined in the
@data/Provider.jsand@data/integrations.jsxglobal data constants. An Integrations Context has also been created to offer access to Dynamic Provider configuration to deeply nested child components and other Hook Services, when direct access to the IM Hook is unavailable or otherwise not desired.As the Configuration API is preserved, Developers can continue to reference Provider Configuration objects in the same fashion as before without having to worry about maintaining multiple static configuration objects in multiple files.
Developer Notes
For developers, access to the Dynamic Plugin Registry API Configuration can be done in the following ways, by using the Integrations Hook or the Integrations Context. With the Context, usage can be done in 2 ways via the
React.useContextHook or with using a Context Consumer & React Render Function.1. Integrations Hook
@hooks/useIntegrations.jsxFor Top-Level Page & Service Components, import and initialize the Integrations Manager Hook. Simply de-structure the specific configuration objects and properties needed.
2. Integrations Context +
React.useContextHook@store/integrations-context.jsxSince Hooks can only be accessed by Top-Level Components, secondary Child and deeper nested components will need to use the Context for accessing provider configuration. Use object de-structure to reference the Configuration Objects needed.
3. Integrations Context + Consumer Render Function
@store/integrations-context.jsxIn cases where we don't need access to configuration at the Class or Function level, but only in specific areas of the Render, the Consumer Pattern with a React render function can also be used. Use object de-structure to reference the Configuration Objects needed.
The Active Provider (
activeProvider)The Active Data Provider is now managed by the Integrations Manager Hook (
@/hooks/useIntegrations.jsx). After Plugin Registration, theactiveProviderstate variable will be an Instance ofPluginData Model (@models/Plugin.js). The Provider Configuration is also accessible via the active provider when needed.Notice⚠️
In most cases old code has been commented out to lessen merge conflicts with other in-flight development tickets, more code cleanups will be performed in a future PR. Additionally, legacy component files not actively being used may still reference the old
@data/Providers.jsconstant, hence they won't be updated.Milestone
v0.15.0Local Plugin Registry
The local registry defines plugins that are bundled with DevLake. Users creating "Private" local plugins may add and register plugins with the local registry.
API Plugin Registry (Future Feature)
The api registry allows plugins to be defined by the backend and plugins can be fetched dynamically and merged with the local registry.
FEATURETBDPlugin Registration Schema (JSON)
Does this close any open issues?
#2882
Screenshots
[<PENDING>]