-
Notifications
You must be signed in to change notification settings - Fork 141
Workflows CFG Extractor #455
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
base: main
Are you sure you want to change the base?
Workflows CFG Extractor #455
Conversation
🦋 Changeset detectedLatest commit: 8208f3c The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@karthikscale3 is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
pranaygp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a bunch of comments we need to address. Very excited about this!
Let's try and just get things aligned with how we want to do manifests according to the versioning spec. I'll be a nuisance to try and clean this up later
|
@pranaygp thanks for the review! Great and valid points! Let me do a bit of thinking to address these. |
…/workflow-cfg-extractor
…up partial generations
…up partial generations
|
@pranaygp Please take a look at the new iteration when you get a chance. Summary of the changes:
|
…/workflow-cfg-extractor
I, Karthik Kalyanaraman <[email protected]>, hereby add my Signed-off-by to this commit: 8a3f152 I, Karthik Kalyanaraman <[email protected]>, hereby add my Signed-off-by to this commit: 252a0dd I, Karthik Kalyanaraman <[email protected]>, hereby add my Signed-off-by to this commit: b002d81 I, Karthik Kalyanaraman <[email protected]>, hereby add my Signed-off-by to this commit: 8e21d56 I, Karthik Kalyanaraman <[email protected]>, hereby add my Signed-off-by to this commit: 1c45af6 I, Karthik Kalyanaraman <[email protected]>, hereby add my Signed-off-by to this commit: 68b23e0 I, Karthik Kalyanaraman <[email protected]>, hereby add my Signed-off-by to this commit: e5f4cd8 I, Karthik Kalyanaraman <[email protected]>, hereby add my Signed-off-by to this commit: d537846 I, Karthik Kalyanaraman <[email protected]>, hereby add my Signed-off-by to this commit: 0f62431 Signed-off-by: Karthik Kalyanaraman <[email protected]>
…/workflow-cfg-extractor
Single-statement if/while/for/for-of bodies without braces were ignored. Added recursive analysis for non-block bodies and corresponding tests.
Single-statement if/while/for/for-of bodies without braces were ignored. Added recursive analysis for non-block bodies and corresponding tests.
…/workflow-cfg-extractor
| } | ||
|
|
||
| /** | ||
| * Tests for single-statement control flow extraction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a bunch of tests that cover the following scenarios:
single_statement_if() - Single-statement if and if-else without braces
single_statement_while() - Single-statement while loop without braces
single_statement_for() - Single-statement for and for-of loops without braces
cc @pranaygp
|
|
||
| const selectedHookId = sidebar === 'hook' && hookId ? hookId : undefined; | ||
|
|
||
| // TODO(Karthik): Uncomment after https://github.com/vercel/workflow/pull/455 is merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were reviewed, commented and merged since it had a dependency on this PR. I am just uncommenting them here to enable the corresponding UI changes.
I, Karthik Kalyanaraman <[email protected]>, hereby add my Signed-off-by to this commit: 6609b39 I, Karthik Kalyanaraman <[email protected]>, hereby add my Signed-off-by to this commit: 2484c01 I, Karthik Kalyanaraman <[email protected]>, hereby add my Signed-off-by to this commit: a0363a1 Signed-off-by: Karthik Kalyanaraman <[email protected]>
Signed-off-by: Karthik Kalyanaraman <[email protected]>

This PR adds a new control flow graph (CFG) extractor that analyzes bundled workflow files and generates graph manifests for workflow visualization.
Note: The corresponding UI updates for graph viewer are in #456
Changes
@workflow/builders: Addworkflows-extractor.tsthat parses workflow bundles using SWC to extract nodes and edges representing step calls, loops, conditionals, and parallel execution patterns@workflow/builders: AddcreateWorkflowsManifest()method toBaseBuilderfor generating workflow graph manifests post-bundle@workflow/next: Integrate manifest generation into Next.js builder (initial build and watch mode rebuilds)Output
Generates a
workflows.jsonmanifest containing React Flow-compatible graph data for each workflow, including: