-
Notifications
You must be signed in to change notification settings - Fork 16
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
pkg/workflows/sdk: add DependencyGraph.FormatChart for mermaid flowcharts #790
base: main
Are you sure you want to change the base?
Conversation
pkg/workflows/sdk/testdata/fixtures/charts/notstreamssepolia.md
Outdated
Show resolved
Hide resolved
5a28381
to
4d0d9eb
Compare
4d0d9eb
to
c3fb74b
Compare
c3fb74b
to
a10e3b5
Compare
a10e3b5
to
ab6c487
Compare
pkg/workflows/sdk/testutils/utils.go
Outdated
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.
The diff was comparing each as one single enormous line, so just pretty-printing for readability.
2375b78
to
1c45112
Compare
pkg/workflows/sdk/workflow_spec.go
Outdated
{{ else -}} | ||
{{ range $out := .Inputs.Outputs -}} | ||
{{ if $out.Name -}} | ||
{{ $out.Ref }} -- {{ $out.Name }} --> {{ $ref}} |
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.
I think this is where we indicate that we're doing outputs.Value, right? If so, can we also represent the fact that we also shaping the incoming inputs?
Eg. for consensus we actually do:
{"observations": []any{"outputs.Value"}}
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.
I was worried about including everything, and it's not obvious to me where to draw the line 🤷
We also have other options for presenting the data, like triggering actions on click or tool-tips on hover.
Or something way different, like subgraphs for each step, with multiple internal nodes:
flowchart
subgraph event-trigger
trigger-->event-outputs[outputs]
end
subgraph compute-a-step[compute a]
compute-a-inputs[TriggerOutputs] --> compute-a[Execute] --> compute-a-outputs[Value]
end
subgraph compute-b-step[compute b]
compute-b-inputs[TriggerOutputs] --> compute-b[Execute] --> compute-b-outputs[Value]
end
subgraph report-step[report]
report[Build Report]
report-inputs-compute-a[Value] --> report
report-inputs-compute-b[Value] --> report
report --> report-outputs[Report]
end
subgraph write-step[write]
write-inputs[Report] --> write
end
event-outputs --> compute-a-inputs
event-outputs --> compute-b-inputs
compute-a-outputs --> report-inputs-compute-a
compute-b-outputs --> report-inputs-compute-b
report-outputs --> write-inputs
This level of granularity would allow us to express more visually, and utilize tool tips for more information, since they work on nodes but not edges.
b26ed1a
to
7c3e9ff
Compare
7c3e9ff
to
a5318c2
Compare
a5318c2
to
92e7173
Compare
92e7173
to
74d39f7
Compare
I swapped over to using the |
74d39f7
to
4a33a18
Compare
Hey @jmank88 , I am trying to figure out how we provide the visual to users via CLI. From the dev platform CLI perspective,
Want to hear your thoughts on the flow, and how to integrate. Thanks! This comment is a copy-pasta from link |
I refactored the method to be on |
Returning text and we (client) render with Mermaid sounds great to me. This is gonna be a very useful feature from Dev Platform side.
May I know the new direction? |
This PR adds
DependencyGraph.FormatChart
for visualizing workflows as mermaid flowcharts.