forge
Explore
Log in

Don't you dare go Hollow

A run's jobs are listed in the order they run, not by name

Browse files at this commit

b67eb9a8ce5f458dddf4a454a79b4c3328c51281Ahmet Kaan GümüşParent: c7331fd
  • fix
    • a run's jobs are listed in the order they run, not by name
Show full message
🐛 fix: a run's jobs are listed in the order they run, not by name

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.rsmodified+2 -2
@@ -249,7 +249,7 @@ async fn load_job(conn: &Connection, id: &str) -> Result<Option<CiJob>> {
249249 async fn jobs_of_run(conn: &Connection, run_id: &str) -> Result<Vec<CiJob>> {
250250 fetch_all(
251251 conn,
252- &format!("SELECT {JOB_COLS} FROM ci_jobs WHERE run_id = ?1 ORDER BY name"),
252+ &format!("SELECT {JOB_COLS} FROM ci_jobs WHERE run_id = ?1 ORDER BY rowid"),
253253 (run_id.to_string(),),
254254 map_job,
255255 )
@@ -1550,7 +1550,7 @@ impl Store {
15501550 Ok((runs, total))
15511551 }
15521552
1553- /// The jobs of a run, by name.
1553+ /// The jobs of a run, in insertion order: dependency order, matrix combinations grouped.
15541554 pub async fn jobs_for_run(&self, run_id: &str) -> Result<Vec<CiJob>> {
15551555 let conn = self.read_conn().await;
15561556 jobs_of_run(&conn, run_id).await