Skip to content

chore(demo): expand synthetic dashboard data - #557

Merged
SantiagoDePolonia merged 2 commits into
mainfrom
chore/demo-interation
Jul 19, 2026
Merged

SantiagoDePolonia merged 2 commits into
mainfrom
chore/demo-interation

Conversation

@SantiagoDePolonia

@SantiagoDePolonia SantiagoDePolonia commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • extend the rolling 90-day demo seed with configurable token scaling, realistic cache percentages, request-rewrite savings, and request/response audit bodies
  • seed scoped budgets and rate-limit rules across user paths, providers, models, requests, tokens, and concurrency without overwriting manually owned rules
  • issue three functional demo API keys and print their one-time values after each seed
  • add smart, normal, fast, cheap, and quality virtual-model aliases plus five cross-provider failover chains
  • embed a compact spoken MP3 fixture in every generated STT upload and TTS response; the playable audio, request text, and transcript all say "Prompt caching is active."
  • add disabled MCP examples, migrate legacy SQLite schemas before seeding, and provide make demo to seed then start GoModel

The default dataset remains about 72k usage/audit rows while averaging roughly 10.7M tokens per day. Rate-limit counters remain live process state by design and populate when requests are made with the generated keys.

Validation

  • bash -n tools/seed-demo-data.sh and git diff --check
  • focused Go tests for audit logs, dashboard, API keys, virtual models, failover, and rate limits
  • dashboard JavaScript suite: 480 passing
  • pre-commit hooks for both changed files
  • fresh and existing SQLite seed runs, JSON validation, audio base64 round-trip, and PRAGMA integrity_check
  • live admin API checks for 3 API keys, 5 aliases, 5 failovers, 15 rate-limit rules, and stored playable audio without audit warnings

@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The demo workflow now seeds scaled token usage, context-rewrite telemetry, rate limits, and disabled MCP configurations. SQLite migrations support the new fields and tables, reporting includes rewrite and daily token metrics, and a make demo target seeds data before launching the app.

Changes

Demo seeding flow

Layer / File(s) Summary
Seeder inputs and schema
tools/seed-demo-data.sh
Adds token and rewrite controls, validates their ranges, and creates or migrates usage, rate-limit, and MCP schema objects with indexes.
Rewrite-aware usage generation
tools/seed-demo-data.sh
Scales generated tokens, determines eligible rewrites, and records rewrite savings in usage data, raw JSON, and audit revisions.
Rate-limit and MCP records
tools/seed-demo-data.sh
Seeds rate-limit rules and disabled docs and CRM MCP server configurations after removing matching prior records.
Demo command and reporting
Makefile, tools/seed-demo-data.sh
Adds the phony demo target and reports rewritten-request aggregates plus daily token statistics.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant Makefile
  participant Seeder
  participant SQLite
  participant App
  Developer->>Makefile: Run make demo
  Makefile->>Seeder: Run seed-demo-data
  Seeder->>SQLite: Migrate schema and insert demo telemetry
  Makefile->>App: Run application
Loading

Possibly related PRs

Poem

A bunny found tokens, scaled with care,
Rewrite trails bloomed everywhere.
Rate limits hopped into the queue,
MCP servers slept, disabled too.
“Make demo!” cried the rabbit bright—
Seed the data, then start the night!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: expanding the demo's synthetic dashboard data.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/demo-interation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@greptile-apps

greptile-apps Bot commented Jul 19, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

Safe to merge with low risk.

Changes are limited to demo seeding and a Makefile convenience target. Seed inputs are validated before SQL interpolation. Demo rate-limit rows avoid overwriting manually owned rules. Seeded SQLite table shapes match the reviewed application stores.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • Verified the seed script syntax check passed (bash -n tools/seed-demo-data.sh) with exit code 0.
  • Verified the seed script help output was expanded with environment/usage text and exited with code 0.
  • Verified the focused Go tests for four packages all passed and exited 0.
  • Verified the dashboard JS tests all passed (81/81) and exited 0.
  • Verified the SQLite seed smoke test could not run because sqlite3 was not available, so no seed DB was created.

View all artifacts

T-Rex Ran code and verified through T-Rex

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Dev as Developer
participant Make as make demo
participant Seed as tools/seed-demo-data.sh
participant DB as SQLite database
participant App as GoModel

Dev->>Make: run `make demo`
Make->>Seed: seed-demo-data dependency
Seed->>DB: enable WAL and migrate legacy columns/tables
Seed->>DB: delete previous rows owned by seed prefix
Seed->>DB: insert generated usage and audit telemetry
Seed->>DB: upsert budgets and budget settings
Seed->>DB: insert demo rate-limit rules when keys are unowned
Seed->>DB: replace disabled demo MCP server examples
Seed-->>Make: print seeded row summaries
Make->>App: run GoModel with populated dashboard data
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Dev as Developer
participant Make as make demo
participant Seed as tools/seed-demo-data.sh
participant DB as SQLite database
participant App as GoModel

Dev->>Make: run `make demo`
Make->>Seed: seed-demo-data dependency
Seed->>DB: enable WAL and migrate legacy columns/tables
Seed->>DB: delete previous rows owned by seed prefix
Seed->>DB: insert generated usage and audit telemetry
Seed->>DB: upsert budgets and budget settings
Seed->>DB: insert demo rate-limit rules when keys are unowned
Seed->>DB: replace disabled demo MCP server examples
Seed-->>Make: print seeded row summaries
Make->>App: run GoModel with populated dashboard data
Loading

Reviews (1): Last reviewed commit: "chore(demo): expand synthetic dashboard ..." | Re-trigger Greptile

@SantiagoDePolonia
SantiagoDePolonia merged commit 503cdae into main Jul 19, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants