ops: dossiers-ngi edition tree bar, 10min tip-skip rebuild, cleanup

This commit is contained in:
Hernâni Marques 2026-09-30 15:35:35 +02:00
parent ebecb26c7c
commit ee82ef9b6e
No known key found for this signature in database
22 changed files with 1458 additions and 173 deletions

View file

@ -0,0 +1,51 @@
.cascade-bar {
position: sticky;
top: 0;
z-index: 10;
margin: -1.5rem -1.5rem 1rem;
padding: 0.55rem 1.5rem 0.65rem;
background: #10141a;
border-bottom: 1px solid #243040;
color: #c8d0d8;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 12px;
line-height: 1.45;
}
.cascade-tree-lines {
white-space: pre;
overflow-x: auto;
}
a.cascade-tree-row {
display: block;
color: #7ec8ff;
text-decoration: none;
padding: 0.05rem 0.15rem;
border-radius: 2px;
}
a.cascade-tree-row:hover {
background: #1a2430;
text-decoration: none;
}
a.cascade-tree-row.is-active {
color: #e8eef4;
background: #1e2a38;
box-shadow: inset 3px 0 0 #e8eef4;
}
a.cascade-tree-row.is-active:hover {
text-decoration: none;
}
.cascade-bar code { color: inherit; font-size: inherit; }
.cascade-bar .tip {
color: #8a96a3;
}
.cascade-bar .cascade-default {
color: #6a9080;
}
.cascade-timing {
margin-top: 0.35rem;
color: #6a7888;
font-size: 11px;
}
.cascade-bar .tip {
white-space: pre-wrap;
}

View file

@ -0,0 +1,5 @@
<link rel="stylesheet" href="/_cascade/bar.css">
<nav class="cascade-bar" aria-label="cascade builds" id="cascade-bar">
<div class="cascade-tree" id="cascade-tree" role="tree">Loading builds…</div>
</nav>
<script src="/_cascade/bar.js" defer></script>

View file

