usage charts on the shared chart module: my-usage chart + co-op trend tooltips

Both usage views get charts. The co-op trend refactor onto the shared
coop_chart.js module replaces its native <title> tooltips with the panel's
exact-value hover tooltips (registerChartTips contract). NEW: the my-usage
view gets a per-day chart (Spend/Requests metric toggle, 30/90/all-time
period toggle) fed by /broker/usage's new daily series, same shared module,
same tooltip contract. No chart library, no CDN.
CI: .woodpecker.yml (oidc + chart sync pins, both harnesses via the vendored
check-page-js.sh, which splices the module as the app does).
Verified: rendering captured across all chart states matches the panel's
shared-module output; harnesses exercise exact values, zero days, gaps,
clamping, no-refetch toggles.
This commit is contained in:
inference-bot committed 2026-11-13 16:11:23 +00:00
1 parent 622982a371
commit 8c469c1242
6 files changed
+750 -67

No files matched your search

+54
View File
@@ -0,0 +1,54 @@
# Woodpecker CI pipeline for the member dashboard — THIN on purpose.
#
# Runs the dashboard's EXISTING checks, unchanged:
# tests/test_oidc_sync.py the app's oidc.py is byte-identical to the
# canonical module in ops-docs (any hand edit goes red)
# tests/test_chart_sync.py the app's coop_chart.js is byte-identical to the
# canonical shared chart module in ops-docs
# tests/check-page-js.sh + harnesses: the page JS checker (node --check on the
# real <script> block, then stub + page JS + harness
# in ONE node scope) against every harness:
# dashboard-chart-harness.js (usage charts: shared module tooltips, exact
# values, gaps, 30/90/all toggles)
# dashboard-guests-harness.js (guest trail state rendering)
#
# tests/check-page-js.sh is vendored byte-identically from the admin panel's
# vendored copy (the CI agent container has no host filesystem) — keep the
# copies in step; both splices the shared chart module into the extracted page
# JS exactly as the app does at import time.
#
# Gating: `push` fires on every push (including branch pushes) so a red run
# blocks the merge via Gitea branch protection (status check
# `ci/woodpecker/push/main`). `manual` kept for hand-triggered runs.
#
# Backend note (why there are no container images here):
# The agent is a Cloudron app with no Docker socket → Woodpecker `local`
# backend: each step is a shell command INSIDE the agent container and the
# step's `image:` field selects the SHELL. python3 + node + bash are baked
# into the agent image (co-op/woodpecker-agent). Nothing to install at run
# time — the sync tests are stdlib-only by design.
when:
- event: push
- event: manual
steps:
- name: tests
image: bash
commands:
# Sync pins first: a drifted copy fails the run before anything else.
- python3 tests/test_oidc_sync.py
- python3 tests/test_chart_sync.py
# Run every harness even when one fails, then fail the step — a plain
# command chain would hide all failures after the first.
- |
fails=0
for h in dashboard-chart-harness.js dashboard-guests-harness.js; do
echo "== harness: $h"
bash tests/check-page-js.sh app/main.py "$h" || fails=$((fails+1))
done
if [ "$fails" -ne 0 ]; then
echo "FAILED: $fails harness run(s) red"
exit 1
fi
echo "all member-dashboard checks green"