make graph view on run #47
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
runs are jobs which depend on each other
check that the result of scheduling a service is X nr of jobs being scheduled this should be visible in a run
so we can see all the dependencies, and what is running, what is waiting, ...
then if we click on a job we see the detail in a modal
Implementation Spec for Issue #47 - Run Graph View
Objective
Replace the flat list of job IDs in the Run detail panel with an interactive directed acyclic graph (DAG) visualization. Each job is rendered as a node showing its status; edges represent dependency relationships between jobs. Clicking a job node opens the existing job modal with full details.
Requirements
showJobModal(id)to display job detailsFiles to Modify
crates/zinit_ui/static/css/dashboard.css— Graph node, edge, and container stylescrates/zinit_ui/static/js/dashboard.js— RewriteviewRun(), add graph layout and rendering functionscrates/zinit_ui/static/js/demo.js— Enhance demo data with job dependencies for testingImplementation Plan
Step 1: Add graph CSS styles
Files:
dashboard.css.run-graph-container,.run-graph-node, status modifiers,.run-graph-svg,.run-graph-edgestylesStep 2: Rewrite
viewRun()functionFiles:
dashboard.jsrun.get_jobs+job.getfor eachrenderRunGraph()instead of flat chipsStep 3: Add
buildRunGraphLayout(jobs)functionFiles:
dashboard.jsStep 4: Add
renderRunGraph(jobs, containerEl)functionFiles:
dashboard.jsshowJobModal()Step 5: Handle edge cases
Files:
dashboard.jsStep 6: Update demo data
Files:
demo.jsdepends_onrelationships and runs containing those jobsAcceptance Criteria
Notes
showJobModal()function reused as-isuse a graph library https://observablehq.com/@d3/force-directed-graph/2
Updated Spec: Use D3 Force-Directed Graph
Per feedback, switching from manual topological layout to D3 force-directed graph based on https://observablehq.com/@d3/force-directed-graph/2
Key Changes from Original Spec
d3.min.jsv7) — loaded in the HTML templated3.forceSimulation()for physics-based node layout instead of manual Kahn's algorithmD3 Graph Approach
d3.drag()for interactive repositioningshowJobModal(jobId)Updated Implementation Steps
Step 1: Add D3 CDN to HTML template
Files:
crates/zinit_ui/templates/index.html<script src="https://d3js.org/d3.v7.min.js"></script>before dashboard.jsStep 2: Add graph CSS styles
Files:
crates/zinit_ui/static/css/dashboard.css.run-graph-container— container with border, background, min-heightStep 3: Rewrite
viewRun()to fetch full job dataFiles:
crates/zinit_ui/static/js/dashboard.jsdepends_onfieldsrenderRunGraph()functionStep 4: Add
renderRunGraph(jobs, containerEl)with D3 force simulationFiles:
crates/zinit_ui/static/js/dashboard.jsshowJobModal()Step 5: Handle edge cases
Files:
crates/zinit_ui/static/js/dashboard.jsStep 6: Update demo data with dependencies
Files:
crates/zinit_ui/static/js/demo.jsdepends_onand runs containing those jobsEverything Else Unchanged
showJobModal()reused as-isImplementation Complete
Changes Made
1. Added D3.js v7 library (
crates/zinit_ui/static/js/d3.v7.min.js)templates/base.html2. Run Graph View (
crates/zinit_ui/static/js/dashboard.js)viewRun()to fetch full job details viajob.getfor each job in the runrenderRunGraph()function using D3 force-directed simulationspec.depends_onaction names matched to jobs in the same run3. Graph CSS (
crates/zinit_ui/static/css/dashboard.css).run-graph-containerwith border, background, overflow handling4. Demo Pipeline Data (
crates/zinit_sdk/src/demo.rs)depends_onrelationships:init → build → test + lint → deploy → notify
5. ActionBuilder enhancement (
crates/zinit_sdk/src/builders.rs).depends_on(action_name)and.depends_on_with_type(name, type)builder methodsTest Results