@ -0,0 +1,146 @@
(function () {
function cookieEdition() {
var m = document.cookie.match(/(?:^|; )tdpd_edition=([^;]*)/);
if (!m) return "flask";
try {
return decodeURIComponent(m[1]) || "flask";
} catch (e) {
return "flask";
}
}
function esc(s) {
return String(s)
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;");
}
function shortTime(iso) {
if (!iso) return "";
// keep local-looking wall clock from ISO when possible
var m = String(iso).match(/T(\d{2}:\d{2})/);
if (m) return m[1];
return String(iso).slice(0, 16);
}
function fmtBuildSec(sec) {
if (sec == null || sec === "") return "";
var n = Number(sec);
if (!isFinite(n)) return "";
if (n < 10) return n.toFixed(1) + "s";
return Math.round(n) + "s";
}
function markActive(root, edition) {
var links = root.querySelectorAll("a[data-edition]");
for (var i = 0; i < links.length; i++) {
var a = links[i];
var ed = a.getAttribute("data-edition");
var on =
ed === edition ||
(edition === "flask" && a.getAttribute("data-default") === "1");
if (on) {
a.classList.add("is-active");
a.setAttribute("aria-current", "page");
} else {
a.classList.remove("is-active");
a.removeAttribute("aria-current");
}
}
}
function renderTree(data) {
var mount = document.getElementById("cascade-tree");
if (!mount) return;
var list = (data && data.branches) || [];
if (!list.length) {
mount.textContent = "No branches in branch-status.json";
return;
}
var defaultBranch = (data && data.default_branch) || "feat/website-views";
var timing = (data && data.rebuild_timing) || null;
var html = [];
html.push('<div class="cascade-tree-lines" role="group">');
for (var i = 0; i < list.length; i++) {
var row = list[i];
var edition = row.edition || "";
var branch = row.branch || "";
var tip = row.tip || "";
var prefix = row.prefix || "";
var parent = row.parent || "";
var tipTime = row.tip_time || "";
var builtAt = row.built_at || "";
var buildSec = row.build_seconds;
var isDefault = branch === defaultBranch;
var metaBits = [];
if (tip) metaBits.push("@" + tip);
if (tipTime) metaBits.push("tip " + shortTime(tipTime));
if (buildSec != null && buildSec !== "")
metaBits.push("build " + fmtBuildSec(buildSec));
if (builtAt) metaBits.push("at " + shortTime(builtAt));
var label =
esc(prefix) +
"<code>" +
esc(branch) +
"</code>" +
(metaBits.length
? '<span class="tip"> ' + esc(metaBits.join(" · ")) + "</span>"
: "") +
(isDefault ? '<span class="cascade-default"> · default</span>' : "");
html.push(
'<a class="cascade-tree-row" role="treeitem" href="/_cascade/use/' +
esc(edition) +
'" data-edition="' +
esc(edition) +
'"' +
(parent ? ' data-parent="' + esc(parent) + '"' : "") +
(isDefault ? ' data-default="1"' : "") +
' title="Switch build to ' +
esc(branch) +
(tip ? " @ " + esc(tip) : "") +
(tipTime ? " tip=" + esc(tipTime) : "") +
(buildSec != null ? " build=" + esc(fmtBuildSec(buildSec)) : "") +
'">' +
label +
"</a>"
);
}
html.push("</div>");
if (timing && timing.wall_seconds != null) {
html.push(
'<div class="cascade-timing">last full pass ~' +
esc(String(timing.wall_seconds)) +
"s · built " +
esc(String(timing.built || 0)) +
" / skipped " +
esc(String(timing.skipped || 0)) +
" / " +
esc(String(timing.branches || list.length)) +
"</div>"
);
}
mount.innerHTML = html.join("");
markActive(mount, cookieEdition());
}
var edition = cookieEdition();
var mount = document.getElementById("cascade-tree");
fetch("/branch-status.json", { cache: "no-store" })
.then(function (res) {
if (!res.ok) throw new Error("status");
return res.json();
})
.then(function (data) {
renderTree(data);
})
.catch(function () {
if (mount) {
mount.innerHTML =
'<a class="cascade-tree-row" href="/_cascade/use/flask" data-edition="flask"><code>flask</code></a>' +
'<span class="tip"> (branch-status unavailable)</span>';
markActive(mount, edition);
}
});
})();

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>feat/sm-content</title>
<style>
:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
margin: 0; padding: 1.5rem;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
font-size: 14px; line-height: 1.45;
background: #0b0d10; color: #c8d0d8;
}
a { color: #7ec8ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.5rem; color: #e8eef4; }
.meta { color: #8a96a3; margin: 0 0 1rem; }
ul.plain { padding-left: 1.2rem; margin: 0; }
li { margin: 0.25rem 0; }
.dim { color: #6a7682; }
</style>
</head>
<body>
{% include "_cascade/bar.html" . %}
<h1><code>/feat-sm-content/</code></h1>
<p class="meta">last-built: 2026-09-30T02:30:50+02:00 <span class="dim">·</span> <code>feat/sm-content</code> @ <code>089ef1f</code></p>
</body>
</html>

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>feat/website-design</title>
<style>
:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
margin: 0; padding: 1.5rem;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
font-size: 14px; line-height: 1.45;
background: #0b0d10; color: #c8d0d8;
}
a { color: #7ec8ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.5rem; color: #e8eef4; }
.meta { color: #8a96a3; margin: 0 0 1rem; }
ul.plain { padding-left: 1.2rem; margin: 0; }
li { margin: 0.25rem 0; }
.dim { color: #6a7682; }
</style>
</head>
<body>
{% include "_cascade/bar.html" . %}
<h1><code>/feat-website-design/</code></h1>
<p class="meta">last-built: 2026-09-30T02:30:50+02:00 <span class="dim">·</span> <code>feat/website-design</code> @ <code>2e26c80</code></p>
</body>
</html>

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>feat/website-features</title>
<style>
:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
margin: 0; padding: 1.5rem;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
font-size: 14px; line-height: 1.45;
background: #0b0d10; color: #c8d0d8;
}
a { color: #7ec8ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.5rem; color: #e8eef4; }
.meta { color: #8a96a3; margin: 0 0 1rem; }
ul.plain { padding-left: 1.2rem; margin: 0; }
li { margin: 0.25rem 0; }
.dim { color: #6a7682; }
</style>
</head>
<body>
{% include "_cascade/bar.html" . %}
<h1><code>/feat-website-features/</code></h1>
<p class="meta">last-built: 2026-09-30T02:30:50+02:00 <span class="dim">·</span> <code>feat/website-features</code> @ <code>53a3176</code></p>
</body>
</html>

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>feat/website-views</title>
<style>
:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
margin: 0; padding: 1.5rem;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
font-size: 14px; line-height: 1.45;
background: #0b0d10; color: #c8d0d8;
}
a { color: #7ec8ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.5rem; color: #e8eef4; }
.meta { color: #8a96a3; margin: 0 0 1rem; }
ul.plain { padding-left: 1.2rem; margin: 0; }
li { margin: 0.25rem 0; }
.dim { color: #6a7682; }
</style>
</head>
<body>
{% include "_cascade/bar.html" . %}
<h1><code>/feat-website-views/</code></h1>
<p class="meta">last-built: 2026-09-30T02:30:50+02:00 <span class="dim">·</span> <code>feat/website-views</code> @ <code>bbafc38</code></p>
</body>
</html>

View file

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>cascade landing</title>
<style>
:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
margin: 0; padding: 1.5rem;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
font-size: 14px; line-height: 1.45;
background: #0b0d10; color: #c8d0d8;
}
a { color: #7ec8ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.5rem; color: #e8eef4; }
.meta { color: #8a96a3; margin: 0 0 1rem; }
ul.plain { padding-left: 1.2rem; margin: 0; }
li { margin: 0.25rem 0; }
.dim { color: #6a7682; }
</style>
</head>
<body>
{% include "_cascade/bar.html" . %}
<h1>cascade</h1>
<p class="meta">Flask freeze lives at <a href="/"><code>/</code></a> (views). This ladder is tip stubs only.</p>
<p class="meta">last-built: 2026-09-30T02:30:50+02:00</p>
<ul class="plain">
<li><a href="/cascade/main/"><code>/main/</code></a> <span class="dim">·</span> <code>main</code> @ <code>d2fbd79</code></li>
<li><a href="/cascade/feat-sm-content/"><code>/feat-sm-content/</code></a> <span class="dim">·</span> <code>feat/sm-content</code> @ <code>089ef1f</code></li>
<li><a href="/cascade/feat-website-features/"><code>/feat-website-features/</code></a> <span class="dim">·</span> <code>feat/website-features</code> @ <code>53a3176</code></li>
<li><a href="/cascade/feat-website-design/"><code>/feat-website-design/</code></a> <span class="dim">·</span> <code>feat/website-design</code> @ <code>2e26c80</code></li>
<li><a href="/cascade/feat-website-views/"><code>/feat-website-views/</code></a> <span class="dim">·</span> <code>feat/website-views</code> @ <code>bbafc38</code></li>
</ul>
</body>
</html>

View file

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>main</title>
<style>
:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
margin: 0; padding: 1.5rem;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
font-size: 14px; line-height: 1.45;
background: #0b0d10; color: #c8d0d8;
}
a { color: #7ec8ff; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.5rem; color: #e8eef4; }
.meta { color: #8a96a3; margin: 0 0 1rem; }
ul.plain { padding-left: 1.2rem; margin: 0; }
li { margin: 0.25rem 0; }
.dim { color: #6a7682; }
</style>
</head>
<body>
{% include "_cascade/bar.html" . %}
<h1><code>/main/</code></h1>
<p class="meta">last-built: 2026-09-30T02:30:50+02:00 <span class="dim">·</span> <code>main</code> @ <code>d2fbd79</code></p>
</body>
</html>