Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ migration step.

## [Unreleased]

### Changed

- A run with a job on a runner shows as running: spinning icon and a sweep along
the row. GitHub keeps such a run "queued" while any other job still waits for a
runner, so it used to show the still queued dot. Queued runs pulse gently; both
animations stop under `prefers-reduced-motion`.
- A busy runner whose job Forge can't see (a repository it doesn't watch) says so,
instead of "waiting for work" next to a busy badge.

### Fixed

- Deregistered repo runners now leave the board. Pruning took the scope from
Expand Down
27 changes: 23 additions & 4 deletions forge/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@
.ico.running{background:rgba(255,181,71,.15);color:var(--run)}
.ico.running svg{animation:spin 1.1s linear infinite}
.ico.queued{background:rgba(142,162,255,.14);color:var(--queue)}
.ico.queued svg{animation:blink 1.2s ease-in-out infinite alternate}
/* A run with a job on a runner: a sweep along the row's bottom edge, like a hot stat. */
.run.running{position:relative;background:linear-gradient(90deg,rgba(255,181,71,.05),transparent 40%)}
.run.running::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;overflow:hidden;
background:linear-gradient(90deg,transparent,var(--run),transparent);background-size:50% 100%;background-repeat:no-repeat;
animation:rowsweep 1.8s linear infinite}
@keyframes rowsweep{from{background-position:-50% 0}to{background-position:150% 0}}
@media (prefers-reduced-motion:reduce){.run.running::after,.ico.running svg,.ico.queued svg{animation:none}}
.ico.cancelled,.ico.skipped{background:rgba(139,147,167,.12);color:var(--cancel)}
@keyframes spin{to{transform:rotate(360deg)}}
.where{font:600 10px var(--mono);letter-spacing:.04em;padding:1px 6px;border-radius:4px}
Expand Down Expand Up @@ -438,6 +446,12 @@ <h2>Test suites <span class="count" id="ts-count"></span><span class="right mute
if (conclusion === "success") return "success";
return "cancelled";
}
// GitHub keeps a run "queued" while any of its jobs waits for a runner, even with
// other jobs already running; a run with a job in progress is running.
function runKind(r){
if (r.status !== "completed" && (r.jobs || []).some(j => j.status === "in_progress")) return "running";
return kind(r.status, r.conclusion);
}
const now = () => Date.now() + skew;
const SPARK = '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2l1.9 5.6L19.5 9.5l-5.6 1.9L12 17l-1.9-5.6L4.5 9.5l5.6-1.9zM19 14l.9 2.6 2.6.9-2.6.9L19 21l-.9-2.6-2.6-.9 2.6-.9z"/></svg>';
function aiBtn(kind, id, title, sm){
Expand Down Expand Up @@ -551,7 +565,12 @@ <h2>Test suites <span class="count" id="ts-count"></span><span class="right mute
<div class="top"><div><div class="kind">Runner</div><div class="nm">${esc(r.name)}</div><div class="sc">${scopeText(r.scope)} · ${util}% busy 24h</div></div>
<span class="state ${st}">${st}</span>${aiBtn("runner", r.name, "runner " + r.name, true)}</div>
<div class="job">${r.current ? `<a href="${esc(r.current.url)}" target="_blank"><b>${esc(r.current.name)}</b> · ${esc(short(r.current.repo))} · <span class="mono" data-since="${esc(r.current.started_at)}"></span></a>`
: st === "offline" ? `offline ${r.offline_since ? "for <span class=mono data-since-epoch=" + r.offline_since + "></span>" : ""}` : "waiting for work"}</div>
: st === "offline" ? `offline ${r.offline_since ? "for <span class=mono data-since-epoch=" + r.offline_since + "></span>" : ""}`
// GitHub says busy but Forge has no job for it: a repo Forge doesn't watch
// (not in FORGE_REPOS, or no push within FORGE_DISCOVER_DAYS), or a job
// assigned since the last poll.
: st === "busy" ? `<span title="GitHub reports this runner busy, but the job belongs to a repository Forge isn't watching, or it started since the last poll. Add the repository to FORGE_REPOS to see its jobs here.">running a job from a repo Forge doesn't watch</span>`
: "waiting for work"}</div>
<div class="chips" title="runs-on labels: ${esc(r.labels.join(", "))}"><span class="k">labels</span>${
r.labels.filter(l => !["self-hosted","Linux","X64"].includes(l)).map(l =>
`<span class="chip ${l===S.config.host_label?"hl":""}" ${l===S.config.host_label?'title="Matches this dashboard\'s host label"':""}>${esc(l)}</span>`).join("")
Expand Down Expand Up @@ -589,7 +608,7 @@ <h2>Test suites <span class="count" id="ts-count"></span><span class="right mute
function filtered(){
const q = F.q.toLowerCase();
return S.runs.filter(r => {
const k = kind(r.status, r.conclusion);
const k = runKind(r);
if (F.status === "failed" && k !== "failure") return false;
if (F.status === "running" && !(k === "running" || k === "queued")) return false;
if (F.status === "passed" && k !== "success") return false;
Expand All @@ -610,8 +629,8 @@ <h2>Test suites <span class="count" id="ts-count"></span><span class="right mute
const rows = filtered();
$("#runs-count").textContent = rows.length;
$("#runs").innerHTML = rows.slice(0, limit).map(r => {
const k = kind(r.status, r.conclusion), isOpen = open.has(r.id);
return `<div class="run ${isOpen ? "open" : ""}" data-id="${r.id}" id="run-${r.id}">
const k = runKind(r), isOpen = open.has(r.id);
return `<div class="run ${k === "running" ? "running" : ""} ${isOpen ? "open" : ""}" data-id="${r.id}" id="run-${r.id}">
<div class="ico ${k}">${ICON[k]}</div>
<div style="min-width:0"><div class="ti">${esc(r.title)}</div>
<div class="meta"><span>${esc(r.name)}</span><span class="dim">${esc(short(r.repo))}</span><span class="br">${esc(r.branch)}</span>
Expand Down