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

feat(client-js): add functionality to run workflows from client #878

Merged
merged 10 commits into from
Jun 9, 2022

Conversation

Niraj-Kamdar
Copy link
Contributor

@Niraj-Kamdar Niraj-Kamdar commented May 31, 2022

Linked Issues

Changelog

  • Added functions to run workflows from client
  • Added e2e tests that run workflows using client function
  • Added the concept of jobs and steps to workflow
  • Added the ability to run a particular job using the job id from the workflow
  • Added ability to propagate output from the parent job to the child job using absolute if of a step.

Next steps

  • Add support for running workflow files from w3 cli
  • Add support for basic tests by validating output
  • Add option to create workflow project (post-alpha)

- implemented async cookbook runner was too naive to be used in real-life so I decided to just have sync cookbook runner to avoid confusions for the devs using async runner.
@Niraj-Kamdar Niraj-Kamdar marked this pull request as ready for review June 1, 2022 11:10
@Niraj-Kamdar Niraj-Kamdar changed the base branch from prealpha to prealpha-dev June 6, 2022 18:39
@Niraj-Kamdar Niraj-Kamdar changed the title feat(client-js): add functionality to run recipes from client feat(client-js): add functionality to run workflows from client Jun 7, 2022
dOrgJelli
dOrgJelli previously approved these changes Jun 9, 2022
Copy link
Contributor

@dOrgJelli dOrgJelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is 🔥

dOrgJelli
dOrgJelli previously approved these changes Jun 9, 2022
@@ -0,0 +1,87 @@
import { Workflow } from "@web3api/core-js";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noob question: would it make sense to move this file to test-cases package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to keep workflow test-cases separate from e2e test-cases

Copy link
Contributor

@cbrzn cbrzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This amazing :-)

I noticed that there's no need to add the cases key, but it can be any other thing like tasks, correct? The only thing is that it needs to be consistent with the other subjobs, meaning that you'd need to do task1. Am I right on this ser? @Niraj-Kamdar

@Niraj-Kamdar
Copy link
Contributor Author

Niraj-Kamdar commented Jun 9, 2022

This amazing :-)

I noticed that there's no need to add the cases key, but it can be any other thing like tasks, correct? The only thing is that it needs to be consistent with the other subjobs, meaning that you'd need to do task1. Am I right on this ser? @Niraj-Kamdar

Not really @cbrzn, It can be any name. I just kept those names for the test-cases but you can have any kind job hierarchy.

Ex: blockchain -> protocol category -> protocol hierarchy can showcased by ethereum -> defi -> aave. The only condition here is you can only depend on the output of the parent job. You can't access the output of the siblings and siblings will run in parallel.

So, here, if there is. ethereum ->defi->aave and ethereum -> nft -> openseathen you can not access output of opensea in aave but you can access output of any common parents (here ethereum is first common parent)

@dOrgJelli dOrgJelli merged commit e2fce48 into prealpha-dev Jun 9, 2022
@cbrzn cbrzn deleted the nk/recipe-refactor branch June 9, 2022 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants