One CI in the workflow list: hide files from before .github stopped being read, and gone files a live one replaced
1 file+11−40/1 viewed
| 92 | 92 | { | |
| 93 | 93 | self.sync(&repo, &ws).await?; | |
| 94 | 94 | } | |
| 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. | |
| 95 | 99 | let rows = self | |
| 96 | 100 | .db | |
| 97 | 101 | .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", | |
| 101 | 108 | ) | |
| 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()])? | |
| 103 | 110 | .all() | |
| 104 | 111 | .await? | |
| 105 | 112 | .results::<WorkflowRow>()?; |