Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh

Commit

The banner that says a job is stuck waiting for a self-hosted runner counts a host-mode runner as no help to a public repository's job, as the queue already does: such a job is listed as stuck when only host-mode runners match it, rather than looking served while it waits for a sandboxed one.

Claude-Session:
https://claude.ai/code/session_01PnwTRSNaC7vEHTAuBzjhrn
Claudeagent and Claudeagentcommitted Parentfffac75Browse files
1 file+8−10/1 viewed
+8−1
15751575 labels: String,
15761576 queued_at: Option<String>,
15771577 repo: String,
1578+ repo_id: String,
15781579 }
15791580 let waiting = self
15801581 .db
15811582 .prepare(
1582− "SELECT jobs.id, jobs.name, jobs.run_id, jobs.labels, jobs.queued_at, runs.repo FROM jobs JOIN runs ON runs.id = jobs.run_id
1583+ "SELECT jobs.id, jobs.name, jobs.run_id, jobs.labels, jobs.queued_at, runs.repo, jobs.repo_id FROM jobs JOIN runs ON runs.id = jobs.run_id
15831584 WHERE jobs.status = 'queued' AND jobs.labels IS NOT NULL AND lower(jobs.namespace) = ? AND jobs.queued_at < ?
15841585 ORDER BY jobs.rowid LIMIT 20",
15851586 )
15921593 }
15931594 let groups = self.group_rows(&workspace).await?;
15941595 let online: Vec<RunnerRow> = self.runner_rows(&workspace).await?.into_iter().filter(|r| r.online(at)).collect();
1596+ // A repository's visibility is asked only when a host-mode runner
1597+ // is online, since only those pass over a public repository's jobs.
1598+ let any_host = online.iter().any(|runner| runner.isolation.as_deref() == Some("host"));
1599+ let mut looked = Looked::default();
15951600 for job in waiting {
15961601 let wanted = Wanted::from_stored(&serde_json::from_str::<Vec<String>>(&job.labels).unwrap_or_default());
1602+ let visibility = if any_host { self.visibility_once(&mut looked, &job.repo_id).await } else { None };
15971603 let served = online.iter().any(|runner| {
15981604 let group = runner.group_id.as_ref().and_then(|id| groups.iter().find(|g| &g.id == id));
15991605 wanted.matches(&runner.labels(), group.map(|g| g.name.as_str()))
1606+ && model::isolation_allows(runner.isolation.as_deref(), visibility.as_deref())
16001607 });
16011608 if !served {
16021609 out.push(StuckJob {

Comments

Sign in to comment.