Skip to content

feat: visualize runs on the canvas #3382

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

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

doc-han
Copy link
Contributor

@doc-han doc-han commented Jul 9, 2025

Description

This PR [adds/changes/fixes]... (A description of your work goes here.)

Closes #3103

Validation steps

  1. (How can a reviewer validate your work?)

Additional notes for the reviewer

  1. (Is there anything else the reviewer should know or look out for?)

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

Pre-submission checklist

  • I have performed a self-review of my code.
  • I have implemented and tested all related authorization policies. (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

@doc-han doc-han linked an issue Jul 9, 2025 that may be closed by this pull request
@github-project-automation github-project-automation bot moved this to New Issues in v2 Jul 9, 2025
@josephjclark
Copy link
Collaborator

TODO: to colour edges properly we need to resolve this: OpenFn/kit#956

@josephjclark
Copy link
Collaborator

josephjclark commented Jul 10, 2025

Couple of early TODOs:

  1. Stub in some kind of tooltip on the pass/fail icon. This should show output for multiple executions of a single node
  2. A node is only a success if it never fails (across multiple executions)
  3. Nodes that were not executed need to be greyed out
  4. Disable edit mode while looking at a run (don't show the + icon on a node)
  5. Some kind of indicator on the start node (maybe an icon top right for now?)

Selection doesn't work very well when we introduce many more colours like this: see #3386

Soon we'll spike out an Edit mode toggle (more comments coming in on that)

@josephjclark
Copy link
Collaborator

We've encountered an issue against main which I think we can really only resolve here - sort of stubbed in in #3385

Basically what it is is:

When looking at an old run / a snapshot, the snapshot should be read-only. No edits allowed. On prod right now, the +icon is actually live and interactive, sort of, so you can fool around a bit.

We need to sort that out and ensure snapshots are read only.

A wrinkle on this is that the most recent snapshot and the latest version are the same thing. So how do we differentiate? How do we make latest editable but the last run read only??

This PR might help us out.

By having a History Mode and Edit Mode, as a top-level flag on the workflow diagram, we should have clearer seperation of concerns. Old runs - a workflow with an overlay - are never editable. The latest workflow (no run loaded) has no history. Use buttons in the nav bar to switch between states.

@josephjclark
Copy link
Collaborator

Thoughts on showing multiple runs of the same node:

  • render multiple edges?
  • render the execution graph, not the workflow graph? Totally different tree?
  • duplicate nodes in the workflow (is this the same as above?)
  • show multiple status icons (3 ticks on cross)

For the moment, I want to do the simplest possible thing and show show as single status and tooltip.

Copy link

codecov bot commented Jul 15, 2025

Codecov Report

Attention: Patch coverage is 8.69565% with 21 lines in your changes missing coverage. Please review.

Project coverage is 89.83%. Comparing base (ca5f746) to head (8ee7b1d).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
lib/lightning_web/live/workflow_live/edit.ex 15.38% 11 Missing ⚠️
lib/lightning/invocation.ex 0.00% 5 Missing ⚠️
lib/lightning/work_orders.ex 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3382      +/-   ##
==========================================
- Coverage   89.92%   89.83%   -0.10%     
==========================================
  Files         368      368              
  Lines       14456    14476      +20     
==========================================
+ Hits        13000    13004       +4     
- Misses       1456     1472      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@doc-han
Copy link
Contributor Author

doc-han commented Jul 15, 2025

AI chat icon already at the top-left corner of the screen. same place we want workflow history to be.
Screenshot 2025-07-15 at 9 49 28 PM

@doc-han
Copy link
Contributor Author

doc-han commented Jul 18, 2025

Note
We have a trigger and jobs for a workflow.
After a Run, we keep the results of each job run in an an array called steps on the run but then, we have no run results for a trigger.

Situation
Some Runs do crash even before a single jobs gets to execute. Hence, the steps array becomes empty. In this case, it becomes quite tricky to display on the UI. because you can't associate the crash to a node or the trigger too I guess.

cc: @taylordowns2000

@doc-han
Copy link
Contributor Author

doc-han commented Jul 18, 2025

I have a situation where starting_job_id doesn't seem correct. strange

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

Successfully merging this pull request may close these issues.

Visualize runs on the canvas
2 participants