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

Set up basic logic for parsing template -> UI flow and vice versa #131

Merged
merged 5 commits into from
Apr 10, 2024

Conversation

ohltyler
Copy link
Member

@ohltyler ohltyler commented Apr 9, 2024

Description

This PR sets up the basic logic for taking in a preset template -> generating a UI flow, and taking a UI flow -> generating final backend template:

  • conversion from template -> flow: via toTemplateFlows() + added fns in template_to_workflow_utils. Enhances the existing logic to be more generic and handle conversion at a per-node granularity. Also takes into account previous node inputs to pass when generating the final fields for each template flow. Note that there's TODOs for all of the current gaps and where current logic is hardcoded
  • conversion of flow -> template: via enrichPresetWorkflowWithUiMetadata() in workflows/new_workflow_utils. Enhances the existing logic to be more generic and handle conversion at a per-preset-template granularity. For each preset use case, we return a standalone hardcoded set of UI nodes/edges.
  • other general util fn refactoring
  • adds a few interfaces and types to represent the backend flow and sub-flow structures in more detail
  • other general state handling and guardrails, due to parsing changes, such as only rendering valid templates on UI page that can parse a UI flow

Note this is just the initial setup of the overall structure for doing full generic conversion. For the initial release of a set of static supported workflows, we will have partially hardcoded logic. Subsequent PRs will add more of these cases, like different processor nodes for handling different ML transforms on ingest. We can utilize these fns to minimize as much code duplication as possible.

Demo video:

  • doing dynamic parsing -> UI flows, + dynamic parsing -> workflow template behind-the-scenes
  • existing valid flows with parseable UI metadata render correctly
  • existing CRUD operations work correctly
  • cold reloads on an unsaved workflow (which would have no UI metadata) redirects to home workflows page with a toast msg
screen-capture.27.webm

Issues Resolved

Makes progress on #73

Check List

  • 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.

Signed-off-by: Tyler Ohlsen <[email protected]>
@ohltyler ohltyler changed the title Set up initial conversion utils for converting UI flow -> template Set up basic logic for parsing template -> UI flow and vice versa Apr 10, 2024
@ohltyler ohltyler merged commit 34ef573 into opensearch-project:main Apr 10, 2024
6 checks passed
@ohltyler ohltyler deleted the to-template-conversion branch April 10, 2024 19:31
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 10, 2024
ohltyler added a commit that referenced this pull request Apr 10, 2024
…) (#132)

Signed-off-by: Tyler Ohlsen <[email protected]>
(cherry picked from commit 34ef573)

Co-authored-by: Tyler Ohlsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants