From b67eb9a8ce5f458dddf4a454a79b4c3328c51281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 22 Oct 2026 15:53:49 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20a=20run's=20jobs=20are=20?= =?UTF-8?q?listed=20in=20the=20order=20they=20run,=20not=20by=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A run's jobs come from ci_jobs in insertion order, which is dependency order from the scheduler. The query sorted them by name, so a job drawn after its dependency could appear above it on the timeline. Order by rowid instead; matrix combinations stay grouped as they were inserted. --- crates/forge-core/src/store/ci.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/forge-core/src/store/ci.rs b/crates/forge-core/src/store/ci.rs index e6d0c24..1460536 100644 --- a/crates/forge-core/src/store/ci.rs +++ b/crates/forge-core/src/store/ci.rs @@ -249,7 +249,7 @@ async fn load_job(conn: &Connection, id: &str) -> Result> { async fn jobs_of_run(conn: &Connection, run_id: &str) -> Result> { fetch_all( conn, - &format!("SELECT {JOB_COLS} FROM ci_jobs WHERE run_id = ?1 ORDER BY name"), + &format!("SELECT {JOB_COLS} FROM ci_jobs WHERE run_id = ?1 ORDER BY rowid"), (run_id.to_string(),), map_job, ) @@ -1550,7 +1550,7 @@ impl Store { Ok((runs, total)) } - /// The jobs of a run, by name. + /// The jobs of a run, in insertion order: dependency order, matrix combinations grouped. pub async fn jobs_for_run(&self, run_id: &str) -> Result> { let conn = self.read_conn().await; jobs_of_run(&conn, run_id).await