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

[META] End to end template API user experience #88

Closed
22 tasks done
dbwiddis opened this issue Oct 12, 2023 · 6 comments
Closed
22 tasks done

[META] End to end template API user experience #88

dbwiddis opened this issue Oct 12, 2023 · 6 comments
Assignees

Comments

@dbwiddis
Copy link
Member

dbwiddis commented Oct 12, 2023

The APIs to save and provision a workflow as part of #49 need to be fully integrated with existing and needed validation checks and exception handling. The goal is to provide fast-failure validation information to a user giving them enough information to correct an invalid template, and also provide appropriate feedback to a user when a workflow fails, identifying enough detail to correct the issue.

The following steps need to be completed:

P0 Tasks

P1 Tasks

@joshpalis
Copy link
Member

Refactor parsing steps as necessary to generate failures as early as possible in the process. Consider adding a "dryrun" parameter to the template saving APIs for the user to perform validation without making any changes.

This is a good idea, perhaps we can run the template through the workflow process sorter to validate the graph and not execute it

@dbwiddis
Copy link
Member Author

Perhaps we can run the template through the workflow process sorter to validate the graph and not execute it

Yep, there's a private method we can probably make public to more easily enable that.

@owaiskazi19
Copy link
Member

Regarding the 4th point, trying to understand more for validation. Should we have a dry run param or validation should be done every time there's a call to template API? Be it to just to save the template or start the provisioning.

@joshpalis
Copy link
Member

joshpalis commented Oct 16, 2023

Regarding the 4th point, trying to understand more for validation. Should we have a dry run param or validation should be done every time there's a call to template API? Be it to just to save the template or start the provisioning.|

If we add validation by default as a prerequisite to saving a WIP template, that could be a frustrating experience for a builder. In that regard, I think it should be a separate capability and having an optional dry-run param for the RestCreateWorkflowAction to validate prior to saving makes sense.

Having the dry-run param for the RestProvisionWorkflowAction wouldn't make sense here, since validation is done already when we topologically sort the workflow.

@dbwiddis
Copy link
Member Author

If we add validation by default as a prerequisite to saving a WIP template, that could be a frustrating experience for a builder. In that regard, I think it should be a separate capability and having an optional dry-run param for the RestCreateWorkflowAction to validate prior to saving makes sense.

I think validation goes more with the "execution" portion, but we should be able to do the validation before saving. Which means we sort of need a "save-and-execute" single API call.

Which brings back up the possibility of combining APIs.

We have

POST _plugins/_flow_framework/workflow
{
    // use case template
}

followed by

POST _plugins/_flow_framework/workflow/<workflow_id>/_provision
{}

This works well for a "save WIP and finally execute when done" but in the case we have a completed/debugged template that we always want to execute, we could do that all-in-one with:

POST _plugins/_flow_framework/workflow/_provision
{
    // use case template
}

Now, throw a validation param in there and we have a one-liner just like we want:

POST _plugins/_flow_framework/workflow/_provision?dryrun=true
{
    // use case template
}

(or similar)

@joshpalis
Copy link
Member

Closing as completed since the remaining P1 items have separate issues tracking them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants