Expose report metrics to bigb #47

Merged
Gilles merged 8 commits from feat/46-report-metrics-bigb into master 2026-10-29 22:56:35 +00:00
Owner

Closes #46

Stacked on #43 (base feat/41-overview, so its migration is reports 0011 after #42's 0010).

Changes

  • ReportMetric (migration reports 0011): one row per numeric "format maison" metric that has a key — report, project, key, value, date (report reception), label, unit, and the stream fields (type, custom name, ref, variant). Index (project, key, at).
  • apps/reports/metrics.py: rows rewritten by process_report (reprocessing replaces them), deleted with the report (cascade); a de-duplicated source report adds nothing. Numbers or numeric strings only (no bool / list / NaN).
  • The migration backfills every processed custom report already stored.
  • bigb: reports.ReportMetric registered, same "readable projects" scope as Project/Report, value aggregatable; execute_query added to the bigb viewers group (the charts are ad hoc queries, still scoped).
  • README, feature catalog; tests in apps/reports/test_metrics.py (incl. an end-to-end scoped bigb query, skipped where bigb isn't installed, like the other bigb tests).

Depends on

The charts use the QuerySpec fields of Gilles/bigb-django#6: once it's released, bump bigb-django here (Renovate will offer it).

Checks

pytest (261 passed with bigb installed locally), pylint 10/10, autopep8, bandit clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA

Closes #46 **Stacked on #43** (base `feat/41-overview`, so its migration is `reports 0011` after #42's `0010`). ## Changes - `ReportMetric` (migration `reports 0011`): one row per numeric "format maison" metric that has a `key` — report, project, key, value, date (report reception), label, unit, and the stream fields (type, custom name, ref, variant). Index `(project, key, at)`. - `apps/reports/metrics.py`: rows rewritten by `process_report` (reprocessing replaces them), deleted with the report (cascade); a de-duplicated source report adds nothing. Numbers or numeric strings only (no bool / list / NaN). - The migration **backfills** every processed custom report already stored. - bigb: `reports.ReportMetric` registered, same "readable projects" scope as Project/Report, `value` aggregatable; `execute_query` added to the bigb viewers group (the charts are ad hoc queries, still scoped). - README, feature catalog; tests in `apps/reports/test_metrics.py` (incl. an end-to-end scoped bigb query, skipped where bigb isn't installed, like the other bigb tests). ## Depends on The charts use the QuerySpec `fields` of Gilles/bigb-django#6: once it's released, bump `bigb-django` here (Renovate will offer it). ## Checks pytest (261 passed with bigb installed locally), pylint 10/10, autopep8, bandit clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA
feature: expose report metrics to bigb
All checks were successful
ci / test (pull_request) Successful in 3m28s
ci / e2e (pull_request) Has been skipped
ci / docker (pull_request) Has been skipped
ci / deploy (pull_request) Has been skipped
11392aa1c1
- ReportMetric: one row per numeric custom-report metric with a key
  (report, project, stream fields, key, label, value, unit, date),
  rewritten when the report is processed, deleted with it, backfilled
  from existing reports by the migration.
- Registered with bigb (reports.ReportMetric), scoped to readable
  projects like the other models; value aggregatable.
- The bigb viewers group may run ad hoc queries (execute_query): the
  metric charts are ad hoc queries.

Closes #46

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA
Author
Owner
<!-- argus-link-bot:argus/backend --> 📊 [Rapports Argus pour cette PR](https://reports.stationmyr.net/argus/backend/pr/47)
chore: bigb-django 1.3.0 (QuerySpec fields, for the metric charts)
Some checks failed
ci / e2e (pull_request) Has been cancelled
ci / docker (pull_request) Has been cancelled
ci / deploy (pull_request) Has been cancelled
ci / test (pull_request) Successful in 3m38s
19e2708769
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA
Merge remote-tracking branch 'origin/feat/41-overview' into feat/46-report-metrics-bigb
Some checks failed
ci / test (pull_request) Has been cancelled
ci / e2e (pull_request) Has been cancelled
ci / docker (pull_request) Has been cancelled
ci / deploy (pull_request) Has been cancelled
febb15d2c9
feature: metrics filterable by project owner/repo (what the SPA knows)
All checks were successful
ci / test (pull_request) Successful in 3m26s
ci / e2e (pull_request) Has been skipped
ci / docker (pull_request) Has been skipped
ci / deploy (pull_request) Has been skipped
00869eaf9b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA
Gilles changed target branch from feat/41-overview to master 2026-10-29 22:36:02 +00:00
Merge remote-tracking branch 'origin/master' into feat/46-report-metrics-bigb
All checks were successful
ci / test (pull_request) Successful in 3m27s
ci / e2e (pull_request) Has been skipped
ci / docker (pull_request) Has been skipped
ci / deploy (pull_request) Has been skipped
c1e5ee94f6
# Conflicts:
#	README.md
Gilles scheduled this pull request to auto merge when all checks succeed 2026-10-29 22:36:48 +00:00
Gilles merged commit 961fc862f9 into master 2026-10-29 22:56:35 +00:00
Gilles deleted branch feat/46-report-metrics-bigb 2026-10-29 22:56:35 +00:00
Gilles referenced this pull request from a commit 2026-10-29 22:56:37 +00:00
Gilles referenced this pull request from a commit 2026-10-29 23:10:59 +00:00
Sign in to join this conversation.
No description provided.