Watch
0
0
Fork
You've already forked hyperhive
0

the builds list keeps the swarm's deploy builds too

build_meta, the build of each agent from internal/meta before a deploy, now
writes its result into the same list as the config PR builds: the agent, the
internal/meta commit, how it ended and what nix printed. The builds card titles
them by agent and shows them with the PR builds.
This commit is contained in:
iris 2026-10-30 02:06:07 +01:00
commit b74011bb54
2 changed files with 212 additions and 33 deletions

View file

@ -1,6 +1,6 @@
// <BuildsCard> — the swarm builder's recent builds, newest first: which agent
// config PR heads it built, how each ended, and what `nix` printed when one
// failed. One card per build; selecting a card opens it. Reads
// <BuildsCard> — the swarm builder's recent builds, newest first: the agent
// config PR heads it built, and the agents it built from `internal/meta` before
// a deploy, how each ended, and what `nix` printed when one failed. One card per build; selecting a card opens it. Reads
// `GET /api/builder/runs`. A `swarm-builder` commit status links to the jobs
// page as `/jobs?run=<id>`, which opens that build's card and scrolls to it.
// The card sits under the job graph on that page; the old `/builds` address
@ -22,6 +22,7 @@ import {
OUTCOME_LABEL,
OUTCOME_TONE,
bodyText,
runTitle,
wantedRun,
type BuildRun,
} from "./builds-types.js";
@ -56,9 +57,7 @@ function BuildCard({
onClick={onToggle}
>
<span class="ui-builds-title">
<strong>
{run.repo} #{run.pr}
</strong>
<strong>{runTitle(run)}</strong>
<code>{run.head_sha.slice(0, 7)}</code>
</span>
<Badge
@ -138,9 +137,9 @@ function BuildsBody() {
/>
</div>
<p>
The agent config PR heads the swarm builder built, newest first: how
each ended, and what nix printed when one failed. Select a build to read
it.
What the swarm builder built, newest first: agent config PR heads, and
the agents it builds from internal/meta before a deploy. How each ended,
and what nix printed when one failed. Select a build to read it.
</p>
{error ? (
<ApiErrorPanel
@ -178,7 +177,7 @@ export function BuildsCard() {
<LazyDisclosure
title="builds"
icon="🔨"
hint="the agent config PRs the swarm builder built"
hint="what the swarm builder built: agent config PRs and deploys"
startOpen={wantedRun(useSearch()) !== null}
>
<BuildsBody />

View file

@ -10,9 +10,12 @@ export type BuildOutcome = "built" | "failed" | "error";
export interface BuildRun {
/** `<agent>-<first 12 of head_sha>-<started_unix>`. */
id: string;
/** `agent-configs/<agent>`. */
/** `agent-configs/<agent>` for a config PR's build, `internal/meta` for a deploy's. */
repo: string;
pr: number;
/** The config PR a build checks; a deploy's build has none. */
pr?: number | null;
/** The agent a deploy's build built; a PR build's is in `repo`. */
agent?: string | null;
head_sha: string;
started_unix: number;
finished_unix: number;
@ -37,6 +40,16 @@ export const OUTCOME_TONE: Record<BuildOutcome, BadgeTone> = {
error: "warning",
};
/**
* A run's card title: `agent-configs/atlas #3` for a config PR's build,
* `atlas from internal/meta` for a deploy's (the swarm builds every agent from
* `internal/meta` before sending its deploy).
*/
export function runTitle(run: BuildRun): string {
if (run.pr !== undefined && run.pr !== null) return `${run.repo} #${run.pr}`;
return run.agent ? `${run.agent} from ${run.repo}` : run.repo;
}
/** The run a `?run=<id>` query names, or `null` when it names none. */
export function wantedRun(search: string): string | null {
const id = new URLSearchParams(search).get("run");