With enhancement 1, we no longer have errors when deprovisioning / reprovisioning a workflow when the index config does not change. Before, this would produce exceptions on provision, due to the fact the index still exists, due to the fact we couldn't delete the index.
With enhancement 2, we can easily update and persist the UI form configuration (stored via ui_metadata field) without users explicitly clicking on an Ingest/Search button, which was doing the deep & full deprovision / provision actions - essentially giving us a "lightweight" save. Because of this, we can have some autosave functionality as users fill out their form. Current implementation is to perform a save behind-the-scenes when users touch any form field that is persisted. It is debounced (rate-limited) to save at a maximum of every 10s. We can tune this or change the scope of how/when we save later on as well.
Implementation details:
audit all form fields to ensure Formik's touched is updated on every type of input (model dropdown, map, JSON)
add autosave hooks in the base WorkflowInputs component to listen on & execute autosave in a debounced fashion when conditions are met
improve deprovision to optionally handle a list of resource_ids to be force deleted. This is utilized on the 2 places we call deprovision on WorkflowInputs - in these cases, we want to force delete and re-create any created index as users test. On the search side, we will not want this. TODO comment has been added, and will be dealt with once fine-grained provisioning is supported
improve update to optionally handle an update_fields parameter, specifying to only update metadata fields like ui_metadata
Demo video, showing 1/ multiple creations of the same index after adding an ingest pipeline with no errors, and 2/ autosaving. Input is entered in the form, and after refreshing the page, it is still visible and populated where the user last left off.
[x] Commits are signed per the DCO using --signoff
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Description
This PR integrates with 2 new enhancements to Flow Framework APIs:
ui_metadata
,name
) on a provisioned workflow https://github.com/opensearch-project/flow-framework/pull/757With enhancement 1, we no longer have errors when deprovisioning / reprovisioning a workflow when the index config does not change. Before, this would produce exceptions on provision, due to the fact the index still exists, due to the fact we couldn't delete the index.
With enhancement 2, we can easily update and persist the UI form configuration (stored via
ui_metadata
field) without users explicitly clicking on an Ingest/Search button, which was doing the deep & full deprovision / provision actions - essentially giving us a "lightweight" save. Because of this, we can have some autosave functionality as users fill out their form. Current implementation is to perform a save behind-the-scenes when users touch any form field that is persisted. It is debounced (rate-limited) to save at a maximum of every 10s. We can tune this or change the scope of how/when we save later on as well.Implementation details:
touched
is updated on every type of input (model dropdown, map, JSON)WorkflowInputs
component to listen on & execute autosave in a debounced fashion when conditions are metWorkflowInputs
- in these cases, we want to force delete and re-create any created index as users test. On the search side, we will not want this. TODO comment has been added, and will be dealt with once fine-grained provisioning is supportedupdate_fields
parameter, specifying to only update metadata fields likeui_metadata
Demo video, showing 1/ multiple creations of the same index after adding an ingest pipeline with no errors, and 2/ autosaving. Input is entered in the form, and after refreshing the page, it is still visible and populated where the user last left off.
screen-capture (5).webm
Issues Resolved
Makes progress on #23
Check List
--signoff
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.