Skip to content
Merged
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
17 changes: 10 additions & 7 deletions scripts/render_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,29 +462,32 @@ def render_index(audit: dict) -> str:
<header class="doc">
<p class="eyebrow">QuantEcon · generated data audit · Python lecture family</p>
<h1>Lecture data — audit &amp; migration dashboard</h1>
<p class="meta">Every dataset referenced by lecture source across the 8 synced Python-family repos,
<p class="meta">Every dataset referenced by lecture source across the {len(audit["repos"])} synced Python-family repos,
regenerated from each repo's <code>main</code> by
<a href="{DL}/blob/main/scripts/build_audit.py">a script</a> — not maintained by hand.
Companion to the migration of lecture data into
<a href="{DL}">QuantEcon/data-lectures</a>.</p>
<span id="freshness" class="freshness" data-generated="{esc(audit["generated"])}"
title="Rebuilt on every change to data-lectures and weekly on schedulea badge older than a week means the scheduled rebuild has stopped.">
generated {esc(audit["generated"])}</span>
title="Every build re-runs the full audit scan across the {len(audit["repos"])} lecture repos — this date IS the last audit run. It runs on every change to data-lectures, weekly on schedule, and on demand; a badge older than a week means the scheduled run has stopped succeeding.">
audit ran {esc(audit["generated"])}</span>
<script>
(function () {{
var el = document.getElementById('freshness');
var gen = new Date(el.dataset.generated + 'T00:00:00Z');
// Full calendar days since the (date-only, midnight-UTC) run stamp —
// deliberately floored. Raw-ms thresholds would flip the badge orange
// every Monday between 00:00 UTC and the 05:17 cron completing.
var days = Math.floor((Date.now() - gen.getTime()) / 86400000);
if (isNaN(days)) return;
var age = days <= 0 ? 'today' : days === 1 ? 'yesterday' : days + ' days ago';
if (days > 14) {{
el.classList.add('crit');
el.textContent = '✗ stale — last updated ' + age + ' (' + el.dataset.generated + '); the scheduled rebuild has stopped';
el.textContent = '✗ audit stale — last ran ' + age + ' (' + el.dataset.generated + '); scheduled runs have stopped succeeding';
}} else if (days > 7) {{
el.classList.add('warn');
el.textContent = '⚠ last updated ' + age + ' (' + el.dataset.generated + ') — the weekly rebuild is overdue';
el.textContent = '⚠ audit last ran ' + age + ' (' + el.dataset.generated + ') — the weekly run is overdue';
}} else {{
el.textContent = '● up to date — last updated ' + age + ' (' + el.dataset.generated + ')';
el.textContent = '● audit up to date — last ran ' + age + ' (' + el.dataset.generated + ')';
}}
}})();
</script>
Expand Down Expand Up @@ -1104,7 +1107,7 @@ def render_audit_page(audit: dict) -> str:
<header class="doc">
<p class="eyebrow">Full audit · regenerated from each repo's <code>main</code></p>
<h1>Dataset registry — Python lecture family</h1>
<p class="meta">Every dataset referenced by lecture source across the 8 synced repos.
<p class="meta">Every dataset referenced by lecture source across the {len(audit["repos"])} synced repos.
The successor to the hand-built {PREV_SNAPSHOT} audit — same taxonomy, now generated.</p>
</header>
<div class="stats">
Expand Down
Loading