feat(dashboard): monthly-cost + requests-by-provider widgets - #131
Conversation
Register two TYPO3 dashboard widgets sourced from tx_nrllm_service_usage: - MonthlyCostDataProvider feeds a NumberWithIconWidget with the floored USD total for the current calendar month. - RequestsByProviderDataProvider feeds a BarChartWidget with request counts per provider over the last seven days (chart.js format). Both reuse TYPO3's built-in widget classes; no custom widget PHP needed. Registration lives in Configuration/Services.Dashboard.yaml, imported conditionally from Services.php only when typo3/cms-dashboard is present — installs without dashboard see no container errors and simply lose the widgets. Classes/Widgets/* excluded from the Services.yaml autoload glob for the same reason. composer.json: dashboard moved to require-dev (so PHPStan resolves WidgetInterface) and added to a new suggest block for consumers. See ADR-024 for shape rationale (two separate widgets rather than one combined tile) and the flooring trade-off on the cost value. Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
There was a problem hiding this comment.
Automated approval for maintainer PR
All automated quality gates passed. See SECURITY_CONTROLS.md for compensating controls.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #131 +/- ##
============================================
- Coverage 93.67% 93.49% -0.18%
- Complexity 2209 2218 +9
============================================
Files 87 89 +2
Lines 8109 8150 +41
============================================
+ Hits 7596 7620 +24
- Misses 513 530 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
There was a problem hiding this comment.
Automated approval for maintainer PR
All automated quality gates passed. See SECURITY_CONTROLS.md for compensating controls.
Mutation testing burns ~15 min and emits a signal PR authors can't act on locally — most mutants live in code the PR didn't touch. Keep it on main / merge_group / schedule events so the MSI regression bar stays enforced, but drop it from PR CI. Fuzz tests still run on every event. Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
There was a problem hiding this comment.
Automated approval for maintainer PR
All automated quality gates passed. See SECURITY_CONTROLS.md for compensating controls.
Summary
Two TYPO3 dashboard widgets surfacing data from the existing
tx_nrllm_service_usagetable:NumberWithIconWidgetwithMonthlyCostDataProvider. Returns USD floored to an integer (glance value, not accounting).BarChartWidgetwithRequestsByProviderDataProvider. Chart.js bar chart of requests per provider over the last 7 days, aggregated across all service types.Both reuse TYPO3's built-in widget classes; no custom widget PHP needed. Registration lives in
Configuration/Services.Dashboard.yaml, imported conditionally fromServices.phponly whentypo3/cms-dashboardis installed. Without that guard, installs without dashboard would fail to compile the container on unresolvable widget class references.composer.json
typo3/cms-dashboardmoved torequire-dev(so PHPStan resolvesWidgetInterface) and added to a newsuggestblock for consumers.Classes/Widgets/*excluded from the main Services.yaml autoload glob for the same "only load when dashboard present" reason.Test plan
See ADR-024 for the "two widgets vs. one combined tile" decision and the cost-flooring trade-off.