Commit

One CI in the workflow list: hide files from before .github stopped being read, and gone files a live one replaced

syntaqxcommitted Parent3a2a772Browse files
1 file+11−40/1 viewed
+11−4
9292 {
9393 self.sync(&repo, &ws).await?;
9494 }
95+ // A file that is gone stays listed while it has runs, unless one in
96+ // the folder now has its name: then it would read as a second copy.
97+ // Files outside the folder are from before g1t stopped reading
98+ // `.github`; their runs stay under All workflows.
9599 let rows = self
96100 .db
97101 .prepare(
98− "SELECT * FROM workflows WHERE repo_id = ?
99− AND (error IS NULL OR error NOT LIKE 'Its file is%' OR id IN (SELECT workflow_id FROM runs WHERE repo_id = ?))
100− ORDER BY name",
102+ "SELECT * FROM workflows w WHERE w.repo_id = ?1 AND w.path LIKE ?2
103+ AND (w.error IS NULL OR w.error NOT LIKE 'Its file is%'
104+ OR (w.id IN (SELECT workflow_id FROM runs WHERE repo_id = ?1)
105+ AND NOT EXISTS (SELECT 1 FROM workflows o WHERE o.repo_id = ?1 AND o.id <> w.id
106+ AND o.name = w.name AND (o.error IS NULL OR o.error NOT LIKE 'Its file is%'))))
107+ ORDER BY w.name",
101108 )
102− .bind(&[repo.id.as_str().into(), repo.id.as_str().into()])?
109+ .bind(&[repo.id.as_str().into(), format!("{}/%", g1t_actions::workflow::FOLDER).into()])?
103110 .all()
104111 .await?
105112 .results::<WorkflowRow>()?;