runs not properly implemented #25
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?
Check. The run sort of run is basically almost the same as a surface, but a surface is using long term, so process actions, and we need to check that, by the way. No, no, we don't have to check that. So, A service is process, actions, and can be one of actions, too. combined, but it's meant to run a service long time. A skill, sorry, no skill, a run is an ad hoc. Um, number of actions, which are not processes, because it's never long running, which are linked to each other through dependencies, and also into that screen, if we look at a run, we need to see the graph of that dependencies of the actions, while the jobs, actually, because it ruin his jobs. So a run converts. A run is an ad hoc when we ask, now execute. This action, this, this, this, this action, with these dependencies, right? Then it becomes a run. It's like an ad hoc, duck D-A-G. which we can use to run all kinds of things. TTY needs to be supported, but that's part of the action. And then we can, we need good tools onto this page to create it, so we can do an ad hoc run, where we lose action, we choose actions, and other things which are rather for run, and then we can see how to run it. So this is for ad hoc duck.
Implementation Spec for Issue #25: Runs as Ad-Hoc DAGs
Objective
Implement "runs" as fully functional ad-hoc DAGs of jobs with dependency tracking, DAG-aware execution, and a UI that allows creating runs by choosing actions and setting inter-job dependencies.
Requirements
Implementation Plan (7 Steps)
Step 1: Add
run_idto the Job model and DB schemacrates/hero_proc_lib/src/db/jobs/model.rsrun_id: Option<u32>field to Job structlist_jobs_by_run_id()helperStep 2: Add run-level helpers to the runs model and factory
crates/hero_proc_lib/src/db/runs/model.rs,crates/hero_proc_lib/src/db/factory.rslist_runs_with_job_counts()helperStep 3: Add
run.create_with_jobsRPC handlercrates/hero_proc_server/src/rpc/run.rs,crates/hero_proc_server/src/rpc/mod.rs{ "context": "...", "actions": [{ "action": "build", "depends_on": [] }, { "action": "test", "depends_on": ["build"] }] }Step 4: Add DAG-aware job gating in the supervisor
crates/hero_proc_server/src/supervisor/mod.rsStep 5: Fix
run.listandrun.getto include job datacrates/hero_proc_server/src/rpc/run.rsStep 6: Rewrite "New Run" UI form with action picker and dependency builder
crates/hero_proc_ui/static/js/dashboard.jsrun.create_with_jobson submitStep 7: Add run status auto-update logic (lifecycle monitor)
crates/hero_proc_server/src/supervisor/mod.rsAcceptance Criteria
run.create_with_jobsRPC atomically creates a run + jobs with dependenciesrun.listreturns job count per run; the UI shows real countsTest Results
All tests passed. Full
cargo test --workspacecompleted successfully on branchdevelopment(commit50b498b).Summary by crate
Implementation Summary
Changes Made
1. Job model — added
run_idfieldcrates/hero_proc_lib/src/db/jobs/model.rs— Addedrun_id: Option<u32>toJobandJobSummarystructs, updated all SQL queries (INSERT, UPDATE, SELECT, row mapping), added DB migration for existing databases, addedlist_jobs_by_run_id()helper2. Runs model — added job count and lookup helpers
crates/hero_proc_lib/src/db/runs/model.rs— Addedlist_runs_with_job_counts()(LEFT JOIN on run_jobs) andget_run_for_job()helperscrates/hero_proc_lib/src/db/factory.rs— Exposedlist_with_counts(),get_run_for_job()on RunsApi andlist_by_run_id()on JobsApi3.
run.create_with_jobsRPCcrates/hero_proc_server/src/rpc/run.rs— New handler that atomically creates a Run + Jobs from action specs with dependency wiringcrates/hero_proc_server/src/rpc/mod.rs— Added dispatch entry4. DAG-aware job gating in supervisor
crates/hero_proc_server/src/supervisor/mod.rs— Jobs in a run now wait for their dependencies to succeed before starting; auto-cancel if dependency fails5. Fixed
run.listandrun.getresponsescrates/hero_proc_server/src/rpc/run.rs—run.listnow returnsjob_countper run;run.getnow returnsjob_ids6. New Run UI with action picker and dependency builder
crates/hero_proc_ui/static/js/dashboard.js— RewroteshowRunForm()to load actions, allow multi-select with per-action dependency wiring, callsrun.create_with_jobs. Fixed job count display in runs list.7. Run lifecycle monitor
crates/hero_proc_server/src/supervisor/mod.rs— Addedcheck_run_completions()that auto-transitions runs from Starting → Ok/Error as constituent jobs completeTest Results
Implementation committed:
f259c78Browse:
f259c78