Skip to content
Merged
Changes from 1 commit
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
13 changes: 8 additions & 5 deletions scripts/render_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,23 +468,26 @@ def render_index(audit: dict) -> str:
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 8 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.">
Comment thread
mmcky marked this conversation as resolved.
Outdated
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
Loading