Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: a builds page for the swarm builder's runs, and the status links to it

/builds lists the builder's recent builds newest first, one card each with how
it ended, and opens a failed build's nix tail. /builds?run=<id> opens that
build's card and scrolls to it. The swarm-builder commit status now links
there instead of to the raw JSON record.
This commit is contained in:
iris 2026-10-18 00:38:21 +02:00 • committed by mara
commit 0e77d61a9f
9 changed files with 391 additions and 13 deletions

View file

@ -1,7 +1,7 @@
//! The `BuildAgent` node: send a config PR's head to the swarm builder over the
//! queue, turn its answer into the [`CONTEXT`] commit status on that head, and
//! record the build, `nix`'s tail with it, in [`runs`], whose
//! `GET /api/builder/runs/{id}` the status links to.
//! record the build, `nix`'s tail with it, in [`runs`]. The status links to the
//! swarm UI's builds page for that build.
//!
//! Nothing is pushed, and the closure the builder made stays in its host's
//! store. A red status blocks nothing; the merge deploys as before.
@ -209,13 +209,7 @@ async fn record(
if !builds.record(&build).await {
return None;
}
link_base.map(|base| {
format!(
"{}/api/builder/runs/{}",
base.trim_end_matches('/'),
build.id
)
})
link_base.map(|base| format!("{}/builds?run={}", base.trim_end_matches('/'), build.id))
}
/// A failed node carrying `error`, and the status write's own failure when
@ -354,7 +348,7 @@ mod tests {
assert_eq!((&build.out_path, &build.detail), (&None, &None));
assert!(build.id.starts_with("atlas-abc-"), "{}", build.id);
assert!(build.finished_unix >= build.started_unix);
let link = format!("https://swarm.example/api/builder/runs/{}", build.id);
let link = format!("https://swarm.example/builds?run={}", build.id);
assert_eq!(
written,
[